Closed jmarshall closed 3 years ago
Example file badtag.sam comes from samtools/samtools#1237 — unusually, HTSlib has been stricter here than HTSJDK!
I sort of assumed it would have complained if it saw something like that, thanks for pointing this out.
I too assumed SAMTextHeaderCodec.java's ParsedHeaderLine
would have always complained about this, but it seems not. I guess with neither major implementation (prior to htslib 1.10 paying attention to headers) noticing this problem, this is how the samtools issue OP's professor's BAM file has been like this since 2017. Sigh…
Description of the issue:
HTSJDK does not produce a diagnostic when reading header tags that are not two characters in length. For example,
In this file,
LNID:5
,FCID:…
, andBCID:…
on the@RG
line do not match the pattern required for a SAM header line, as there are not exactly two characters before the colon.Steps to reproduce
I would expect this to be diagnosed by e.g.
or additionally by
ViewSam
or any other SAM file reading.Expected behaviour
ValidateSamFile error message to the effect of
(This is edited from the error message that does occur for an alignment record with e.g.
LNID:i:5
as an invalidly-tagged aux field.)Actual behaviour