Skip to content

Commit

Permalink
Add python3 to the container
Browse files Browse the repository at this point in the history
  • Loading branch information
verku committed Nov 11, 2024
1 parent 924825b commit aa67e98
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 35 deletions.
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
samtools faidx {input.ref} 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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down
8 changes: 4 additions & 4 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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9" # This container includes python 3.7.6 with default python modules
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93" # This container includes python 3.7.6 with default python modules
shell:
"""
if [ ! -d {output.fasta_dir} ]; then
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down
28 changes: 14 additions & 14 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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
files=`echo {input} | awk '{{print NF}}'`
Expand All @@ -106,7 +106,7 @@ rule index_merged_index_bams:
group:
"merged_index_bam_group"
singularity:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down Expand Up @@ -214,7 +214,7 @@ rule rmdup_historical_bams:
log:
"results/logs/3.1_bam_rmdup_realign_indels/historical/" + REF_NAME + "/{sample}_{index}_rmdup_historical_bams.log",
singularity:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
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 +253,7 @@ rule index_rmdup_bams:
group:
"rmdup_bam_group"
singularity:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
samtools index {input.bam} {output.index} 2> {log}
Expand All @@ -272,7 +272,7 @@ rule rmdup_bam_stats:
group:
"rmdup_bam_group"
singularity:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down Expand Up @@ -361,7 +361,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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
files=`echo {input} | awk '{{print NF}}'`
Expand All @@ -387,7 +387,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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
files=`echo {input} | awk '{{print NF}}'`
Expand All @@ -411,7 +411,7 @@ rule index_merged_sample_bams:
group:
"merged_sample_bam_group"
singularity:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
samtools index {input.bam} {output.index} 2> {log}
Expand All @@ -430,7 +430,7 @@ rule merged_sample_bam_stats:
group:
"merged_sample_bam_group"
singularity:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down Expand Up @@ -566,7 +566,7 @@ rule index_realigned_bams:
group:
"realigned_bam_group"
singularity:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
samtools index {input.bam} {output.index} 2> {log}
Expand All @@ -585,7 +585,7 @@ rule realigned_bam_stats:
log:
"results/logs/3.1_bam_rmdup_realign_indels/{dataset}/" + REF_NAME + "/{sample}_realigned_bam_stats.log",
singularity:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down Expand Up @@ -661,7 +661,7 @@ rule realigned_bam_depth:
log:
"results/logs/3.1_bam_rmdup_realign_indels/{dataset}/" + REF_NAME + "/{sample}_realigned_bam_depth.log",
singularity:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
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:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand Down
10 changes: 5 additions & 5 deletions workflow/rules/3.3_bam_subsampling.smk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ rule filter_bam_mapped_mq:
log:
"results/logs/3.3_bam_subsampling/{dataset}/" + REF_NAME + "/{sample}.{processed}_filter_bam_mapped_mq.log",
singularity:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
samtools view -h -b -F 4 -q 30 -@ {threads} -o {output.filtered} {input.bam} 2> {log}
Expand All @@ -43,7 +43,7 @@ rule subsample_bams:
log:
"results/logs/3.3_bam_subsampling/{dataset}/" + REF_NAME + "/{sample}.{processed}.subs_dp{DP}_subsample_bams.log",
singularity:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
depth=`head -n 1 {input.dp} | cut -d' ' -f 1`
Expand All @@ -68,7 +68,7 @@ rule index_subsampled_bams:
group:
"subsampled_bam_group"
singularity:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
samtools index {input.bam} {output.index} 2> {log}
Expand All @@ -87,7 +87,7 @@ rule subsampled_bam_stats:
log:
"results/logs/3.3_bam_subsampling/{dataset}/" + REF_NAME + "/{sample}.{processed}.subs_dp{DP}_subsampled_bam_stats.log",
singularity:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
samtools flagstat {input.bam} > {output.stats} 2> {log}
Expand All @@ -114,7 +114,7 @@ rule subsampled_bam_depth:
log:
"results/logs/3.3_bam_subsampling/{dataset}/" + REF_NAME + "/{sample}.{processed}.subs_dp{DP}_subsampled_bam_depth.log",
singularity:
"oras://community.wave.seqera.io/library/bwa_samtools:58df1856e12c14b9"
"oras://community.wave.seqera.io/library/bwa_samtools_python:57d090a0dc055d93"
shell:
"""
if [ {params.cov} = "True" ] # include sites with missing data / zero coverage
Expand Down

0 comments on commit aa67e98

Please sign in to comment.