Skip to content

Commit af75f16

Browse files
committed
Updating output structure for rules megahit and krona
1 parent bb28c26 commit af75f16

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

workflow/Snakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ rule all:
105105
# Megahit, viral assembly, annotation, and alignment to contigs
106106
# @imported from rules/paired-end.smk
107107
expand(
108-
join(workpath,"output","{name}","{name}.megahit.bam"),
108+
join(workpath,"{name}","output","{name}.megahit.bam"),
109109
name=samples
110110
),
111111
# Krona, taxonomic classification report
112112
# @imported from rules/paired-end.smk
113113
expand(
114-
join(workpath,"output","{name}","{name}.contig.classification.html"),
114+
join(workpath,"{name}","output","{name}.contig.classification.html"),
115115
name=samples
116116
),
117117
# Metaquast, quality report of assembly

workflow/rules/paired-end.smk

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -359,30 +359,30 @@ rule megahit:
359359
r1=join(workpath,"{name}","trim","{name}.R1.trim.host_removed.fastq.gz"),
360360
r2=join(workpath,"{name}","trim","{name}.R2.trim.host_removed.fastq.gz"),
361361
output:
362-
contigs=join(workpath,"output","{name}","{name}.megahit.contigs.fa"),
363-
report=join(workpath,"info","{name}.megahit.contigs_kraken2_report.txt"),
364-
k2txt=join(workpath,"kraken2","{name}.megahit.contigs.kraken2"),
365-
krona=join(workpath,"kraken2","{name}.megahit.contigs.kraken2.krona"),
366-
tmp1=join(workpath,"temp","{name}","{name}.megahit_kraken2.txt"),
367-
cat_class=join(workpath,"CAT","{name}","{name}.megahit.contig2classification.txt"),
368-
cat_names=join(workpath,"CAT","{name}","{name}.megahit.official_names.txt"),
369-
cat_summary=join(workpath,"CAT","{name}","{name}.megahit.summary.txt"),
370-
taxids=join(workpath,"CAT","{name}","{name}.megahit.contig_taxids.txt"),
371-
tmp2=join(workpath,"temp","{name}","{name}.megahit_CAT.txt"),
372-
tmp3=join(workpath,"temp","{name}","{name}.megahit.kraken2.viral.names.txt"),
373-
kraken_contigs=join(workpath,"output","{name}","{name}.megahit.kraken2_viral.contigs.fa"),
374-
tmp4=join(workpath,"temp","{name}","{name}.megahit.CAT.viral.names.txt"),
375-
cat_contigs=join(workpath,"output","{name}","{name}.megahit.cat_viral.contigs.fa"),
376-
sam=temp(join(workpath,"temp","{name}.megahit.sam")),
377-
bam=temp(join(workpath,"temp","{name}.megahit.bam")),
378-
final=join(workpath,"output","{name}","{name}.megahit.bam"),
362+
contigs=join(workpath,"{name}","output","{name}.megahit.contigs.fa"),
363+
report=join(workpath,"{name}","info","{name}.megahit.contigs_kraken2_report.txt"),
364+
k2txt=join(workpath,"{name}","kraken2","{name}.megahit.contigs.kraken2"),
365+
krona=join(workpath,"{name}","kraken2","{name}.megahit.contigs.kraken2.krona"),
366+
tmp1=join(workpath,"{name}","temp","{name}.megahit_kraken2.txt"),
367+
cat_class=join(workpath,"{name}","CAT","{name}.megahit.contig2classification.txt"),
368+
cat_names=join(workpath,"{name}","CAT","{name}.megahit.official_names.txt"),
369+
cat_summary=join(workpath,"{name}","CAT","{name}.megahit.summary.txt"),
370+
taxids=join(workpath,"{name}","CAT","{name}.megahit.contig_taxids.txt"),
371+
tmp2=join(workpath,"{name}","temp","{name}.megahit_CAT.txt"),
372+
tmp3=join(workpath,"{name}","temp","{name}.megahit.kraken2.viral.names.txt"),
373+
kraken_contigs=join(workpath,"{name}","output","{name}.megahit.kraken2_viral.contigs.fa"),
374+
tmp4=join(workpath,"{name}","temp","{name}.megahit.CAT.viral.names.txt"),
375+
cat_contigs=join(workpath,"{name}","output","{name}.megahit.cat_viral.contigs.fa"),
376+
sam=temp(join(workpath,"{name}","temp","{name}.megahit.sam")),
377+
bam=temp(join(workpath,"{name}","temp","{name}.megahit.bam")),
378+
final=join(workpath,"{name}","output","{name}.megahit.bam"),
379379
params:
380380
rname='megahit',
381381
viral_db=config['references']['kraken2_viral_db'],
382382
cat_db=config['references']['CAT_db'],
383383
cat_tax=config['references']['CAT_taxonomy'],
384384
cat_dep=config['references']['CAT_diamond'],
385-
cat_dir=join(workpath,"CAT")
385+
cat_dir=join(workpath,"{name}","CAT")
386386
threads: int(allocated("threads", "megahit", cluster))
387387
conda: config['conda']['CAT']
388388
envmodules:
@@ -417,13 +417,13 @@ rule megahit:
417417
{output.k2txt} > {output.krona}
418418
cp {output.krona} {output.tmp1}
419419
420-
mkdir -p {params.cat_dir}/{wildcards.name}/
420+
mkdir -p {params.cat_dir}/
421421
CAT contigs -n {threads} \\
422422
--force \\
423423
-c {output.contigs} \\
424424
-d {params.cat_db} \\
425425
-t {params.cat_tax} \\
426-
--out_prefix {params.cat_dir}/{wildcards.name}/{wildcards.name}.megahit \\
426+
--out_prefix {params.cat_dir}/{wildcards.name}.megahit \\
427427
--path_to_diamond {params.cat_dep}
428428
CAT add_names -i {output.cat_class} \\
429429
-o {output.cat_names} \\
@@ -458,9 +458,9 @@ rule megahit:
458458
459459
bowtie2-build --threads {threads} \\
460460
{output.contigs} \\
461-
temp/{wildcards.name}/{wildcards.name}_megahit
461+
{wildcards.name}/temp/{wildcards.name}_megahit
462462
bowtie2 -p {threads} \\
463-
-x temp/{wildcards.name}/{wildcards.name}_megahit \\
463+
-x {wildcards.name}/temp/{wildcards.name}_megahit \\
464464
-1 {input.r1} \\
465465
-2 {input.r2} \\
466466
-S {output.sam}
@@ -490,10 +490,10 @@ rule krona:
490490
input:
491491
f1=join(workpath,"{name}","temp","{name}.metaspades_CAT.txt"),
492492
f2=join(workpath,"{name}","temp","{name}.metaspades_kraken2.txt"),
493-
f3=join(workpath,"temp","{name}","{name}.megahit_CAT.txt"),
494-
f4=join(workpath,"temp","{name}","{name}.megahit_kraken2.txt"),
493+
f3=join(workpath,"{name}","temp","{name}.megahit_CAT.txt"),
494+
f4=join(workpath,"{name}","temp","{name}.megahit_kraken2.txt"),
495495
output:
496-
report=join(workpath,"output","{name}","{name}.contig.classification.html"),
496+
report=join(workpath,"{name}","output","{name}.contig.classification.html"),
497497
params:
498498
rname='krona',
499499
krona_ref=config['references']['kronatools'],
@@ -569,7 +569,7 @@ rule metaquast:
569569
"""
570570
input:
571571
metaspades=join(workpath,"{name}","output","{name}.metaspades.contigs.fa"),
572-
megahit=join(workpath,"output","{name}","{name}.megahit.contigs.fa"),
572+
megahit=join(workpath,"{name}","output","{name}.megahit.contigs.fa"),
573573
output:
574574
report=join(workpath,"output","{name}","{name}_metaquast","report.html")
575575
params:

0 commit comments

Comments
 (0)