Skip to content

Commit

Permalink
Merge pull request #199 from theiagen/smw-tbprofiler-continuing-dev
Browse files Browse the repository at this point in the history
Smw tbprofiler continuing dev
  • Loading branch information
kapsakcj authored Sep 29, 2023
2 parents f008d92 + c3a5849 commit 34cec39
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tasks/species_typing/task_tbp_parser.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ task tbp_parser {
Int coverage_threshold = 100
Boolean tbp_parser_debug = false

String docker = "us-docker.pkg.dev/general-theiagen/theiagen/tbp-parser:0.0.10"
String docker = "us-docker.pkg.dev/general-theiagen/theiagen/tbp-parser:1.0.0"
Int disk_size = 100
Int memory = 4
Int cpu = 1
Expand Down
25 changes: 24 additions & 1 deletion tasks/species_typing/task_tbprofiler.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ task tbprofiler {
Int cov_frac_threshold = 1
Int cpu = 8
Boolean ont_data = false
File? tbprofiler_custom_db
Boolean tbprofiler_run_custom_db = false
}
command <<<
# Print and save date
Expand All @@ -38,6 +40,26 @@ task tbprofiler {
export ont_data="false"
fi

# check if new database file is provided and not empty
if [ "~{tbprofiler_run_custom_db}" = true ] ; then

echo "Found new database file ~{tbprofiler_custom_db}"
prefix=$(basename "~{tbprofiler_custom_db}" | sed 's/\.tar\.gz$//')
echo "New database will be created with prefix $prefix"

echo "Inflating the new database..."
tar xfv ~{tbprofiler_custom_db}

tb-profiler load_library ./"$prefix"/"$prefix"

TBDB="--db $prefix"

else

TBDB=""

fi

# Run tb-profiler on the input reads with samplename prefix
tb-profiler profile \
${mode} \
Expand All @@ -50,7 +72,8 @@ task tbprofiler {
--reporting_af \
~{min_af_pred} \
--coverage_fraction_threshold ~{cov_frac_threshold} \
--csv --txt
--csv --txt \
$TBDB

# Collate results
tb-profiler collate --prefix ~{samplename}
Expand Down
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 @@ -620,7 +620,7 @@
- path: miniwdl_run/wdl/tasks/species_typing/task_sonneityping.wdl
md5sum: aeb12cf9a0db4e34f2aecbaba51c30fb
- path: miniwdl_run/wdl/tasks/species_typing/task_tbprofiler.wdl
md5sum: f3c9cdca6d49878ab2be31aff128e1b4
md5sum: c2a8c0978cc1bd65656584e1bad9dca7
- path: miniwdl_run/wdl/tasks/species_typing/task_ts_mlst.wdl
md5sum: d49ae0b02e798af0636eb2721bb434b4
- path: miniwdl_run/wdl/tasks/task_versioning.wdl
Expand All @@ -636,7 +636,7 @@
- path: miniwdl_run/wdl/workflows/theiaprok/wf_theiaprok_illumina_pe.wdl
md5sum: ca8825e5cc5a6d910e0368fcb6992905
- path: miniwdl_run/wdl/workflows/utilities/wf_merlin_magic.wdl
md5sum: c4861a59d49b13b67706631a0e1246c4
md5sum: 2614fac622fa2035b80a7b220b1aed86
- path: miniwdl_run/wdl/workflows/utilities/wf_read_QC_trim_pe.wdl
contains: ["version", "QC", "output"]
- path: miniwdl_run/workflow.log
Expand Down
4 changes: 2 additions & 2 deletions tests/workflows/theiaprok/test_wf_theiaprok_illumina_se.yml
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@
- path: miniwdl_run/wdl/tasks/species_typing/task_sonneityping.wdl
md5sum: aeb12cf9a0db4e34f2aecbaba51c30fb
- path: miniwdl_run/wdl/tasks/species_typing/task_tbprofiler.wdl
md5sum: f3c9cdca6d49878ab2be31aff128e1b4
md5sum: c2a8c0978cc1bd65656584e1bad9dca7
- path: miniwdl_run/wdl/tasks/species_typing/task_ts_mlst.wdl
md5sum: d49ae0b02e798af0636eb2721bb434b4
- path: miniwdl_run/wdl/tasks/task_versioning.wdl
Expand All @@ -604,7 +604,7 @@
- path: miniwdl_run/wdl/workflows/theiaprok/wf_theiaprok_illumina_se.wdl
md5sum: 627a157d962453229f619da37e03e43d
- path: miniwdl_run/wdl/workflows/utilities/wf_merlin_magic.wdl
md5sum: c4861a59d49b13b67706631a0e1246c4
md5sum: 2614fac622fa2035b80a7b220b1aed86
- path: miniwdl_run/wdl/workflows/utilities/wf_read_QC_trim_se.wdl
md5sum: 53d322d895837c0bcb049786572e944d
- path: miniwdl_run/workflow.log
Expand Down
6 changes: 5 additions & 1 deletion workflows/utilities/wf_merlin_magic.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ workflow merlin_magic {
Boolean call_shigeifinder_reads_input = false
Boolean assembly_only = false
Boolean theiaeuk = false
Boolean tbprofiler_run_custom_db = false
File tbprofiler_custom_db = "gs://theiagen-public-files/terra/theiaprok-files/tbdb_varpipe_combined_nodups.tar.gz"
Boolean tbprofiler_additional_outputs = false
String tbp_parser_output_seq_method_type = "WGS"
String? tbp_parser_operator
Expand Down Expand Up @@ -247,7 +249,9 @@ workflow merlin_magic {
input:
read1 = select_first([clockwork_decon_reads.clockwork_cleaned_read1, read1]),
read2 = select_first([clockwork_decon_reads.clockwork_cleaned_read2, read2, "gs://theiagen-public-files/terra/theiaprok-files/no-read2.txt"]),
samplename = samplename
samplename = samplename,
tbprofiler_run_custom_db = tbprofiler_run_custom_db,
tbprofiler_custom_db = tbprofiler_custom_db
}
if (tbprofiler_additional_outputs) {
call tbp_parser_task.tbp_parser {
Expand Down

0 comments on commit 34cec39

Please sign in to comment.