Commit 4dcb27bf authored by Midoux Cedric's avatar Midoux Cedric
Browse files

metaspades megahit

parent 5f2d4bd6
......@@ -13,7 +13,7 @@ rule khmer:
threads:
10
params:
mem_tot = 90 * 1e9,
mem_tot = int(90 * 1e9),
K = 32,
C = 100
shell:
......@@ -26,3 +26,70 @@ rule khmer:
"--output {output.R1R2} "
"--gzip "
"{input.R1R2}"
def assembly_input(wildcards):
if wildcards.reads == "coassembly":
if config["NORMALIZATION"]:
return [expand("work/khmer/{reads}_R1R2.fastq.gz", reads=config["SAMPLES"])]
elif config["SORTMERNA"]:
return [expand("work/sortmerna/{reads}_mRNA.fastq.gz", reads=config["SAMPLES"])]
else:
return [expand("DATA/trim/{reads}_R1R2.fastq.gz", reads=config["SAMPLES"])]
else:
if config["NORMALIZATION"]:
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)}
else:
return {"R1R2": "DATA/trim/{wildcards.reads}_R1R2.fastq.gz".format(wildcards=wildcards)}
rule megahit:
input:
unpack(assembly_input)
output:
contigs = "work/megahit/{reads}/{reads}.contigs.fa"
threads:
20
params:
min_len = config["CONTIGS_LEN"],
mem_tot = int(250 * 1e9),
input = lambda wildcards, input: ",".join(input),
output = lambda wildcards, output: os.path.dirname(str(output.contigs))
shell:
"megahit "
"--12 {params.input} "
"--continue "
"--preset meta-large "
"--num-cpu-threads {threads} "
"--memory {params.mem_tot} "
"--tmp-dir /projet/tmp "
"--out-dir {params.output} "
"--out-prefix {wildcards.reads} "
"--min-contig-len {params.min_len} "
"--verbose"
rule metaspades:
input:
unpack(assembly_input)
output:
contigs = "work/metaSPADES/{reads}/{reads}.contigs.fasta"
threads:
20
params:
min_len = config["CONTIGS_LEN"],
mem_tot = 250,
input = lambda wildcards, input: " --12 ".join(input),
output = lambda wildcards, output: os.path.dirname(str(output))
shell:
"spades.py "
"--threads {threads} "
"--memory {params.mem_tot} "
"--tmp-dir /projet/tmp "
"--meta "
"--12 {params.input} "
"-o {params.output} "
" ; "
"filterSeq.py "
"-i work/metaSPADES/{wildcards.reads}/contigs.fasta "
"-o {output.contigs} "
"--min-length {params.min_len} "
......@@ -19,12 +19,12 @@
"megahit" :
{
"queue" : "highmem.q,maiage.q",
"cluster" : "-l h_vmem={MEM}G"
"cluster" : "-l h_vmem=12G"
},
"metaspades" :
{
"queue" : "highmem.q,maiage.q",
"cluster" : "-l h_vmem={MEM}G"
"cluster" : "-l h_vmem=12G"
},
"diamond" :
{
......
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