Commit 93e24e41 authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

start bedtools bamtofastq

parent 1998065a
__bedtools_bamtofastq_pairs_bedtools_exec_command = config.get(
'bedtools_bamtofastq_pairs', {}
).get('bedtools_exec_command', 'bedtools')
__bedtools_bamtofastq_pairs_modules = config.get('bedtools_bamtofastq_pairs', {}).get('modules')
rule bedtools_bamtofastq_pairs:
input:
__bedtools_bamtofastq_pairs_input
output:
forward = __bedtools_bamtofastq_pairs_output_forward,
reverse = __bedtools_bamtofastq_pairs_output_reverse
params:
exec_command = __bedtools_bamtofastq_pairs_bedtools_exec_command,
modules = __bedtools_bamtofastq_pairs_modules
run:
command = []
if params.modules:
command.append("module load {params.modules}")
command.append(
"{params.exec_command} bamtofastq -i {input} -fq {output.forward}.fastq -fq2 {output.reverse}.fastq"
)
command.append("gunzip {output}_1.fastq")
command.append("gunzip {output}_2.fastq")
shell(" && ".join(command))
\ No newline at end of file
configfile: "config.yaml"
# ==== Snakefile path ====
__bedtools_bamtofastq_pairs_rules = config.get("snakefiles", {}).get("bedtools_bamtofastq_pairs")
__main_output_dir = config.get('output_dir', 'output')
# ==== Main config ====
SAMPLES = config.get('samples')
__input_dir = config.get('input_dir', 'data')
# ==== Bedtools bamtofastq ====
__bedtools_bamtofastq_pairs_output_dir = f"{__main_output_dir}/bedtools_bamtofastq_pairs"
__bedtools_bamtofastq_pairs_input = "{dir}/{{sample}}.bam".format(dir=__input_dir, sample="{sample}")
__bedtools_bamtofastq_pairs_output = "{dir}/{{sample}}".format(dir=__bedtools_bamtofastq_pairs_output_dir, sample="{sample}")
include: __bedtools_bamtofastq_pairs_rules
rule all:
input: expand("{dir}/{{sample}}_unmapped.bam".format(dir=__bedtools_bamtofastq_pairs_output_dir), sample=SAMPLES)
snakefiles:
bedtools_bamtofastq_pairs: /pasteur/zeus/projets/p02/metasig/gitlab/snakemake/tools/bedtools/bamtofastq_pairs/Snakefile
input_dir: /some/input/directory
output_dir: /some/output/directory
samples:
- test_00000
- test_00001
- test_00002
bedtools_bamtofastq_pairs:
bedtools_exec_command: bedtools
modules: bedtools
......@@ -16,4 +16,4 @@ __extract_unmapped_pairs_output = "{dir}/{{sample}}_unmapped.bam".format(dir=__e
include: __extract_unmapped_pairs_rules
rule all:
input: expand("{dir}/{{sample}}_unmapped.bam".format(dir=__input_dir), sample=SAMPLES)
input: expand("{dir}/{{sample}}_unmapped.bam".format(dir=__extract_unmapped_pairs_output_dir), sample=SAMPLES)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment