-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AlignmentHeader.from_dict() silently discards the TP attribute from SQ lines #1237
Comments
I really dislike this “I only believe in fields I know about” aspect of this part of pysam and would rather remove it. Those tables of known attributes are useful to return Perhaps that's a quick fix too, but in the meantime PR #1238 would be a good stopgap. |
I totally agree @jmarshall. Quoting the spec on the header (emphasis in the second paragraph mine):
|
Add omitted tags to KNOWN_HEADER_FIELDS and VALID_HEADER_ORDER, so that AlignmentHeader.from_dict()/to_dict() will preserve all header field tags defined in the SAM specification. Addresses #1237. Exercise TP:linear in some header tests. Co-authored-by: John Marshall <[email protected]>
Yes, I remember writing that text 😄 — though it was longer ago than I expected, in 2015. It turns out that However in the medium term, I think the right thing to do for these conversions will be to rewrite this code using the post-1.10 HTSlib header API instead. At that point, I think most of this code that enumerates known tags will naturally disappear. If you don't mind, I'll leave this issue open to represent that work. |
The
TP
attribute in sequence lines in the SAM header is used to encode whether a reference sequence is linear or circular. UnfortunatelyAlignmentHeader.from_dict()
silently removes this tag from the data:The text was updated successfully, but these errors were encountered: