Skip to content
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

feat: remove pysam and bwa warmup hack #65

Merged
merged 5 commits into from
Oct 4, 2024
Merged

Conversation

clintval
Copy link
Member

@clintval clintval commented Oct 4, 2024

It is mentioned pysam.AlignmentFile internally buffers stdin so a hack was devised to "warm it up".

However, fgpyo.sam.reader and pysam.AlignmentFile are not needed and only provide code indirection since we can build the SAM header and all subsequent records using the from_text()/fromstring() methods of each.

Comment on lines -416 to -418
def close(self) -> None:
self._reader.close()
super().close()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although we no longer need to override this method, it should have conformed to the same shape as the superclass:

def close(self) -> bool:
    self._reader.close()
    return super().close()

@@ -33,7 +33,7 @@
>>> bwa.map_all(queries=[query])
[BwaResult(query=Query(id='NA', bases='AAAAAA'), hit_count=3968, hits=[])]
>>> bwa.close()

True
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.

Project coverage is 97.25%. Comparing base (5515d05) to head (80ea938).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
prymer/offtarget/bwa.py 84.61% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #65      +/-   ##
==========================================
- Coverage   97.38%   97.25%   -0.13%     
==========================================
  Files          25       25              
  Lines        1605     1603       -2     
  Branches      302      303       +1     
==========================================
- Hits         1563     1559       -4     
  Misses         23       23              
- Partials       19       21       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

prymer/offtarget/bwa.py Show resolved Hide resolved
prymer/offtarget/bwa.py Show resolved Hide resolved
@clintval clintval force-pushed the feat/remove_bwa_warmup_hack branch from 8d4f9d6 to dbcd145 Compare October 4, 2024 16:56
tests/offtarget/test_bwa.py Outdated Show resolved Hide resolved
@clintval clintval requested a review from tfenne October 4, 2024 16:59
@clintval
Copy link
Member Author

clintval commented Oct 4, 2024

I have one strangely failing test on GitHub CI (but not locally):

FAILED tests/offtarget/test_bwa.py::test_header_is_properly_constructed - AssertionError: assert {'PG', 'SQ'} == {'HD', 'PG', 'SQ'}
  Extra items in the right set:
  'HD'
  Full diff:
  - {'HD', 'PG', 'SQ'}
  ?  ------
  + {'PG', 'SQ'}

Will debug...

EDIT: the issue is we were using the old bwa repo in FG's org.

@tfenne tfenne assigned clintval and unassigned tfenne Oct 4, 2024
@clintval clintval merged commit a132a52 into main Oct 4, 2024
4 of 6 checks passed
@clintval clintval deleted the feat/remove_bwa_warmup_hack branch October 4, 2024 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants