-
Notifications
You must be signed in to change notification settings - Fork 308
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
[ADAM-785] Add support for all numeric array (TYPE=B) tags, fixes #785 #809
Conversation
- Extends `Attribute` model and `AttributeUtils.convertSAMTagAndValue` to cover the 7 numeric array types [cCsSiIf] described in SAM spec - Updates tests to use `TextTagCodec` used natively by samtools parser - Adds a small SAM file with all tag types and tests with loadAlignments
Test PASSed. |
val tagArrayString = attrTuple._3 | ||
val valueStr = attrTuple._4 | ||
|
||
val fullTagString = if (tagArrayString == null) tagTypeString else |
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.
Instead of checking for a null String
here, I would probably make tagArrayString
be Option[String]
and then change this line to be a fold:
val fullTagString = tagArrayString.fold(tagTypeString)(arrayString => "%s:%s".format(tagTypeString, arrayString))
Generally looks good to me, other than the small nit above. Thanks for the contribution @jfeala! |
Looks good to me, too. Thanks for the contribution, Jake. Appreciated. |
Thanks, guys. @fnothaft I updated that line, thanks for the suggestion. Let me know if you want me to squash the extra commit before merge |
Test PASSed. |
Ping for anyone else who wants to review; if no one else wants to review, I will merge this noon PST tomorrow. @jfeala no worries on squashing; I can take care of that when merging. |
👍 |
Thanks, @jfeala ! |
Merged manually after rebase. |
Please review carefully, I'm a Scala beginner! Advice welcome for better, more Scala-ish patterns
Attribute
model andAttributeUtils.convertSAMTagAndValue
to cover the 7 numeric array types [cCsSiIf] described in SAM specTextTagCodec
used natively by samtools parser