From 299cc7c85e791802ec89ee8fc8481aa1fb7794db Mon Sep 17 00:00:00 2001 From: Nathan Roach Date: Fri, 30 Dec 2022 10:00:56 -0500 Subject: [PATCH] Adding template coordinate sort order back in for this PR --- fgpyo/sam/__init__.py | 2 ++ fgpyo/sam/tests/test_builder.py | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fgpyo/sam/__init__.py b/fgpyo/sam/__init__.py index fc5502ad..8290916d 100644 --- a/fgpyo/sam/__init__.py +++ b/fgpyo/sam/__init__.py @@ -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 diff --git a/fgpyo/sam/tests/test_builder.py b/fgpyo/sam/tests/test_builder.py index b9f89daf..1f235626 100755 --- a/fgpyo/sam/tests/test_builder.py +++ b/fgpyo/sam/tests/test_builder.py @@ -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]