-
Notifications
You must be signed in to change notification settings - Fork 244
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
SAMUtils:getOtherCanonicalAlignments extract 'SA' tag and return a list of supplementary alignments #685
Conversation
@jamesemery could you please review? |
(commaStrs[2].equals("+") ? 0 : SAMFlag.READ_REVERSE_STRAND.flag) ); | ||
otherRec.setCigar( TextCigarCodec.decode( commaStrs[3] ) ); | ||
otherRec.setMappingQuality( Integer.parseInt(commaStrs[4]) ); | ||
otherRec.setAttribute( SAMTagUtil.getSingleton().NM , Integer.parseInt(commaStrs[5]) ); |
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.
All of these .parseInt() calls open the possibility of breaking on bad input and exposing a stack trace to the user. Perhaps you should emit a SAMException if any of these fields don't parse correctly?
Thank you for the review and back to you @jamesemery
NB: I'll be away from github for a few days. |
@droazen These changes look good to me |
Thanks @lindenb and @jamesemery |
Description
I've added a new function
getOtherCanonicalAlignments
in SAMUtils. This function is used to extract the 'SA' tag of a SAMRecord as aList<SAMRecord>
of supplementary alignements.testOtherCanonicalAlignments
was added to SAMUtilsTest ( create one read with SA flag, check the values of the supplementary alignments)PS: The SA tag is defined in the spec as
Checklist