Skip to content

Commit

Permalink
Merge pull request #87 from NBISweden/containers
Browse files Browse the repository at this point in the history
Replace custom containers with seqera containers incl version upgrades
  • Loading branch information
verku authored Nov 11, 2024
2 parents 888ccf7 + 52f4afe commit 990ddcc
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 142 deletions.
30 changes: 0 additions & 30 deletions workflow/docker/bedtools-2.29.2/Dockerfile

This file was deleted.

29 changes: 0 additions & 29 deletions workflow/docker/bwa/Dockerfile

This file was deleted.

26 changes: 0 additions & 26 deletions workflow/docker/htslib-1.15.1/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion workflow/rules/0.1_reference_genome_preps.smk
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ rule samtools_fasta_index:
group:
"reference_prep_group"
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools faidx {input.ref} 2> {log}
Expand Down
4 changes: 2 additions & 2 deletions workflow/rules/0.2_repeat_identification.smk
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ rule sort_repeats_bed:
log:
"results/logs/0.2_repeat_identification/" + REF_NAME + "_sort_repeats_bed.log",
singularity:
"docker://nbisweden/generode-bedtools-2.29.2"
"oras://community.wave.seqera.io/library/bedtools_htslib:06ed4722f423d939"
shell:
"""
bedtools sort -g {input.genomefile} -i {input.rep_bed} > {output.sorted_rep_bed} 2> {log}
Expand All @@ -141,7 +141,7 @@ rule make_no_repeats_bed:
log:
"results/logs/0.2_repeat_identification/" + REF_NAME + "_make_no_repeats_bed.log",
singularity:
"docker://nbisweden/generode-bedtools-2.29.2"
"oras://community.wave.seqera.io/library/bedtools_htslib:06ed4722f423d939"
shell:
"""
bedtools subtract -a {input.ref_bed} -b {input.sorted_rep_bed} > {output.no_rep_bed} 2> {log}
Expand Down
10 changes: 5 additions & 5 deletions workflow/rules/1.2_map_to_mitogenomes.smk
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ rule map_historical_merged_to_mito:
log:
"results/logs/1.2_map_to_mitogenomes/{sample}_{index}_{lane}_{mitoref}_map_historical_merged_to_mito.log",
singularity:
"docker://nbisweden/generode-bwa:latest"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
bwa aln -l 16500 -n 0.01 -o 2 -t {threads} {input.ref} {input.merged} | \
Expand All @@ -208,7 +208,7 @@ rule map_historical_unmerged_to_mito:
log:
"results/logs/1.2_map_to_mitogenomes/{sample}_{index}_{lane}_{mitoref}_map_historical_unmerged_to_mito.log",
singularity:
"docker://nbisweden/generode-bwa:latest"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
bwa aln -l 16500 -n 0.01 -o 2 -t {threads} {input.ref} {input.R1_un} > {output.R1_sai} 2> {log} &&
Expand All @@ -228,7 +228,7 @@ rule mitogenome_bam_stats:
log:
"results/logs/1.2_map_to_mitogenomes/{sample}_{index}_{lane}_{reads}_{mitoref}_mitogenome_bam_stats.log",
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down Expand Up @@ -320,7 +320,7 @@ rule merge_historical_mitogenome_bams_per_sample:
log:
"results/logs/1.2_map_to_mitogenomes/{sample}_{mitoref}_merge_historical_mitogenome_bams_per_sample.log",
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
files=`echo {input} | awk '{{print NF}}'`
Expand All @@ -345,7 +345,7 @@ rule merged_mitogenome_bam_stats:
group:
"historical_merged_mito_bams_group"
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down
12 changes: 6 additions & 6 deletions workflow/rules/13_GERP.smk
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ rule align2target:
log:
"results/logs/13_GERP/alignment/" + REF_NAME + "/{gerpref}_align2target.log",
singularity:
"docker://nbisweden/generode-bwa:latest"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
bwa mem {params.extra} -t {threads} {input.target} {input.fastq} | \
Expand All @@ -349,7 +349,7 @@ rule index_gerp_bams:
log:
"results/logs/13_GERP/alignment/" + REF_NAME + "/{gerpref}_index_gerp_bams.log",
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools index {input.bam} {output.index} 2> {log}
Expand All @@ -366,7 +366,7 @@ rule gerp_bam_stats:
log:
"results/logs/13_GERP/alignment/" + REF_NAME + "/{gerpref}_gerp_bam_stats.log",
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down Expand Up @@ -411,7 +411,7 @@ rule bam2fasta:
"results/logs/13_GERP/{chr}_chunks/" + REF_NAME + "/fasta/{gerpref}_{chunk}_bam2fasta.log",
threads: 2
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1" # This container includes python 3.7.6 with default python modules
"oras://community.wave.seqera.io/library/samtools_python:2e56d0f345426c81"
shell:
"""
if [ ! -d {output.fasta_dir} ]; then
Expand Down Expand Up @@ -696,7 +696,7 @@ rule split_vcf_files:
log:
"results/logs/13_GERP/{chr}_chunks/" + REF_NAME + "/{dataset}/vcf/{sample}.{processed}_fmissing{fmiss}.{chr}.{chunk}_split_vcf_chunks.log",
singularity:
"docker://nbisweden/generode-bedtools-2.29.2"
"oras://community.wave.seqera.io/library/bedtools_htslib:06ed4722f423d939"
shell:
"""
bedtools intersect -a {input.vcf} -b {input.chunk_bed} -g {input.genomefile} -header | gzip - > {output.vcf_chunk} 2> {log}
Expand All @@ -712,7 +712,7 @@ rule split_chunk_bed_files:
log:
"results/logs/13_GERP/" + REF_NAME + ".{chunk}_{chr}_split_chunk_bed_files.log",
singularity:
"docker://nbisweden/generode-bedtools-2.29.2"
"oras://community.wave.seqera.io/library/bedtools_htslib:06ed4722f423d939"
shell:
"""
bedtools makewindows -b {input.chunk_bed} -w 10000000 > {output.chunk_win_bed} 2> {log}
Expand Down
8 changes: 4 additions & 4 deletions workflow/rules/2_mapping.smk
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ rule sai2bam:
"results/logs/2_mapping/historical/" + REF_NAME + "/{sample}_{index}_{lane}_sai2bam.log",
threads: 8
singularity:
"docker://nbisweden/generode-bwa:latest"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
bwa samse -r $(cat {input.rg}) {input.ref} {input.sai} {input.fastq_hist} | \
Expand Down Expand Up @@ -104,7 +104,7 @@ rule map_modern:
"results/logs/2_mapping/modern/" + REF_NAME + "/{sample}_{index}_{lane}_map_modern.log",
threads: 8
singularity:
"docker://nbisweden/generode-bwa:latest"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
bwa mem -M -t {threads} -R $(cat {input.rg}) {input.ref} {input.fastq_mod_R1} {input.fastq_mod_R2} | \
Expand All @@ -122,7 +122,7 @@ rule index_sorted_bams:
group:
"sorted_bam_stats_group"
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools index {input.bam} {output.index} 2> {log}
Expand All @@ -141,7 +141,7 @@ rule sorted_bam_stats:
group:
"sorted_bam_stats_group"
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down
31 changes: 16 additions & 15 deletions workflow/rules/3.1_bam_rmdup_realign_indels.smk
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ rule merge_historical_bams_per_index:
log:
"results/logs/3.1_bam_rmdup_realign_indels/historical/" + REF_NAME + "/{sample}_{index}_merge_historical_bams_per_index.log",
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
files=`echo {input} | awk '{{print NF}}'`
Expand All @@ -82,7 +82,7 @@ rule merge_modern_bams_per_index:
log:
"results/logs/3.1_bam_rmdup_realign_indels/modern/" + REF_NAME + "/{sample}_{index}_merge_modern_bams_per_index.log",
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
files=`echo {input} | awk '{{print NF}}'`
Expand All @@ -106,7 +106,7 @@ rule index_merged_index_bams:
group:
"merged_index_bam_group"
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools index {input.bam} {output.index} 2> {log}
Expand All @@ -125,7 +125,7 @@ rule merged_index_bam_stats:
group:
"merged_index_bam_group"
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down Expand Up @@ -214,10 +214,11 @@ rule rmdup_historical_bams:
log:
"results/logs/3.1_bam_rmdup_realign_indels/historical/" + REF_NAME + "/{sample}_{index}_rmdup_historical_bams.log",
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/samtools_python:2e56d0f345426c81"
shell:
"""
samtools view -@ {threads} -h {input.merged} | python3 workflow/scripts/samremovedup.py | samtools view -b -o {output.rmdup} 2> {log}
samtools view -@ {threads} -h {input.merged} | python3 workflow/scripts/samremovedup.py | \
samtools view -b -o {output.rmdup} 2> {log}
"""


Expand Down Expand Up @@ -253,7 +254,7 @@ rule index_rmdup_bams:
group:
"rmdup_bam_group"
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools index {input.bam} {output.index} 2> {log}
Expand All @@ -272,7 +273,7 @@ rule rmdup_bam_stats:
group:
"rmdup_bam_group"
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down Expand Up @@ -361,7 +362,7 @@ rule merge_historical_bams_per_sample:
log:
"results/logs/3.1_bam_rmdup_realign_indels/historical/" + REF_NAME + "/{sample}_merge_historical_bams_per_sample.log",
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
files=`echo {input} | awk '{{print NF}}'`
Expand All @@ -387,7 +388,7 @@ rule merge_modern_bams_per_sample:
log:
"results/logs/3.1_bam_rmdup_realign_indels/modern/" + REF_NAME + "/{sample}_merge_modern_bams_per_sample.log",
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
files=`echo {input} | awk '{{print NF}}'`
Expand All @@ -411,7 +412,7 @@ rule index_merged_sample_bams:
group:
"merged_sample_bam_group"
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools index {input.bam} {output.index} 2> {log}
Expand All @@ -430,7 +431,7 @@ rule merged_sample_bam_stats:
group:
"merged_sample_bam_group"
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down Expand Up @@ -566,7 +567,7 @@ rule index_realigned_bams:
group:
"realigned_bam_group"
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools index {input.bam} {output.index} 2> {log}
Expand All @@ -585,7 +586,7 @@ rule realigned_bam_stats:
log:
"results/logs/3.1_bam_rmdup_realign_indels/{dataset}/" + REF_NAME + "/{sample}_realigned_bam_stats.log",
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down Expand Up @@ -661,7 +662,7 @@ rule realigned_bam_depth:
log:
"results/logs/3.1_bam_rmdup_realign_indels/{dataset}/" + REF_NAME + "/{sample}_realigned_bam_depth.log",
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
if [ {params.cov} = "True" ] # include sites with missing data / zero coverage
Expand Down
4 changes: 2 additions & 2 deletions workflow/rules/3.2_historical_bam_mapDamage.smk
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ rule index_rescaled_bams:
group:
"rescaled_bam_group"
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools index {input.bam} {output.index} 2> {log}
Expand All @@ -76,7 +76,7 @@ rule rescaled_bam_stats:
log:
"results/logs/3.2_historical_bam_mapDamage/" + REF_NAME + "/{sample}_rescaled_bam_stats.log",
singularity:
"docker://biocontainers/samtools:v1.9-4-deb_cv1"
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down
Loading

0 comments on commit 990ddcc

Please sign in to comment.