broadinstitute / viral-pipelines

viral-ngs: complete pipelines
Other
60 stars 28 forks source link

guard against shell pipefails in align_and_count in instances where empty inputs would result in div-by-zero conditions #535

Closed tomkinsc closed 6 months ago

tomkinsc commented 6 months ago

guard against shell pipefails in align_and_count in instances where empty inputs would result in div-by-zero conditions

This is also somewhat dependent on https://github.com/broadinstitute/viral-core/pull/102, which helps ensure samtools idxstats emits useful outputs in the case of empty read groups in the input (i.e. zero counts are reported for the sequences in the reference fasta used by align_and_count in the event the bam is empty, rather than a single zero for the catchall "*" read category—though with the changes in this PR the latter should now be tolerated)