Skip to content

Commit

Permalink
added container in rules
Browse files Browse the repository at this point in the history
  • Loading branch information
farchaab committed Aug 21, 2024
1 parent c13af00 commit b01a258
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 11 deletions.
7 changes: 4 additions & 3 deletions mess/workflow/rules/download/assembly_finder.smk
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ checkpoint download_assemblies:
threads: config.resources.norm.cpu
conda:
os.path.join(dir.conda, "assembly_finder.yml")
container:
containers.assembly_finder
shell:
"""
assembly_finder \\
--no-use-conda \\
-i {input.tsv} \\
assembly_finder -i {input.tsv} \\
--taxonkit {params.taxonkit} \\
--threads {threads} \\
{params.args} \\
--no-use-conda \\
-o {params.out} 2> {log}
"""
6 changes: 3 additions & 3 deletions mess/workflow/rules/preflight/setup.smk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ if not os.path.exists(os.path.join(TAXONKIT, "names.dmp")):
mem=str(config.resources.sml.mem) + "MB",
time=config.resources.sml.time,
conda:
os.path.join(dir.conda, "utils.yml")
os.path.join(dir.conda, "curl.yml")
container:
containers.curl
shell:
"""
curl https://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz \\
Expand All @@ -42,8 +44,6 @@ if not os.path.exists(os.path.join(TAXONKIT, "names.dmp")):
mem_mb=config.resources.sml.mem,
mem=str(config.resources.sml.mem) + "MB",
time=config.resources.sml.time,
conda:
os.path.join(dir.conda, "utils.yml")
shell:
"""
tar -xzvf {input} -C {params.dir} &> {log}
Expand Down
4 changes: 4 additions & 0 deletions mess/workflow/rules/processing/fastas.smk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ rule rename_fastas:
time=config.resources.sml.time,
conda:
os.path.join(dir.conda, "seqkit.yml")
container:
containers.seqkit
shell:
"""
seqkit seq -i {input} > {output}
Expand All @@ -33,6 +35,8 @@ if FASTA and not ASM_SUMMARY:
threads: config.resources.norm.cpu
conda:
os.path.join(dir.conda, "seqkit.yml")
container:
containers.seqkit
shell:
"""
seqkit stats -T -j {threads} {params.path} > {output} 2> {log}
Expand Down
32 changes: 27 additions & 5 deletions mess/workflow/rules/processing/reads.smk
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ if PASSES > 1:
threads: config.resources.norm.cpu
conda:
os.path.join(dir.conda, "bioconvert.yml")
container:
containers.bioconvert
shell:
"""
samtools view -@ {threads} -bS {input} | \
Expand Down Expand Up @@ -83,6 +85,8 @@ if PASSES > 1:
threads: config.resources.norm.cpu
conda:
os.path.join(dir.conda, "pbccs.yml")
container:
containers.pbccs
shell:
"""
MIMALLOC_PAGE_RESET=0 MIMALLOC_LARGE_OS_PAGES=1 \\
Expand All @@ -106,8 +110,6 @@ if BAM:
mem_mb=config.resources.sml.mem,
mem=str(config.resources.sml.mem) + "MB",
time=config.resources.sml.time,
conda:
os.path.join(dir.conda, "utils.yml")
shell:
"""
sed 's/ref/{params.seqname}/g' {input.maf} > {output}
Expand Down Expand Up @@ -141,6 +143,8 @@ if BAM:
threads: config.resources.sml.cpu
conda:
os.path.join(dir.conda, "bioconvert.yml")
container:
containers.bioconvert
shell:
"""
bioconvert {input} {output} 2> {log}
Expand All @@ -163,6 +167,8 @@ rule convert_sam_to_bam:
threads: config.resources.sml.cpu
conda:
os.path.join(dir.conda, "bioconvert.yml")
container:
containers.bioconvert
shell:
"""
bioconvert {input} {output} -t {threads} 2> {log}
Expand All @@ -185,6 +191,8 @@ rule merge_contig_bams:
threads: config.resources.sml.cpu
conda:
os.path.join(dir.conda, "bioconvert.yml")
container:
containers.bioconvert
shell:
"""
samtools merge -@ {threads} -o {output} {input} 2> {log}
Expand All @@ -207,6 +215,8 @@ rule merge_sample_bams:
threads: config.resources.norm.cpu
conda:
os.path.join(dir.conda, "bioconvert.yml")
container:
containers.bioconvert
shell:
"""
samtools merge -@ {threads} -o {output} {input} 2> {log}
Expand All @@ -229,6 +239,8 @@ rule sort_bams:
threads: config.resources.norm.cpu
conda:
os.path.join(dir.conda, "bioconvert.yml")
container:
containers.bioconvert
shell:
"""
samtools sort -@ {threads} {input} -o {output} 2> {log}
Expand All @@ -249,6 +261,8 @@ rule get_bam_coverage:
threads: config.resources.sml.cpu
conda:
os.path.join(dir.conda, "bioconvert.yml")
container:
containers.bioconvert
shell:
"""
samtools coverage {input} > {output}
Expand Down Expand Up @@ -308,6 +322,8 @@ rule tax_profile_to_biobox:
threads: config.resources.sml.cpu
conda:
os.path.join(dir.conda, "taxonkit.yml")
container:
containers.taxonkit
shell:
"""
taxonkit \\
Expand All @@ -332,6 +348,8 @@ rule index_bams:
threads: config.resources.norm.cpu
conda:
os.path.join(dir.conda, "bioconvert.yml")
container:
containers.bioconvert
shell:
"""
samtools index -@ {threads} {input}
Expand All @@ -349,7 +367,9 @@ rule compress_contig_fastqs:
time=config.resources.sml.time,
threads: config.resources.sml.cpu
conda:
os.path.join(dir.conda, "utils.yml")
os.path.join(dir.conda, "pigz.yml")
container:
containers.pigz
shell:
"""
pigz -p {threads} {input}
Expand Down Expand Up @@ -432,6 +452,8 @@ if not SKIP_SHUFFLE:
threads: config.resources.norm.cpu
conda:
os.path.join(dir.conda, "seqkit.yml")
container:
containers.seqkit
shell:
"""
seqkit \\
Expand Down Expand Up @@ -471,6 +493,8 @@ if not SKIP_SHUFFLE:
time=config.resources.norm.time,
conda:
os.path.join(dir.conda, "seqkit.yml")
container:
containers.bioconvert
shell:
"""
seqkit seq {input} | seqkit replace \\
Expand All @@ -493,8 +517,6 @@ rule cleanup_files:
params:
proc=dir.out.processing,
base=dir.out.base,
conda:
os.path.join(dir.conda, "utils.yml")
shell:
"""
rm -rf {params[0]}
Expand Down
2 changes: 2 additions & 0 deletions mess/workflow/rules/simulate/long_reads.smk
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ rule pbsim3:
time=config.resources.norm.time,
conda:
os.path.join(dir.conda, "pbsim3.yml")
container:
containers.pbsim3
shell:
"""
pbsim --strategy wgs --method qshmm \\
Expand Down
2 changes: 2 additions & 0 deletions mess/workflow/rules/simulate/short_reads.smk
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ rule art_illumina:
time=config.resources.norm.time,
conda:
os.path.join(dir.conda, "art.yml")
container:
containers.art
shell:
"""
art_illumina -i {input.fa} \\
Expand Down

0 comments on commit b01a258

Please sign in to comment.