Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Vibecheck to the Vibrio spp. subworkflow of TheiaProk #763

Merged
merged 8 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
937 changes: 479 additions & 458 deletions docs/workflows/genomic_characterization/theiaprok.md

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions tasks/species_typing/vibrio/task_vibecheck_vibrio.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
version 1.0

task vibecheck_vibrio {
meta {
description: "Rapidly assigns O1 Vibrio cholerae sequencing data to transmission lineages using variant frequency demixing."
}
input {
File read1
File? read2
File? lineage_barcodes
Float? subsampling_fraction
Boolean skip_subsampling = false
String docker = "watronfire/vibecheck:2025.02.24"
Int disk_size = 16
Int cpu = 2
Int memory = 3
}
command <<<
set -ex

# Capture Vibecheck version information.
vibecheck -v | tee VERSION

# Unclear if this will work with single-reads, will explore and update.
vibecheck "~{read1}" "~{read2}" \
--outdir . \
~{"--barcodes " + lineage_barcodes} \
~{"--subsampling_fraction " + subsampling_fraction} \
~{true='--no-detect' false='' skip_subsampling}

# Parse Vibecheck results to capture lineage estimate, confidence, and any classification notes produced by Freyja.
python3 <<CODE
import csv
with open( "lineage_report.csv", "rt" ) as csv_file:
reader = csv.DictReader( csv_file )
line = next( reader )
for key in ["lineage", "confidence", "classification_notes"]:
with open( key.upper(), "wt" ) as outf:
outf.write(line[key])
CODE
>>>
output {
File vibecheck_lineage_report = "lineage_report.csv"
String vibecheck_top_lineage = read_string("LINEAGE")
Float vibecheck_confidence = read_float("CONFIDENCE")
String vibecheck_classification_notes = read_string("CLASSIFICATION_NOTES")
String vibecheck_version = read_string("VERSION")
String vibecheck_docker = docker
}
runtime {
docker: docker
memory: memory + " GB"
cpu: cpu
disks: "local-disk " + disk_size + " SSD"
disk: disk_size + " GB"
maxRetries: 3
preemptible: 0
}
}
4 changes: 2 additions & 2 deletions tests/workflows/theiaprok/test_wf_theiaprok_illumina_pe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,9 @@
- path: miniwdl_run/wdl/tasks/taxon_id/contamination/task_midas.wdl
md5sum: 64caaaff5910ac0036e2659434500962
- path: miniwdl_run/wdl/workflows/theiaprok/wf_theiaprok_illumina_pe.wdl
md5sum: cea2e72701662adca0b30fd48baca3ab
md5sum: 8d2c15e11472f0ca1df84ddcbb979cf2
- path: miniwdl_run/wdl/workflows/utilities/wf_merlin_magic.wdl
md5sum: e797bbc7ceb4f62728f7ef315d9a4e40
md5sum: 7e66aa483f679261d1e5fd11f22e4f5d
- path: miniwdl_run/wdl/workflows/utilities/wf_read_QC_trim_pe.wdl
contains: ["version", "QC", "output"]
- path: miniwdl_run/workflow.log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@
- path: miniwdl_run/wdl/workflows/theiaprok/wf_theiaprok_illumina_se.wdl
md5sum: ff0f911bbaf3876ecb139bf6c564f1df
- path: miniwdl_run/wdl/workflows/utilities/wf_merlin_magic.wdl
md5sum: e797bbc7ceb4f62728f7ef315d9a4e40
md5sum: 7e66aa483f679261d1e5fd11f22e4f5d
- path: miniwdl_run/wdl/workflows/utilities/wf_read_QC_trim_se.wdl
md5sum: 09d9f68b9ca8bf94b6145ff9bed2edd1
- path: miniwdl_run/workflow.log
Expand Down
14 changes: 13 additions & 1 deletion workflows/theiaprok/wf_theiaprok_illumina_pe.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,12 @@ workflow theiaprok_illumina_pe {
"ts_mlst_pubmlst_scheme": ts_mlst.ts_mlst_pubmlst_scheme,
"ts_mlst_results": ts_mlst.ts_mlst_results,
"ts_mlst_version": ts_mlst.ts_mlst_version,
"vibecheck_lineage_report": merlin_magic.vibecheck_lineage_report,
"vibecheck_top_lineage": merlin_magic.vibecheck_top_lineage,
"vibecheck_confidence": merlin_magic.vibecheck_confidence,
"vibecheck_classification_notes": merlin_magic.vibecheck_classification_notes,
"vibecheck_version": merlin_magic.vibecheck_version,
"vibecheck_docker": merlin_magic.vibecheck_docker,
"virulencefinder_docker": merlin_magic.virulencefinder_docker,
"virulencefinder_hits": merlin_magic.virulencefinder_hits,
"virulencefinder_report_tsv": merlin_magic.virulencefinder_report_tsv,
Expand Down Expand Up @@ -1129,7 +1135,13 @@ workflow theiaprok_illumina_pe {
String? abricate_vibrio_toxR = merlin_magic.abricate_vibrio_toxR
String? abricate_vibrio_biotype = merlin_magic.abricate_vibrio_biotype
String? abricate_vibrio_serogroup = merlin_magic.abricate_vibrio_serogroup
File? vibecheck_lineage_report = merlin_magic.vibecheck_lineage_report
String? vibecheck_top_lineage = merlin_magic.vibecheck_top_lineage
Float? vibecheck_confidence = merlin_magic.vibecheck_confidence
String? vibecheck_classification_notes = merlin_magic.vibecheck_classification_notes
String? vibecheck_version = merlin_magic.vibecheck_version
String? vibecheck_docker = merlin_magic.vibecheck_docker
# export taxon table output
String? taxon_table_status = export_taxon_table.status
}
}
}
23 changes: 22 additions & 1 deletion workflows/utilities/wf_merlin_magic.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import "../../tasks/species_typing/streptococcus/task_poppunk_streppneumo.wdl" a
import "../../tasks/species_typing/streptococcus/task_seroba.wdl" as seroba
import "../../tasks/species_typing/vibrio/task_srst2_vibrio.wdl" as srst2_vibrio_task
import "../../tasks/species_typing/vibrio/task_abricate_vibrio.wdl" as abricate_vibrio_task
import "../../tasks/species_typing/vibrio/task_vibecheck_vibrio.wdl" as vibecheck_vibrio_task

