-
Notifications
You must be signed in to change notification settings - Fork 405
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
Add cigar X/= #156
Add cigar X/= #156
Conversation
while (len > 0) { | ||
// match | ||
for (l = 0; l < len && qseq[qoff + l] == tseq[toff + l]; ++l) {} | ||
if (l > 0) p->cigar[m++] = 4 + (l<<4); |
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.
Obviously not for me to decide, but I would keep the cigar opcodes exactly the same as in the SAM/BAM spec.
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 defining the opcodes in the header (e.g. #define CIGAR_M 0
) and not hardcoding them would be very beneficial. If this is done consistently one can easily (and reliably) locate all the places where opcodes are used.
@lh3 typedef struct {
uint32_t op : 4;
uint32_t count : 28;
} cigar_t; which would obviate the need of explicit masking and shifting. |
@armintoepfer thanks for posting this and for taking it across the finish line! I figure at a minimum this behavior needs to be toggle-able via a command-line switch? And @ilya-kolpakov, I agree it should probably use the numerical conventions from the BAM spec ([MIDNSHPX=] is [012345678]). Please let me know if there are any suggestions on what needs to be done. |
Thanks a lot for this PR. Very straightforward and better than my initial plan. Merged via 154d2ca. I have only made some tiny changes. Option |
PS: I haven't carefully tested the feature, though. |
This is the patch I'm applying to convert
M
toX
/=
. It does not yet include the command-line toggle and ignores the python/js stack. It is also not well tested. Feel free to implement it your style or if it looks good, I can add the CLI toggle.See this PR as a base for discussions and not ready to merge.
Also cheers to @nlhepler who did the main work, long time ago.