You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A new enum, SortOrder, should be added to enumerate the valid sort orders.
A new function, get_sort_order(header: pysam.AlignmentHeader) -> SortOrder | None should be implemented.
This function should extract the sort order from the header when possible. Specifically, the function should:
Validate the presence of HD in the header. If it is absent, return None.
Validate the presence of the key SO in the HD dictionary. If it is absent, return None.
Attempt to parse the sort-order from the value associated with the SO key. If it is valid, the corresponding SortOrder member should be returned. If it is invalid, either raise a ValueError or return an SortOrder.UNKNOWN member, possibly with the raw value somehow associated.