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

added clipping #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

added clipping #21

wants to merge 2 commits into from

Conversation

lskatz
Copy link

@lskatz lskatz commented Jun 1, 2024

This is untested except that I know that there aren't syntax errors. Addresses #15

Adds --clip to remove any soft clipping and convert them to hard clipping

Examples (in theory):

  • 174M76S gets converted to 174M76H and 76bp gets trimmed
  • 174M10S10H gets converted to 174M20H and 10bp gets trimmed
  • 10S174M gets converted to 10H174M, 10bp gets trimmed, and the position changes by 10bp

Reply in the conversation if you tested it rigorously or at all.

@misshie
Copy link

misshie commented Oct 18, 2024

According to the SAM format specification, both "S" and "H" CIGAR operators are defined as "consumes reference == no." Therefore, the following two lines at the end of the clip function:

# update the position of the mapping according to how much we clipped from the left
$sam[SAM_POS] += $SL;

are likely unnecessary.

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.

2 participants