# theiaeuk
import "../../tasks/gene_typing/variant_detection/task_snippy_gene_query.wdl" as snippy_gene_query
Expand Down Expand Up @@ -92,6 +93,7 @@ workflow merlin_magic {
String? staphopia_sccmec_docker_image
String? tbprofiler_docker_image
String? tbp_parser_docker_image
String? vibecheck_docker_image
String? virulencefinder_docker_image
# abricate abaum options
Int abricate_abaum_min_percent_identity = 95 # strict threshold of 95% identity for typing purposes
Expand Down Expand Up @@ -228,6 +230,10 @@ workflow merlin_magic {
Float? tbp_parser_rpob449_frequency
Float? tbp_parser_etha237_frequency
File? tbp_parser_expert_rule_regions_bed
# Vibecheck options
File? vibecheck_lineage_barcodes
Float? vibecheck_subsampling_fraction
Boolean? vibecheck_skip_subsampling
# virulencefinder options
Float? virulencefinder_min_coverage
Float? virulencefinder_min_percent_identity
Expand Down Expand Up @@ -626,6 +632,15 @@ workflow merlin_magic {
gene_max_mismatch = srst2_gene_max_mismatch,
docker = srst2_docker_image
}
call vibecheck_vibrio_task.vibecheck_vibrio {
input:
read1 = select_first([read1]),
read2 = read2,
lineage_barcodes = vibecheck_lineage_barcodes,
subsampling_fraction = vibecheck_subsampling_fraction,
skip_subsampling = vibecheck_skip_subsampling,
docker = vibecheck_docker_image
}
}
call abricate_vibrio_task.abricate_vibrio {
input:
Expand Down Expand Up @@ -1010,6 +1025,12 @@ workflow merlin_magic {
String? abricate_vibrio_toxR = abricate_vibrio.abricate_vibrio_toxR
String? abricate_vibrio_biotype = abricate_vibrio.abricate_vibrio_biotype
String? abricate_vibrio_serogroup = abricate_vibrio.abricate_vibrio_serogroup
File? vibecheck_lineage_report = vibecheck_vibrio.vibecheck_lineage_report
String? vibecheck_top_lineage = vibecheck_vibrio.vibecheck_top_lineage
Float? vibecheck_confidence = vibecheck_vibrio.vibecheck_confidence
String? vibecheck_classification_notes = vibecheck_vibrio.vibecheck_classification_notes
String? vibecheck_version = vibecheck_vibrio.vibecheck_version
String? vibecheck_docker = vibecheck_vibrio.vibecheck_docker

# theiaeuk
# c auris
Expand All @@ -1034,4 +1055,4 @@ workflow merlin_magic {
String snippy_variants_num_variants = select_first([snippy_cauris.snippy_variants_num_variants, snippy_afumigatus.snippy_variants_num_variants, snippy_crypto.snippy_variants_num_variants, "No matching taxon detected"])
String snippy_variants_percent_ref_coverage = select_first([snippy_cauris.snippy_variants_percent_ref_coverage, snippy_afumigatus.snippy_variants_percent_ref_coverage, snippy_crypto.snippy_variants_percent_ref_coverage, "No matching taxon detected"])
}
}
}
Loading