Skip to content

Commit 43f3c88

Browse files
kapsakcjsage-wrightkevinlibuit
authored
New NCBI-AMRFinderPlus workflow and integration in TheiaProk_Illumina_PE wf (#65)
Fixes #41, Fixes #46 * added new task file for NCBI-amrfinderplus. passes miniwdl check but is NOT incorporated or tested in any workflows yet * adds single task workflow NCBI-AMRFinderPlus. update dockstore.yml with new wf. added lines in task to output 4 TSV outputs from amrfinderplus * removed comment from amrfinderplus task since it was breaking the cmd. fixed import path in wf_amrfinderplus.wdl * changed math to make integers instead of floats so bash doesn't get upset * update to ncbi-amrfinderplus docker image 3.10.24 and deleted some comment lines * rename amfrfinder tas to amrfinder_nuc for nculeotide. also added maxRetries to runtime block * added amrfinderplus outputs to export_taxon_tables inputs and output TSV header and outputs * added amrfinderplus to wf_theiaprok_illumina_pe.wdl. Have not tested locally or in Terra yet * added code to take in user-defined inputs or gambit_predicted_taxon to use with amrfinder --organism option * amrfinder --organism is always used and wil feed in bash variable * updated single task wf_amrfinderplus.wdl with new task name "amrfinderplus_nuc" * task_amrfinderplus.wdl: added double quotes so bash conditional evaluates properly * updated/fixed PHBG_Version to v0.4.0-dev. Also quoted echo statement so VSCode stops complaining * added if/else for amrfinder --organism flag. if organism input is supplied by user or gambit_predicted taxon, use --organism flag. otherwise do not use --organism flag * last grep command exits gracefully even if it finds nothing * added new outputs for amrfinderplus task for strings with all stress, virulence, and amr genes. floated to table in addition to TSVs * added new amrfinderplus gene names string output to single-task workflow * removed abricate from wf_theiaprok_illumina_pe and export taxon tables task. still need to test functionality. also getting warnings in VSCode that may need addressing * added new amrfinderplus output strings to export_taxon_tables task as well as theiaprok_illumina_pe workflow * attempting to make new amrfinderplus string outputs optional for export_taxon_tables task * fixed outputs for export_taxon_table * Make amrfinderplus docker image modifiable by user * amrfinderplus_nuc task: updated string matching for all organisms. Much easier to match genus and species with 2 words. Now redirecting STDOUT/ERR to a txt file for grepping amrfinder db version. Added new output string "amrfinder_db_version". export_taxon_table task: added new amrfinderplus_db_version to inputs & resulting TSV for export taxon table. wf_amrfinderplus.wdl: added new output amrfinderplus_db_version. wf_theiaprok_illumina_pe.wdl: updated with new amrfinderplus_db_version output * update gambit task and output * capture trimmomatic out * added a missing \t in export_taxon_tables task * round est_coverage to 2 decimal places * update default docker * fix syntax * Update task_versioning.wdl * removing redundant date capture * remove redundant date capture * avoid workflow/task name conflict Co-authored-by: Sage Wright <sage.wright@theiagen.com> Co-authored-by: kevinlibuit <kevin@libuit.com> Co-authored-by: kevinlibuit <kevinlibuit@users.noreply.github.com>
1 parent 8051d29 commit 43f3c88

File tree

13 files changed

+236
-40
lines changed

13 files changed

+236
-40
lines changed

.dockstore.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ workflows:
4040
primaryDescriptorPath: /workflows/wf_mashtree_fasta.wdl
4141
testParameterFiles:
4242
- empty.json
43+
- name: NCBI-AMRFinderPlus
44+
subclass: WDL
45+
primaryDescriptorPath: /workflows/wf_amrfinderplus.wdl
46+
testParameterFiles:
47+
- empty.json
4348
- name: Kraken2_PE
4449
subclass: WDL
4550
primaryDescriptorPath: /workflows/wf_kraken2_pe.wdl
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
version 1.0
2+
3+
task amrfinderplus_nuc {
4+
input {
5+
File assembly
6+
String samplename
7+
# Parameters
8+
# --indent_min Minimum DNA %identity [0-1]; default is 0.9 (90%) or curated threshold if it exists
9+
# --mincov Minimum DNA %coverage [0-1]; default is 0.5 (50%)
10+
String? organism # make optional?
11+
Int? minid
12+
Int? mincov
13+
Int cpu = 4
14+
String docker = "quay.io/staphb/ncbi-amrfinderplus:3.10.24"
15+
}
16+
command <<<
17+
# logging info
18+
date | tee DATE
19+
amrfinder --version | tee AMRFINDER_VERSION
20+
21+
### set $amrfinder_organism BASH variable based on gambit_predicted_taxon or user-defined input string
22+
### final variable has strict syntax/spelling based on list from amrfinder --list_organisms
23+
# there may be other Acinetobacter species to add later, like those in the A. baumannii-calcoaceticus species complex
24+
if [[ "~{organism}" == *"Acinetobacter"*"baumannii"* ]]; then
25+
amrfinder_organism="Acinetobacter_baumannii"
26+
elif [[ "~{organism}" == *"Campylobacter"*"coli"* ]] || [[ "~{organism}" == *"Campylobacter"*"jejuni"* ]]; then
27+
amrfinder_organism="Campylobacter"
28+
elif [[ "~{organism}" == *"Clostridioides"*"difficile"* ]]; then
29+
amrfinder_organism="Clostridioides_difficile"
30+
elif [[ "~{organism}" == *"Enterococcus"*"faecalis"* ]]; then
31+
amrfinder_organism="Enterococcus_faecalis"
32+
elif [[ "~{organism}" == *"Enterococcus"*"faecium"* ]] || [[ "~{organism}" == *"Enterococcus"*"hirae"* ]]; then
33+
amrfinder_organism="Enterococcus_faecium"
34+
# should capture all Shigella and Escherichia species
35+
elif [[ "~{organism}" == *"Escherichia"* ]] || [[ "~{organism}" == *"Shigella"* ]]; then
36+
amrfinder_organism="Escherichia"
37+
# add other Klebsiella species later? Cannot use K. oxytoca as per amrfinderplus wiki
38+
elif [[ "~{organism}" == *"Klebsiella"*"aerogenes"* ]] || [[ "~{organism}" == *"Klebsiella"*"pnemoniae"* ]]; then
39+
amrfinder_organism="Klebsiella"
40+
# because some people spell the species 'gonorrhea' differently
41+
elif [[ "~{organism}" == *"Neisseria"*"gonorrhea"* ]] || [[ "~{organism}" == *"Neisseria"*"gonorrhoeae"* ]] || [[ "~{organism}" == *"Neisseria"*"meningitidis"* ]]; then
42+
amrfinder_organism="Neisseria"
43+
elif [[ "~{organism}" == *"Pseudomonas"*"aeruginosa"* ]]; then
44+
amrfinder_organism="Pseudomonas_aeruginosa"
45+
# pretty broad, could work on Salmonella bongori and other species
46+
elif [[ "~{organism}" == *"Salmonella"* ]]; then
47+
amrfinder_organism="Salmonella"
48+
elif [[ "~{organism}" == *"Staphylococcus"*"aureus"* ]]; then
49+
amrfinder_organism="Staphylococcus_aureus"
50+
elif [[ "~{organism}" == *"Staphylococcus"*"pseudintermedius"* ]]; then
51+
amrfinder_organism="Staphylococcus_pseudintermedius"
52+
elif [[ "~{organism}" == *"Streptococcus"*"agalactiae"* ]]; then
53+
amrfinder_organism="Streptococcus_agalactiae"
54+
elif [[ "~{organism}" == *"Streptococcus"*"pneumoniae"* ]] || [[ "~{organism}" == *"Streptococcus"*"mitis"* ]]; then
55+
amrfinder_organism="Streptococcus_pneumoniae"
56+
elif [[ "~{organism}" == *"Streptococcus"*"pyogenes"* ]]; then
57+
amrfinder_organism="Streptococcus_pyogenes"
58+
elif [[ "~{organism}" == *"Vibrio"*"cholerae"* ]]; then
59+
amrfinder_organism="Vibrio_cholerae"
60+
else
61+
echo "Either Gambit predicted taxon is not supported by NCBI-AMRFinderPlus or the user did not supply an organism as input."
62+
echo "Skipping the use of amrfinder --organism optional parameter."
63+
fi
64+
65+
# checking bash variable
66+
echo "amrfinder_organism is set to:" ${amrfinder_organism}
67+
68+
# if amrfinder_organism variable is set, use --organism flag, otherwise do not use --organism flag
69+
if [[ -v amrfinder_organism ]] ; then
70+
# always use --plus flag, others may be left out if param is optional and not supplied
71+
# send STDOUT/ERR to log file for capturing database version
72+
amrfinder --plus \
73+
--organism ${amrfinder_organism} \
74+
~{'--name ' + samplename} \
75+
~{'--nucleotide ' + assembly} \
76+
~{'-o ' + samplename + '_amrfinder_all.tsv'} \
77+
~{'--threads ' + cpu} \
78+
~{'--coverage_min ' + mincov} \
79+
~{'--ident_min ' + minid} 2>&1 | tee amrfinder.STDOUT-and-STDERR.log
80+
else
81+
# always use --plus flag, others may be left out if param is optional and not supplied
82+
# send STDOUT/ERR to log file for capturing database version
83+
amrfinder --plus \
84+
~{'--name ' + samplename} \
85+
~{'--nucleotide ' + assembly} \
86+
~{'-o ' + samplename + '_amrfinder_all.tsv'} \
87+
~{'--threads ' + cpu} \
88+
~{'--coverage_min ' + mincov} \
89+
~{'--ident_min ' + minid} 2>&1 | tee amrfinder.STDOUT-and-STDERR.log
90+
fi
91+
92+
# capture the database version from the stdout and stderr file that was just created
93+
grep "Database version:" amrfinder.STDOUT-and-STDERR.log | sed 's|Database version: ||' >AMRFINDER_DB_VERSION
94+
95+
# Element Type possibilities: AMR, STRESS, and VIRULENCE
96+
# create headers for 3 output files; tee to 3 files and redirect STDOUT to dev null so it doesn't print to log file
97+
head -n 1 ~{samplename}_amrfinder_all.tsv | tee ~{samplename}_amrfinder_stress.tsv ~{samplename}_amrfinder_virulence.tsv ~{samplename}_amrfinder_amr.tsv >/dev/null
98+
# looks for all rows with STRESS, AMR, or VIRULENCE and append to TSVs
99+
grep 'STRESS' ~{samplename}_amrfinder_all.tsv >> ~{samplename}_amrfinder_stress.tsv
100+
grep 'VIRULENCE' ~{samplename}_amrfinder_all.tsv >> ~{samplename}_amrfinder_virulence.tsv
101+
# || true is so that the final grep exits with code 0, preventing failures
102+
grep 'AMR' ~{samplename}_amrfinder_all.tsv >> ~{samplename}_amrfinder_amr.tsv || true
103+
104+
# create string outputs for all genes identified in AMR, STRESS, VIRULENCE
105+
amr_genes=$(awk -F '\t' '{ print $7 }' ~{samplename}_amrfinder_amr.tsv | tail -n+2 | tr '\n' ', ' | sed 's/.$//')
106+
stress_genes=$(awk -F '\t' '{ print $7 }' ~{samplename}_amrfinder_stress.tsv | tail -n+2 | tr '\n' ', ' | sed 's/.$//')
107+
virulence_genes=$(awk -F '\t' '{ print $7 }' ~{samplename}_amrfinder_virulence.tsv | tail -n+2 | tr '\n' ', ' | sed 's/.$//')
108+
109+
# if variable for list of genes is EMPTY, write string saying it is empty to float to Terra table
110+
if [ -z "${amr_genes}" ]; then
111+
amr_genes="No AMR genes detected by NCBI-AMRFinderPlus"
112+
fi
113+
if [ -z "${stress_genes}" ]; then
114+
stress_genes="No STRESS genes detected by NCBI-AMRFinderPlus"
115+
fi
116+
if [ -z "${virulence_genes}" ]; then
117+
virulence_genes="No VIRULENCE genes detected by NCBI-AMRFinderPlus"
118+
fi
119+
120+
# create final output strings
121+
echo "${amr_genes}" > AMR_GENES
122+
echo "${stress_genes}" > STRESS_GENES
123+
echo "${virulence_genes}" > VIRULENCE_GENES
124+
>>>
125+
output {
126+
File amrfinderplus_all_report = "~{samplename}_amrfinder_all.tsv"
127+
File amrfinderplus_amr_report = "~{samplename}_amrfinder_amr.tsv"
128+
File amrfinderplus_stress_report = "~{samplename}_amrfinder_stress.tsv"
129+
File amrfinderplus_virulence_report = "~{samplename}_amrfinder_virulence.tsv"
130+
String amrfinderplus_amr_genes = read_string("AMR_GENES")
131+
String amrfinderplus_stress_genes = read_string("STRESS_GENES")
132+
String amrfinderplus_virulence_genes = read_string("VIRULENCE_GENES")
133+
String amrfinderplus_version = read_string("AMRFINDER_VERSION")
134+
String amrfinderplus_db_version = read_string("AMRFINDER_DB_VERSION")
135+
}
136+
runtime {
137+
memory: "8 GB"
138+
cpu: cpu
139+
docker: docker
140+
disks: "local-disk 100 SSD"
141+
preemptible: 0
142+
maxRetries: 3
143+
}
144+
}

tasks/quality_control/task_cg_pipeline.wdl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ task cg_pipeline {
3232
with open("R2_MEAN_Q", 'wt') as r2_mean_q:
3333
r2_mean_q.write(line["avgQuality"])
3434
coverage += float(line["coverage"])
35+
coverage="{:.2f}".format(coverage)
3536
with open("EST_COVERAGE", 'wt') as est_coverage:
3637
est_coverage.write(str(coverage))
3738
CODE

tasks/quality_control/task_screen.wdl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ task check_reads {
4949
# wc -c counts characters
5050
5151
# set proportion variables for easy comparison
52-
percent_read1=$(python3 -c "print(round(($read1_bp / $read2_bp)*100,2))")
53-
percent_read2=$(python3 -c "print(round(($read2_bp / $read1_bp)*100,2))")
52+
# removing the , 2) to make these integers instead of floats
53+
percent_read1=$(python3 -c "print(round(($read1_bp / $read2_bp)*100))")
54+
percent_read2=$(python3 -c "print(round(($read2_bp / $read1_bp)*100))")
5455
5556
if [ "$percent_read1" -lt "~{min_proportion}" ] ; then
5657
flag="FAIL; more than 50 percent of the total sequence is found in R2 (BP: $read2_bp; PERCENT: $percent_read2) compared to R1 (BP: $read1_bp; PERCENT: $percent_read1)"

tasks/quality_control/task_trimmomatic.wdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ task trimmomatic_pe {
2121
~{read1} ~{read2} \
2222
-baseout ~{samplename}.fastq.gz \
2323
SLIDINGWINDOW:~{trimmomatic_window_size}:~{trimmomatic_quality_trim_score} \
24-
MINLEN:~{trimmomatic_minlen} > ~{samplename}.trim.stats.txt
24+
MINLEN:~{trimmomatic_minlen} &> ~{samplename}.trim.stats.txt
2525
>>>
2626
output {
2727
File read1_trimmed = "~{samplename}_1P.fastq.gz"

tasks/species_typing/task_ts_mlst.wdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ task ts_mlst {
77
input {
88
File assembly
99
String samplename
10-
String docker = "staphb/mlst:2.19.0"
10+
String docker = "staphb/mlst:2.22.0"
1111
Int? cpu = 4
1212
# Parameters
1313
# --nopath Strip filename paths from FILE column (default OFF)

tasks/task_versioning.wdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ task version_capture {
88
volatile: true
99
}
1010
command {
11-
PHBG_Version="PHBG v.0.4-dev"
11+
PHBG_Version="PHBG v0.5.0"
1212
~{default='' 'export TZ=' + timezone}
1313
date +"%Y-%m-%d" > TODAY
14-
echo $PHBG_Version > PHBG_VERSION
14+
echo "$PHBG_Version" > PHBG_VERSION
1515
}
1616
output {
1717
String date = read_string("TODAY")

tasks/utilities/task_broad_terra_tools.wdl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,15 @@ task export_taxon_tables {
4848
String gambit_version
4949
String gambit_db_version
5050
String gambit_docker
51-
File abricate_amr_results
52-
String abricate_amr_database
53-
String abricate_amr_version
51+
File amrfinderplus_all_report
52+
File amrfinderplus_amr_report
53+
File amrfinderplus_stress_report
54+
File amrfinderplus_virulence_report
55+
String amrfinderplus_amr_genes
56+
String amrfinderplus_stress_genes
57+
String amrfinderplus_virulence_genes
58+
String amrfinderplus_version
59+
String amrfinderplus_db_version
5460
String ts_mlst_results
5561
String ts_mlst_predicted_st
5662
String ts_mlst_pubmlst_scheme
@@ -118,9 +124,9 @@ task export_taxon_tables {
118124
if [ ! -z ${sample_table} ]; then
119125
# create single-entity sample data table
120126
## header
121-
echo -e "entity:${sample_table}_id\treads\tread1\tread2\trun_id\tcollection_date\toriginating_lab\tcity\tcounty\tzip\ttheiaprok_illumina_pe_version\ttheiaprok_illumina_pe_analysis_date\tseq_platform\tnum_reads_raw1\tnum_reads_raw2\tnum_reads_raw_pairs\tfastq_scan_version\tnum_reads_clean1\tnum_reads_clean2\tnum_reads_clean_pairs\ttrimmomatic_version\tbbduk_docker\tr1_mean_q\tr2_mean_q\tassembly_fasta\tcontigs_gfa\tshovill_pe_version\tquast_report\tquast_version\tgenome_length\tnumber_contigs\tn50_value\tcg_pipeline_report\tcg_pipeline_docker\test_coverage\tgambit_report\tgambit_predicted_taxon\tgambit_predicted_taxon_rank\tgambit_version\tgambit_db_version\tgambit_docker\tabricate_amr_results\tabricate_amr_database\tabricate_amr_version\tts_mlst_results\tts_mlst_predicted_st\tts_mlst_pubmlst_scheme\tts_mlst_version\tserotypefinder_report\tserotypefinder_docker\tserotypefinder_serotype\tectyper_results\tectyper_version\tectyper_predicted_serotype\tlissero_results\tlissero_version\tsistr_results\tsistr_allele_json\tsister_allele_fasta\tsistr_cgmlst\tsistr_version\tsistr_predicted_serotype\tseqsero2_report\tseqsero2_version\tseqsero2_predicted_antigenic_profile\tseqsero2_predicted_serotype\tseqsero2_predicted_contamination\tkleborate_output_file\tkleborate_version\tkleborate_key_resistance_genes\tkleborate_genomic_resistance_mutations\tkleborate_mlst_sequence_type\ttbprofiler_output_file\ttbprofiler_output_bam\ttbprofiler_output_bai\ttbprofiler_version\ttbprofiler_main_lineage\ttbprofiler_sub_lineage\ttbprofiler_dr_type\ttbprofiler_resistance_genes" > ~{samplename}_terra_table.tsv
127+
echo -e "entity:${sample_table}_id\treads\tread1\tread2\trun_id\tcollection_date\toriginating_lab\tcity\tcounty\tzip\ttheiaprok_illumina_pe_version\ttheiaprok_illumina_pe_analysis_date\tseq_platform\tnum_reads_raw1\tnum_reads_raw2\tnum_reads_raw_pairs\tfastq_scan_version\tnum_reads_clean1\tnum_reads_clean2\tnum_reads_clean_pairs\ttrimmomatic_version\tbbduk_docker\tr1_mean_q\tr2_mean_q\tassembly_fasta\tcontigs_gfa\tshovill_pe_version\tquast_report\tquast_version\tgenome_length\tnumber_contigs\tn50_value\tcg_pipeline_report\tcg_pipeline_docker\test_coverage\tgambit_report\tgambit_predicted_taxon\tgambit_predicted_taxon_rank\tgambit_version\tgambit_db_version\tgambit_docker\tts_mlst_results\tts_mlst_predicted_st\tts_mlst_pubmlst_scheme\tts_mlst_version\tserotypefinder_report\tserotypefinder_docker\tserotypefinder_serotype\tectyper_results\tectyper_version\tectyper_predicted_serotype\tlissero_results\tlissero_version\tsistr_results\tsistr_allele_json\tsister_allele_fasta\tsistr_cgmlst\tsistr_version\tsistr_predicted_serotype\tseqsero2_report\tseqsero2_version\tseqsero2_predicted_antigenic_profile\tseqsero2_predicted_serotype\tseqsero2_predicted_contamination\tkleborate_output_file\tkleborate_version\tkleborate_key_resistance_genes\tkleborate_genomic_resistance_mutations\tkleborate_mlst_sequence_type\ttbprofiler_output_file\ttbprofiler_output_bam\ttbprofiler_output_bai\ttbprofiler_version\ttbprofiler_main_lineage\ttbprofiler_sub_lineage\ttbprofiler_dr_type\ttbprofiler_resistance_genes\tamrfinderplus_all_report\tamrfinderplus_amr_report\tamrfinderplus_stress_report\tamrfinderplus_virulence_report\tamrfinderplus_version\tamrfinderplus_db_version\tamrfinderplus_amr_genes\tamrfinderplus_stress_genes\tamrfinderplus_virulence_genes" > ~{samplename}_terra_table.tsv
122128
## TheiaProk Outs
123-
echo -e "~{samplename}\t~{reads}\t~{read1}\t~{read2}\t~{run_id}\t~{collection_date}\t~{originating_lab}\t~{city}\t~{county}\t~{zip}\t~{theiaprok_illumina_pe_version}\t~{theiaprok_illumina_pe_analysis_date}\t~{seq_platform}\t~{num_reads_raw1}\t~{num_reads_raw2}\t~{num_reads_raw_pairs}\t~{fastq_scan_version}\t~{num_reads_clean1}\t~{num_reads_clean2}\t~{num_reads_clean_pairs}\t~{trimmomatic_version}\t~{bbduk_docker}\t~{r1_mean_q}\t~{r2_mean_q}\t~{assembly_fasta}\t~{contigs_gfa}\t~{shovill_pe_version}\t~{quast_report}\t~{quast_version}\t~{genome_length}\t~{number_contigs}\t~{n50_value}\t~{cg_pipeline_report}\t~{cg_pipeline_docker}\t~{est_coverage}\t~{gambit_report}\t~{gambit_predicted_taxon}\t~{gambit_predicted_taxon_rank}\t~{gambit_version}\t~{gambit_db_version}\t~{gambit_docker}\t~{abricate_amr_results}\t~{abricate_amr_database}\t~{abricate_amr_version}\t~{ts_mlst_results}\t~{ts_mlst_predicted_st}\t~{ts_mlst_pubmlst_scheme}\t~{ts_mlst_version}\t~{serotypefinder_report}\t~{serotypefinder_docker}\t~{serotypefinder_serotype}\t~{ectyper_results}\t~{ectyper_version}\t~{ectyper_predicted_serotype}\t~{lissero_results}\t~{lissero_version}\t~{sistr_results}\t~{sistr_allele_json}\t~{sister_allele_fasta}\t~{sistr_cgmlst}\t~{sistr_version}\t~{sistr_predicted_serotype}\t~{seqsero2_report}\t~{seqsero2_version}\t~{seqsero2_predicted_antigenic_profile}\t~{seqsero2_predicted_serotype}\t~{seqsero2_predicted_contamination}\t~{kleborate_output_file}\t~{kleborate_version}\t~{kleborate_key_resistance_genes}\t~{kleborate_genomic_resistance_mutations}\t~{kleborate_mlst_sequence_type}\t~{tbprofiler_output_file}\t~{tbprofiler_output_bam}\t~{tbprofiler_output_bai}\t~{tbprofiler_version}\t~{tbprofiler_main_lineage}\t~{tbprofiler_sub_lineage}\t~{tbprofiler_dr_type}\t~{tbprofiler_resistance_genes}" >> ~{samplename}_terra_table.tsv
129+
echo -e "~{samplename}\t~{reads}\t~{read1}\t~{read2}\t~{run_id}\t~{collection_date}\t~{originating_lab}\t~{city}\t~{county}\t~{zip}\t~{theiaprok_illumina_pe_version}\t~{theiaprok_illumina_pe_analysis_date}\t~{seq_platform}\t~{num_reads_raw1}\t~{num_reads_raw2}\t~{num_reads_raw_pairs}\t~{fastq_scan_version}\t~{num_reads_clean1}\t~{num_reads_clean2}\t~{num_reads_clean_pairs}\t~{trimmomatic_version}\t~{bbduk_docker}\t~{r1_mean_q}\t~{r2_mean_q}\t~{assembly_fasta}\t~{contigs_gfa}\t~{shovill_pe_version}\t~{quast_report}\t~{quast_version}\t~{genome_length}\t~{number_contigs}\t~{n50_value}\t~{cg_pipeline_report}\t~{cg_pipeline_docker}\t~{est_coverage}\t~{gambit_report}\t~{gambit_predicted_taxon}\t~{gambit_predicted_taxon_rank}\t~{gambit_version}\t~{gambit_db_version}\t~{gambit_docker}\t~{ts_mlst_results}\t~{ts_mlst_predicted_st}\t~{ts_mlst_pubmlst_scheme}\t~{ts_mlst_version}\t~{serotypefinder_report}\t~{serotypefinder_docker}\t~{serotypefinder_serotype}\t~{ectyper_results}\t~{ectyper_version}\t~{ectyper_predicted_serotype}\t~{lissero_results}\t~{lissero_version}\t~{sistr_results}\t~{sistr_allele_json}\t~{sister_allele_fasta}\t~{sistr_cgmlst}\t~{sistr_version}\t~{sistr_predicted_serotype}\t~{seqsero2_report}\t~{seqsero2_version}\t~{seqsero2_predicted_antigenic_profile}\t~{seqsero2_predicted_serotype}\t~{seqsero2_predicted_contamination}\t~{kleborate_output_file}\t~{kleborate_version}\t~{kleborate_key_resistance_genes}\t~{kleborate_genomic_resistance_mutations}\t~{kleborate_mlst_sequence_type}\t~{tbprofiler_output_file}\t~{tbprofiler_output_bam}\t~{tbprofiler_output_bai}\t~{tbprofiler_version}\t~{tbprofiler_main_lineage}\t~{tbprofiler_sub_lineage}\t~{tbprofiler_dr_type}\t~{tbprofiler_resistance_genes}\t~{amrfinderplus_all_report}\t~{amrfinderplus_amr_report}\t~{amrfinderplus_stress_report}\t~{amrfinderplus_virulence_report}\t~{amrfinderplus_version}\t~{amrfinderplus_db_version}\t~{amrfinderplus_amr_genes}\t~{amrfinderplus_stress_genes}\t~{amrfinderplus_virulence_genes}" >> ~{samplename}_terra_table.tsv
124130
# modify file paths to GCP URIs
125131
sed -i 's/\/cromwell_root\//gs:\/\//g' ~{samplename}_terra_table.tsv
126132
# export table

workflows/wf_amrfinderplus.wdl

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version 1.0
2+
3+
import "../tasks/gene_typing/task_amrfinderplus.wdl" as amrfindertask
4+
import "../tasks/task_versioning.wdl" as versioning
5+
6+
workflow amrfinderplus_wf {
7+
input {
8+
File assembly
9+
String samplename
10+
}
11+
call amrfindertask.amrfinderplus_nuc {
12+
input:
13+
assembly = assembly,
14+
samplename = samplename
15+
}
16+
call versioning.version_capture{
17+
input:
18+
}
19+
output {
20+
String amrfinderplus_version = amrfinderplus_nuc.amrfinderplus_version
21+
String amrfinderplus_db_version = amrfinderplus_nuc.amrfinderplus_db_version
22+
String amrfinderplus_wf_version = version_capture.phbg_version
23+
String amrfinderplus_wf_analysis_date = version_capture.date
24+
File amrfinderplus_all_report = amrfinderplus_nuc.amrfinderplus_all_report
25+
File amrfinderplus_amr_report = amrfinderplus_nuc.amrfinderplus_amr_report
26+
File amrfinderplus_stress_report = amrfinderplus_nuc.amrfinderplus_stress_report
27+
File amrfinderplus_virulence_report = amrfinderplus_nuc.amrfinderplus_virulence_report
28+
String amrfinderplus_amr_genes = amrfinderplus_nuc.amrfinderplus_amr_genes
29+
String amrfinderplus_stress_genes = amrfinderplus_nuc.amrfinderplus_stress_genes
30+
String amrfinderplus_virulence_genes = amrfinderplus_nuc.amrfinderplus_virulence_genes
31+
}
32+
}

0 commit comments

Comments
 (0)