-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: Check against HN
tag instead of is_unmapped
property
#69
base: main
Are you sure you want to change the base?
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.
I think there needs to be a further change here, or at least a clear explanation/justification of why not. I think when the record is marked as unmapped
, what that really means is that bwa
believes the primary alignment to be erroneous - and as such I think to_hits() should ignore the primary alignment and only decode the secondary alignments.
WalkthroughThe changes in the pull request primarily focus on the Assessment against linked issues
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
prymer/offtarget/bwa.py (1)
159-162
: Remove unnecessary whitespace in docstring blank lineThe blank line at line 161 contains whitespace. Please remove the extra whitespace to adhere to PEP 8 style guidelines.
🧰 Tools
🪛 Ruff
161-161: Blank line contains whitespace
Remove whitespace from blank line
(W293)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- prymer/offtarget/bwa.py (4 hunks)
🧰 Additional context used
🪛 Ruff
prymer/offtarget/bwa.py
161-161: Blank line contains whitespace
Remove whitespace from blank line
(W293)
🔇 Additional comments (2)
prymer/offtarget/bwa.py (2)
363-373
: Logic for adjusting hit counts is correctThe updated logic in lines 363-373 appropriately adjusts
num_hits
andhits
, ensuring that theBwaResult
accurately reflects the total number of hits even when the number of hits exceedsmax_hits
.
418-422
: Correctly filter out hits that extend beyond contig boundariesThe added filtering in lines 418-422 effectively removes artifacts from
bwa aln
's alignment process by excluding hits that extend beyond the end of a contig, enhancing the accuracy of the results.
Co-authored-by: Tim Fennell <[email protected]>
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
prymer/offtarget/bwa.py (1)
161-161
: Remove whitespace on blank lineThere's trailing whitespace on the blank line at line 161. This can lead to style inconsistencies.
Apply this diff to remove the whitespace:
- +🧰 Tools
🪛 Ruff
161-161: Blank line contains whitespace
Remove whitespace from blank line
(W293)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
- .github/workflows/tests.yml (0 hunks)
- prymer/offtarget/bwa.py (4 hunks)
💤 Files with no reviewable changes (1)
- .github/workflows/tests.yml
🧰 Additional context used
🪛 Ruff
prymer/offtarget/bwa.py
161-161: Blank line contains whitespace
Remove whitespace from blank line
(W293)
🔇 Additional comments (2)
prymer/offtarget/bwa.py (2)
363-376
: Logic correctly utilizesHN
tag for hit countThe updated logic appropriately uses the
HN
tag to determine the number of hits, aligning with the PR objectives. It correctly handles cases where the number of hits is zero, between zero andself.max_hits
, and greater than or equal toself.max_hits
.
421-424
: Properly filters out hits spanning contig boundariesThe addition ensures that hits extending beyond the end of a contig are removed, addressing artifacts from
bwa aln
's alignment process. This enhances the accuracy of the returned hits.
Closes #68
bwa aln
produces inconsistent behavior when recording the mapped status of multiply mapping reads. In most cases, such reads are flagged as mapped with a mapq of 0. However, we have discovered some cases where these reads are flagged as unmapped.prymer
currently relies on the unmapped flag to identify reads with a hit count of zero. This has been yielding errors when attempting to parse reads in the latter category. This information can instead be obtained directly from theHN
tag.