Skip to content

Commit

Permalink
support P operator parsing in md tag
Browse files Browse the repository at this point in the history
  • Loading branch information
arahuja committed Oct 31, 2015
1 parent 5175c2f commit bc38a1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,8 @@ object MdTag {
cigarIdx += 1
cigarOperatorIndex = 0

case (CigarOperator.INSERTION | CigarOperator.H | CigarOperator.S, _) =>
case (CigarOperator.INSERTION | CigarOperator.H | CigarOperator.S | CigarOperator.P, _) =>
cigarIdx += 1

}
}
new MdTag(referenceStart, matches, mismatches, deletions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@ class MdTagSuite extends FunSuite {
assert(tag.toString === "20")
}

test("CIGAR with P operators") {
val tag = MdTag("8", 0L, TextCigarCodec.decode("4=1P4="))
assert(tag.toString === "8")
(0 until 8).foreach(locus => assert(tag.isMatch(locus)))

}

test("Get correct matches for mdtag with insertion") {
val tag = MdTag("10", 0L, TextCigarCodec.decode("5M3I5M"))
assert(tag.end === 9)
Expand Down

0 comments on commit bc38a1c

Please sign in to comment.