Skip to content

Commit

Permalink
[Augur] Fix issue with empty clades.tsv file in augur_clades task (#742)
Browse files Browse the repository at this point in the history
* Add file size check for augur_clades_tsv to prevent empty input

* Update genome length selection to include default value of 0

* Better way of restricting the empty clades.tsv file from the augur_clades task.

* Clarify flu_segment logic to better represent which species are running augur_traits/clades.

Better way of identifying "minimal-clades.tsv" file in augur workflow.
  • Loading branch information
MrTheronJ authored Feb 6, 2025
1 parent ec4492e commit 6adc4f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions workflows/phylogenetics/wf_augur.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ workflow augur {
build_name = build_name_updated
}
}
if (flu_segment == "HA") { # we only have clade information for HA segments (but SC2 defaults will be selected first)
if (flu_segment != "NA") { # we have clade information for all "standard" species except for NA flu segments (SC2 defaults should be selected first)
if (run_traits && defined(tsv_join.out_tsv)) { # by default do not run traits and clades will be assigned based on the clades_tsv
call traits_task.augur_traits {
input:
Expand All @@ -150,7 +150,7 @@ workflow augur {
}
}
if (! run_traits) {
if (defined(clades_tsv) || defined(sc2_defaults.clades_tsv) || defined(organism_parameters.augur_clades_tsv)) { # one of these must be present
if (defined(clades_tsv) || defined(sc2_defaults.clades_tsv) || (defined(organism_parameters.augur_clades_tsv) && (basename(organism_parameters.augur_clades_tsv) != "minimal-clades.tsv"))) { # one must be present and not the empty "minimal-clades.tsv" file
call clades_task.augur_clades { # assign clades to nodes based on amino-acid or nucleotide signatures
input:
refined_tree = augur_refine.refined_tree,
Expand Down
2 changes: 1 addition & 1 deletion workflows/utilities/wf_organism_parameters.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ workflow organism_parameters {
File gene_locations_bed = select_first([gene_locations_bed_file, sc2_gene_locations_bed, mpox_gene_locations_bed, "gs://theiagen-public-files/terra/theiacov-files/empty.bed"])
File primer_bed = select_first([primer_bed_file, mpox_primer_bed_file, wnv_primer_bed_file, hiv_v1_primer_bed, hiv_v2_primer_bed, "gs://theiagen-public-files/terra/theiacov-files/empty.bed"])
File reference_gff = select_first([reference_gff_file, mpox_reference_gff_file, hiv_v1_reference_gff, hiv_v2_reference_gff, "gs://theiagen-public-files/terra/theiacov-files/empty.gff3"])
Int genome_length = select_first([genome_length_input, sc2_genome_len, mpox_genome_len, wnv_genome_len, flu_genome_len, rsv_a_genome_len, rsv_b_genome_len, hiv_v1_genome_len, hiv_v2_genome_len])
Int genome_length = select_first([genome_length_input, sc2_genome_len, mpox_genome_len, wnv_genome_len, flu_genome_len, rsv_a_genome_len, rsv_b_genome_len, hiv_v1_genome_len, hiv_v2_genome_len, 0])
# nextclade information
String nextclade_dataset_tag = select_first([nextclade_dataset_tag_input, sc2_nextclade_ds_tag, mpox_nextclade_ds_tag, wnv_nextclade_ds_tag, h1n1_ha_nextclade_ds_tag, h3n2_ha_nextclade_ds_tag, vic_ha_nextclade_ds_tag, yam_ha_nextclade_ds_tag, h5n1_ha_nextclade_ds_tag, h1n1_na_nextclade_ds_tag, h3n2_na_nextclade_ds_tag, vic_na_nextclade_ds_tag, yam_na_nextclade_ds_tag, rsv_a_nextclade_ds_tag, rsv_b_nextclade_ds_tag, "NA"])
String nextclade_dataset_name = select_first([nextclade_dataset_name_input, sc2_nextclade_ds_name, mpox_nextclade_ds_name, wnv_nextclade_ds_name, h1n1_ha_nextclade_ds_name, h3n2_ha_nextclade_ds_name, vic_ha_nextclade_ds_name, yam_ha_nextclade_ds_name, h5n1_ha_nextclade_ds_name, h1n1_na_nextclade_ds_name, h3n2_na_nextclade_ds_name, vic_na_nextclade_ds_name, yam_na_nextclade_ds_name, rsv_a_nextclade_ds_name, rsv_b_nextclade_ds_name, "NA"])
Expand Down

0 comments on commit 6adc4f9

Please sign in to comment.