Skip to content

Commit

Permalink
Merge branch 'smw-tb-vcf-dev' into smw-tb-2023-10-25-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sage-wright committed Oct 25, 2023
2 parents ba8d60d + 0251379 commit c6fac1e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tasks/species_typing/task_tbprofiler.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ task tbprofiler {

# 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"
Expand All @@ -53,11 +52,8 @@ task tbprofiler {
tb-profiler load_library ./"$prefix"/"$prefix"

TBDB="--db $prefix"

else

TBDB=""

fi

# Run tb-profiler on the input reads with samplename prefix
Expand All @@ -81,6 +77,11 @@ task tbprofiler {
# touch optional output files because wdl
touch GENE_NAME LOCUS_TAG VARIANT_SUBSTITUTIONS OUTPUT_SEQ_METHOD_TYPE

# merge all vcf files if multiple are present
bcftools index ./vcf/*bcf
bcftools index ./vcf/*gz
bcftools merge --force-samples ./vcf/*bcf ./vcf/*gz > ./vcf/~{samplename}.targets.csq.merged.vcf

python3 <<CODE
import csv
import json
Expand Down Expand Up @@ -127,6 +128,7 @@ task tbprofiler {
File tbprofiler_output_json = "./results/~{samplename}.results.json"
File tbprofiler_output_bam = "./bam/~{samplename}.bam"
File tbprofiler_output_bai = "./bam/~{samplename}.bam.bai"
File tbprofiler_output_vcf = "./vcf/~{samplename}.targets.csq.merged.vcf"
String version = read_string("VERSION")
String tbprofiler_main_lineage = read_string("MAIN_LINEAGE")
String tbprofiler_sub_lineage = read_string("SUB_LINEAGE")
Expand Down
1 change: 1 addition & 0 deletions workflows/theiaprok/wf_theiaprok_illumina_pe.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,7 @@ workflow theiaprok_illumina_pe {
File? tbprofiler_output_file = merlin_magic.tbprofiler_output_file
File? tbprofiler_output_bam = merlin_magic.tbprofiler_output_bam
File? tbprofiler_output_bai = merlin_magic.tbprofiler_output_bai
File? tbprofiler_output_vcf = merlin_magic.tbprofiler_output_vcf
String? tbprofiler_version = merlin_magic.tbprofiler_version
String? tbprofiler_main_lineage = merlin_magic.tbprofiler_main_lineage
String? tbprofiler_sub_lineage = merlin_magic.tbprofiler_sub_lineage
Expand Down
1 change: 1 addition & 0 deletions workflows/theiaprok/wf_theiaprok_illumina_se.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ workflow theiaprok_illumina_se {
File? tbprofiler_output_file = merlin_magic.tbprofiler_output_file
File? tbprofiler_output_bam = merlin_magic.tbprofiler_output_bam
File? tbprofiler_output_bai = merlin_magic.tbprofiler_output_bai
File? tbprofiler_output_vcf = merlin_magic.tbprofiler_output_vcf
String? tbprofiler_version = merlin_magic.tbprofiler_version
String? tbprofiler_main_lineage = merlin_magic.tbprofiler_main_lineage
String? tbprofiler_sub_lineage = merlin_magic.tbprofiler_sub_lineage
Expand Down
1 change: 1 addition & 0 deletions workflows/theiaprok/wf_theiaprok_ont.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ workflow theiaprok_ont {
File? tbprofiler_output_file = merlin_magic.tbprofiler_output_file
File? tbprofiler_output_bam = merlin_magic.tbprofiler_output_bam
File? tbprofiler_output_bai = merlin_magic.tbprofiler_output_bai
File? tbprofiler_output_vcf = merlin_magic.tbprofiler_output_vcf
String? tbprofiler_version = merlin_magic.tbprofiler_version
String? tbprofiler_main_lineage = merlin_magic.tbprofiler_main_lineage
String? tbprofiler_sub_lineage = merlin_magic.tbprofiler_sub_lineage
Expand Down
1 change: 1 addition & 0 deletions workflows/utilities/wf_merlin_magic.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ workflow merlin_magic {
File? tbprofiler_output_file = tbprofiler.tbprofiler_output_csv
File? tbprofiler_output_bam = tbprofiler.tbprofiler_output_bam
File? tbprofiler_output_bai = tbprofiler.tbprofiler_output_bai
File? tbprofiler_output_vcf = tbprofiler.tbprofiler_output_vcf
String? tbprofiler_version = tbprofiler.version
String? tbprofiler_main_lineage = tbprofiler.tbprofiler_main_lineage
String? tbprofiler_sub_lineage = tbprofiler.tbprofiler_sub_lineage
Expand Down

0 comments on commit c6fac1e

Please sign in to comment.