-
Notifications
You must be signed in to change notification settings - Fork 3
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
Adding the option to specify the sort order of an output SAM file produced by SamBuilder. #25
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comments
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #25 +/- ##
==========================================
+ Coverage 92.91% 93.01% +0.09%
==========================================
Files 30 30
Lines 3079 3119 +40
Branches 572 579 +7
==========================================
+ Hits 2861 2901 +40
Misses 145 145
Partials 73 73 ☔ View full report in Codecov by Sentry. |
45ad823
to
bd54520
Compare
@nh13 In addition to the change you requested, I made three other notable changes
|
@@ -899,3 +900,14 @@ def __next__(self) -> Template: | |||
name = self._iter.peek().query_name | |||
recs = self._iter.takewhile(lambda r: r.query_name == name) | |||
return Template.build(recs, validate=False) | |||
|
|||
|
|||
class SamOrder(enum.Enum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having looked at this many months later, I wonder if this is too simplistic (see our Scala equivalent: https://github.com/fulcrumgenomics/fgbio/blob/ff1ca67772c34a8defeb835d692a53ad6e536f74/src/main/scala/com/fulcrumgenomics/bam/api/SamOrder.scala#L172). It doesn't allow custom sort orders, including setting group order, sub-sort, etc. I am fine with this for now, but changing this later will require breaking changes, so lets require @tfenne to weigh in too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would stop where we are - there's nothing here that would prevent us from doing something more sophisticated later.
* Add SamOrder enum consistent with SAM spec * Add _sort_order as private member of SamBuilder to avoid changes inconsistent with header * Update poetry environment for newer python Co-authored-by: Nathan Roach <nathan@fulcrumgenomics.com> Co-authored-by: Ted Brookings <ted@fulcrumgenomics.com>
bd54520
to
ae5b948
Compare
The support for
TemplateCoordinate
sorted records is coming in the first wave of wrappedpysam
samtools
dispatch calls.This should address #20.
This is also more or less identical to an addition made to samwell in a PR merged presumably after the sambuilder module code was pulled over from samwell to here.