Skip to content

Commit d2beb82

Browse files
Update MoVana_Workflow.wdl
1 parent e2b7dc6 commit d2beb82

4 files changed

Lines changed: 19 additions & 18 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Next known SVs breakpoints and gene coordinates are used to find overlaps with b
1717

1818
## Installation
1919

20-
### make sure you have python and bash is installed
20+
### make sure you have `python` and `bash` is installed
2121
pip install numpy pandas matplotlib
2222

2323
### docker

cromwell.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ docker {
241241
# How should docker hashes be looked up. Possible values are "local" and "remote"
242242
# "local": Lookup hashes on the local docker daemon using the cli
243243
# "remote": Lookup hashes on docker hub, gcr, gar, quay
244-
#method = "remote"
244+
method = "remote"
245245
}
246246
}
247247

scripts/script_GSE_6.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
gene_sets='KEGG_2019_Human',
1919
organism='Human', # specify the organism, it can be 'Human', 'Mouse', etc.
2020
outdir='../files/enrichment_results',
21-
cutoff=0.05)
21+
cutoff=1.0)
2222

2323
# Extract the results DataFrame
2424
results_df = enrichment_results.results

wdl/MoVana_Workflow.wdl

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ task Step1_GenerateSimulatedDistribution {
77
}
88

99
command <<<
10+
pip install --quiet --no-cache-dir numpy pandas matplotlib
1011
python3 <<CODE
1112
import numpy as np
1213
import 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)
@@ -118,7 +121,7 @@ CODE
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
@@ -188,7 +191,7 @@ CODE
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
239242
usage() {
@@ -258,12 +261,9 @@ fi
258261
259262
# Extract unique gene IDs based on SV type and remove .x suffix
260263
if [ "${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}"
263265
else
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}"
267267
fi
268268
# Notify the user
269269
echo "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
293294
import gseapy as gp
294295
import 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"
309310
enrichment_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
316317
results_df = enrichment_results.results
@@ -341,7 +342,7 @@ CODE
341342
}
342343

343344
runtime {
344-
docker: "python:3.8"
345+
docker: "python:3.12-slim"
345346
}
346347
}
347348

0 commit comments

Comments
 (0)