Skip to content

Commit

Permalink
Merge pull request #554 from broadinstitute/dp-scaffold
Browse files Browse the repository at this point in the history
scaffold multitaxa: drop empty assembly output rows
  • Loading branch information
dpark01 authored Sep 20, 2024
2 parents d6a1237 + 0915bf5 commit 4179ee0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 28 deletions.
25 changes: 18 additions & 7 deletions pipes/WDL/workflows/scaffold_and_refine_multitaxa.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,32 @@ workflow scaffold_and_refine_multitaxa {
"sample": '{"entityType":"sample","entityName":"' + sample_id + '"}'
}

scatter(h in assembly_header) {
String stat_by_taxon = stats_by_taxon[h]
if(assembly_length_unambiguous > min_scaffold_unambig) {
scatter(h in assembly_header) {
String stat_by_taxon = stats_by_taxon[h]
}
}
}

### summary stats
call utils.concatenate {
input:
infiles = [write_tsv([assembly_header]), write_tsv(stat_by_taxon)],
output_name = "assembly_metadata-~{sample_id}.tsv"
if (length(select_all(stat_by_taxon)) > 0) {
call utils.concatenate as assembly_stats_non_empty {
input:
infiles = [write_tsv([assembly_header]), write_tsv(select_all(stat_by_taxon))],
output_name = "assembly_metadata-~{sample_id}.tsv"
}
}
if (length(select_all(stat_by_taxon)) == 0) {
call utils.concatenate as assembly_stats_empty {
input:
infiles = [write_tsv([assembly_header])],
output_name = "assembly_metadata-~{sample_id}.tsv"
}
}

output {
Array[Map[String,String]] assembly_stats_by_taxon = stats_by_taxon
File assembly_stats_by_taxon_tsv = concatenate.combined
File assembly_stats_by_taxon_tsv = select_first([assembly_stats_non_empty.combined, assembly_stats_empty.combined])
String assembly_method = "viral-ngs/scaffold_and_refine_multitaxa"

#String assembly_top_taxon_id = select_references.top_matches_per_cluster_basenames[0]
Expand Down
21 changes: 0 additions & 21 deletions test/input/WDL/miniwdl-local/test_inputs-genbank-local.json

This file was deleted.

0 comments on commit 4179ee0

Please sign in to comment.