Skip to content

Commit

Permalink
Adding template coordinate sort order back in for this PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Roach committed Dec 30, 2022
1 parent 45ad823 commit 299cc7c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions fgpyo/sam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,4 +849,6 @@ class SamOrder(enum.Enum):
Unsorted = "unsorted" #: the SAM / BAM / CRAM is unsorted
Coordinate = "coordinate" #: coordinate sorted
QueryName = "queryname" #: queryname sorted
TemplateCoordinate = "unsorted" #: the sort order (@HD SO) is unsorted, the group order (GO)
#: is query, and the sub-sort (SS) is template-coordinate
Unknown = "unknown" # Unknown SAM / BAM / CRAM sort order
9 changes: 8 additions & 1 deletion fgpyo/sam/tests/test_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,15 @@ def make_sort_order_builder(tmp_path: Path, sort_order: SamOrder) -> Path:
(SamOrder.QueryName, ["test1", "test2", "test3", "test4"]),
(SamOrder.Unsorted, ["test3", "test2", "test1", "test4"]),
(None, ["test3", "test2", "test1", "test4"]),
(SamOrder.TemplateCoordinate, ["test3", "test2", "test1", "test4"]),
],
ids=[
"Coordinate sorting",
"Query name sorting",
"Unsorted output",
"Unsorted output - None",
"Template Coordinate",
],
ids=["Coordinate sorting", "Query name sorting", "Unsorted output", "Unsorted output - None"],
)
def test_sort_types(
tmp_path: Path, sort_order: Optional[SamOrder], expected_name_order: List[str]
Expand Down

0 comments on commit 299cc7c

Please sign in to comment.