Permit fastq output to create empty FASTQ records for seq "*". #1576
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is rather questionable, but htslib can read in empty fastq records and generates "*" for SEQ and QUAL. The same is true vice versa now. Eg:
becomes
Bwa mem and minimap2 can both read these fastq entries too, although the SAM output is bugged as it outputs an empty field instead of "*" for SEQ. (Note this is still readable by htslib and interpreted the same).
Potential reasons for accepting this:
When dealing with paired data, we don't want to output a differing number of records from samtools fastq if read1 has seq and read2 has "*".
Note as this filtered at the htslib layer, it's not considered as a singleton so fastq -s won't rescue this.
At least some aligners apparently support this format. Although inevitably they just produce unmapped data.
Arguably this is a case of silly input => silly output!
Users can manually elect to "samtools view -e 'length(seq) > 0'" before using samtools fastq, which then fixes the not-a-singleton problem.
It converts samtools fastq output back to how it was in pre 1.13 era, where we rewrote it to use htslib's interfaces.
Potential reason to reject:
Fixes samtools/samtools#1799