@@ -7,6 +7,7 @@ task Step1_GenerateSimulatedDistribution {
77 }
88
99 command <<<
10+ pip install --quiet --no-cache-dir numpy pandas matplotlib
1011 python3 << CODE
1112import numpy as np
1213import pandas as pd
@@ -71,6 +72,8 @@ with open(output_vcf_path, 'w') as out_file:
7172 if line.startswith('##'):
7273 out_file.write(line)
7374 elif line.startswith('#CHROM'):
75+ out_file.write('##INFO=<ID=AF,Number=A,Type=Float,Description="Allele Frequency">\n')
76+ out_file.write('##INFO=<ID=SVLEN,Number=1,Type=Integer,Description="Difference in length between REF and ALT alleles">\n')
7477 out_file.write(line)
7578 break
7679 vcf_data.to_csv(out_file, sep='\t', index=False, header=False)
118121 }
119122
120123 runtime {
121- docker : "python:3.8 "
124+ docker : "python:3.12-slim "
122125 cpu : 1
123126 memory : "4 GiB"
124127 maxRetries : 1
@@ -142,7 +145,7 @@ task Step2_FilterVCF {
142145 }
143146
144147 runtime {
145- docker : "bcftools:latest "
148+ docker : "quay.io/biocontainers/ bcftools:1.21--h8b25389_0 "
146149 cpu : 1
147150 memory : "4 GiB"
148151 maxRetries : 1
188191 }
189192
190193 runtime {
191- docker : "python:3.8 "
194+ docker : "python:3.12-slim "
192195 cpu : 1
193196 memory : "4 GiB"
194197 maxRetries : 1
@@ -206,7 +209,7 @@ task Step4_IntersectSV {
206209 command <<<
207210 BED = "~{bed_file}"
208211 if [[ "$BED " == *.tar.bz2 ]]; then
209- tar -xjf "$BED " .
212+ tar -xjf "$BED "
210213 BED = $(tar -tjf "~{bed_file}" | head -1 )
211214 fi
212215 bedtools intersect -a "~{input_file}" -b "$BED " -wo > "~{output_file}"
@@ -217,7 +220,7 @@ task Step4_IntersectSV {
217220 }
218221
219222 runtime {
220- docker : "biocontainers/bedtools:latest "
223+ docker : "quay.io/ biocontainers/bedtools:2.31.1--hf5e1c6e_2 "
221224 cpu : 1
222225 memory : "4 GiB"
223226 maxRetries : 1
@@ -233,7 +236,7 @@ task Step5_GetGenesForGSEA {
233236 }
234237
235238 command <<<
236- bash << SCRIPT
239+ bash <<' SCRIPT'
237240#!/bin/bash
238241# Function to print usage
239242usage () {
258261
259262# Extract unique gene IDs based on SV type and remove .x suffix
260263if [ "${sv_type} " == "all" ]; then
261- awk -F'\t' '{for (i=1; i<=NF; i++) if ($i ~ /gene_name /) {match($i, /gene_name "([^"]+)"/, arr); p
262- rint arr[1]}}' "${input_file }" | sed 's/\.[0-9]\+$//' | sort | uniq > "${output_file }"
264+ awk -F '\t' '{for (i=1; i<=NF; i++) if ($i ~ /gene_name /) {match($i, /gene_name "[^"]+"/); s=substr($i,RSTART,RLENGTH); gsub(/gene_name "|"/,"",s); print s}}' "${input_file} " | sed 's/\.[0-9]\+$//' | sort | uniq > "${output_file} "
263265else
264- grep "SVTYPE=${sv_type }" "${input_file }" | awk -F'\t' '{for (i=1; i<=NF; i++) if ($i ~ /gene_name /
265- ) {match($i, /gene_name "([^"]+)"/, arr); print arr[1]}}' | sed 's/\.[0-9]\+$//' | sort | uniq > "${o
266- utput_file }"
266+ grep "SVTYPE=${sv_type} " "${input_file} " | awk -F '\t' '{for (i=1; i<=NF; i++) if ($i ~ /gene_name /) {match($i, /gene_name "[^"]+"/); s=substr($i,RSTART,RLENGTH); gsub(/gene_name "|"/,"",s); print s}}' | sed 's/\.[0-9]\+$//' | sort | uniq > "${output_file} "
267267fi
268268# Notify the user
269269echo "Unique gene names for SV type ${sv_type} have been written to ${output_file} "
@@ -275,7 +275,7 @@ SCRIPT
275275 }
276276
277277 runtime {
278- docker : "bash:latest "
278+ docker : "debian:stable-slim "
279279 cpu : 1
280280 memory : "4 GiB"
281281 maxRetries : 1
@@ -289,6 +289,7 @@ task Step6_PerformGSEA {
289289 }
290290
291291 command <<<
292+ pip install --quiet --no-cache-dir gseapy pandas seaborn matplotlib
292293 python3 << CODE
293294import gseapy as gp
294295import pandas as pd
@@ -308,9 +309,9 @@ genes_df = pd.DataFrame(gene_list, columns=['gene_id'])
308309# You can choose the library you want to use for enrichment, e.g., "KEGG_2019_Human"
309310enrichment_results = gp.enrichr(gene_list=genes_df['gene_id'].tolist(),
310311 gene_sets='KEGG_2019_Human',
311- organism='Human ',
312+ organism='human ',
312313 outdir='enrichment_results',
313- cutoff=0.05 )
314+ cutoff=1.0 )
314315
315316# Extract the results DataFrame
316317results_df = enrichment_results.results
341342 }
342343
343344 runtime {
344- docker : "python:3.8 "
345+ docker : "python:3.12-slim "
345346 }
346347}
347348
0 commit comments