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:
def assembly_input(wildcards):
if wildcards.reads == "coassembly":
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"]:
return [expand("work/sortmerna/{reads}_mRNA.fastq.gz", reads=config["SAMPLES"])]
return {"R1R2": expand("work/sortmerna/{reads}_mRNA.fastq.gz", reads=config["SAMPLES"])}
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:
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"]:
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:
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:
input:
......@@ -53,11 +55,11 @@ rule megahit:
params:
min_len = config["CONTIGS_LEN"],
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))
shell:
"megahit "
"--12 {params.input} "
"{params.input} "
"--continue "
"--preset meta-large "
"--num-cpu-threads {threads} "
......@@ -78,7 +80,7 @@ rule metaspades:
params:
min_len = config["CONTIGS_LEN"],
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))
shell:
"spades.py "
......@@ -86,7 +88,7 @@ rule metaspades:
"--memory {params.mem_tot} "
"--tmp-dir /projet/tmp "
"--meta "
"--12 {params.input} "
"{params.input} "
"-o {params.output} "
" ; "
"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