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

Verify: Correct read slice coords for negative strand alignments #4

Closed
Adamtaranto opened this issue Sep 10, 2018 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@Adamtaranto
Copy link
Owner

May need to have isClipMotif() function check if the current alignment is on the negative strand before extracting sequence for motif search.

Assumptions:

  • Align coords are reported in fwd orientation from leftmost ref position.
  • CIGAR coords are reported for ref fwd orientation (left to right on ref)
  • Read string is not altered from raw read (may be reversed relative to CIGAR coords)

If above are true, then 3' overhang seq for 1000M500S should be retrieved as:

  • If forward alignment: Seq[-500:]
  • If reverse alignment: Seq[0:500]

and for a 5' alignment 500S1000M:

  • If forward alignment: Seq[0:500]
  • If reverse alignment: Seq[-500:]

Note: If printing overhang sequence to a summary file we should RC the extracted OH for neg strand alignments.

@Adamtaranto Adamtaranto added the bug Something isn't working label Sep 10, 2018
@Adamtaranto Adamtaranto self-assigned this Sep 10, 2018
@Adamtaranto
Copy link
Owner Author

Check sam flag for rev status:

# Set Rev flag
$ SAM_FLAG = 16

# Test with hex 0x10 
$ bool(SAM_FLAG & 0x10)

$ TRUE

For other flag codes see flags explained.

@Adamtaranto
Copy link
Owner Author

Closing. Non-issue. Turns out both bwa and minimap2 already RC the read when reporting a neg strand alignment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant