diff --git a/pipes/WDL/workflows/scaffold_and_refine_multitaxa.wdl b/pipes/WDL/workflows/scaffold_and_refine_multitaxa.wdl index 89258cfe1..0af33b228 100644 --- a/pipes/WDL/workflows/scaffold_and_refine_multitaxa.wdl +++ b/pipes/WDL/workflows/scaffold_and_refine_multitaxa.wdl @@ -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] diff --git a/test/input/WDL/miniwdl-local/test_inputs-genbank-local.json b/test/input/WDL/miniwdl-local/test_inputs-genbank-local.json deleted file mode 100644 index 1c938870e..000000000 --- a/test/input/WDL/miniwdl-local/test_inputs-genbank-local.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "genbank.molType": "cRNA", - "genbank.reference_accessions": ["KM821997.1", "KM821998.1"], - "genbank.coverage_table": "test/input/genbank/coverage_report-RUN1-workflow.txt", - "genbank.alignments_bams": [], - "genbank.sequencingTech": "Illumina MiSeq", - "genbank.biosample_attributes": "test/input/genbank/biosample-attributes-lasv.txt", - "genbank.prep_genbank.assembly_method": "placeholder assembly software", - "genbank.prep_genbank.assembly_method_version": "5.4.3.2.1", - "genbank.comment": "this is only a test -- DO NOT SUBMIT to NCBI", - "genbank.author_list": "Odia,Ikponmwosa, Ehaine,Philomena, Oguzie,Judith,U. Siddle,Katherine,J. Mehta,Samar, Barnes,Kayla,M. Winnicki,Sarah,M. Brehio,Patrick, Shah,Rickey,R. Chak,Bridget, Yozwiak,Nathan, Amao,Adebayo, Nosamiefan,Iguosadolo, Birren,Bruce,W. Park,Daniel,J. Folarin,Onikepe, Okokhere,Peter, Sabeti,Pardis,C. Happi,Christian,T.", - "genbank.author_sbt_defaults_yaml": "test/input/genbank/default_sbt_values.yaml", - "genbank.author_sbt_j2_template": "test/input/genbank/author_template.sbt.j2", - "genbank.assemblies_fasta": [ - "test/input/LASV_NGA_2018_0026.fasta", - "test/input/LASV_NGA_2018_0097.fasta", - "test/input/LASV_NGA_2018_0541.fasta" - ], - "genbank.email_address": "viral-ngs@broadinstitute.org" -} -