Commit 33f54cdc authored by Midoux Cedric's avatar Midoux Cedric
Browse files

two files for paired-end

parent fa45c8fd
...@@ -30,18 +30,20 @@ rule khmer: ...@@ -30,18 +30,20 @@ rule khmer:
def assembly_input(wildcards): def assembly_input(wildcards):
if wildcards.reads == "coassembly": if wildcards.reads == "coassembly":
if config["NORMALIZATION"]: if config["NORMALIZATION"]:
return [expand("work/khmer/{reads}_R1R2.fastq.gz", reads=config["SAMPLES"])] return {"R1R2": expand("work/khmer/{reads}_R1R2.fastq.gz", reads=config["SAMPLES"])}
elif config["SORTMERNA"]: elif config["SORTMERNA"]:
return [expand("work/sortmerna/{reads}_mRNA.fastq.gz", reads=config["SAMPLES"])] return {"R1R2": expand("work/sortmerna/{reads}_mRNA.fastq.gz", reads=config["SAMPLES"])}
else: else:
return [expand("DATA/trim/{reads}_R1R2.fastq.gz", reads=config["SAMPLES"])] return {"R1": expand("DATA/trim/{reads}_R1.fastq.gz", reads=config["SAMPLES"]), "R2": expand("DATA/trim/{reads}_R2.fastq.gz", reads=config["SAMPLES"])}
else: else:
if config["NORMALIZATION"]: if config["NORMALIZATION"]:
return {"R1R2": "work/khmer/{wildcards.reads}_R1R2.fastq.gz".format(wildcards=wildcards)} return {"R1R2": ["work/khmer/{wildcards.reads}_R1R2.fastq.gz".format(wildcards=wildcards)]}
elif config["SORTMERNA"]: elif config["SORTMERNA"]:
return {"R1R2": "work/sortmerna/{wildcards.reads}_mRNA.fastq.gz".format(wildcards=wildcards)} return {"R1R2": ["work/sortmerna/{wildcards.reads}_mRNA.fastq.gz".format(wildcards=wildcards)]}
else: else:
return {"R1R2": "DATA/trim/{wildcards.reads}_R1R2.fastq.gz".format(wildcards=wildcards)} return {"R1": ["DATA/trim/{wildcards.reads}_R1.fastq.gz".format(wildcards=wildcards)], "R2": ["DATA/trim/{wildcards.reads}_R2.fastq.gz".format(wildcards=wildcards)]}
rule megahit: rule megahit:
input: input:
...@@ -53,11 +55,11 @@ rule megahit: ...@@ -53,11 +55,11 @@ rule megahit:
params: params:
min_len = config["CONTIGS_LEN"], min_len = config["CONTIGS_LEN"],
mem_tot = int(250 * 1e9), mem_tot = int(250 * 1e9),
input = lambda wildcards, input: ",".join(input), input = lambda wildcards, input: "-1 %s -2 %s"%(",".join(input.R1), ",".join(input.R2)) if set(['R1', 'R2']).issubset(input.keys()) else "--12 %s"%",".join(input.R1R2),
output = lambda wildcards, output: os.path.dirname(str(output.contigs)) output = lambda wildcards, output: os.path.dirname(str(output.contigs))
shell: shell:
"megahit " "megahit "
"--12 {params.input} " "{params.input} "
"--continue " "--continue "
"--preset meta-large " "--preset meta-large "
"--num-cpu-threads {threads} " "--num-cpu-threads {threads} "
...@@ -78,7 +80,7 @@ rule metaspades: ...@@ -78,7 +80,7 @@ rule metaspades:
params: params:
min_len = config["CONTIGS_LEN"], min_len = config["CONTIGS_LEN"],
mem_tot = 250, mem_tot = 250,
input = lambda wildcards, input: " --12 ".join(input), input = lambda wildcards, input: "-1 %s -2 %s"%(" -1 ".join(input.R1), " -2 ".join(input.R2)) if set(['R1', 'R2']).issubset(input.keys()) else "--12 %s"%" --12 ".join(input.R1R2),
output = lambda wildcards, output: os.path.dirname(str(output.contigs)) output = lambda wildcards, output: os.path.dirname(str(output.contigs))
shell: shell:
"spades.py " "spades.py "
...@@ -86,7 +88,7 @@ rule metaspades: ...@@ -86,7 +88,7 @@ rule metaspades:
"--memory {params.mem_tot} " "--memory {params.mem_tot} "
"--tmp-dir /projet/tmp " "--tmp-dir /projet/tmp "
"--meta " "--meta "
"--12 {params.input} " "{params.input} "
"-o {params.output} " "-o {params.output} "
" ; " " ; "
"filterSeq.py " "filterSeq.py "
......
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