Open d-cameron opened 4 years ago
@d-cameron Relaxing this restriction seems like a good idea. I don't remember why we made this particular writer so strict about empty files, I suspect it was inspired by an issue someone ran into. Making it configurable would be a good solution so it doesn't change things for people who are expecting it.
Description of the issue:
FastaReferenceWriter throws an exception if no sequences were written:
Steps to reproduce
Expected behaviour
An empty test.fa is created.
Actual behaviour
An exception is thrown.
For my particular use case, I am writing the sequences of all viruses detected in a sample. In this use case, an empty fasta file is a valid output.
I see the following possible resolutions to this issue: