Skip to content

Commit

Permalink
Fix a bug in Cigar class
Browse files Browse the repository at this point in the history
  • Loading branch information
Kari Stromhaug committed Apr 29, 2022
1 parent 4b70dbb commit c81cca1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/scala/com/fulcrumgenomics/vcf/AssessPhasing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ private[vcf] object PhaseCigar {
assumeFixedAlleleOrder: Boolean = false): PhaseCigar = {
val iter = pairedIterator.filter {
// ensure the alleles are the same when both truth and call are called
case ((Some(t: VCtx), Some(c: VCtx))) =>
case (Some(t: VCtx), Some(c: VCtx)) =>
!skipMismatchingAlleles || t.alleles.toSet == c.alleles.toSet
case _ => true
}.flatMap { case (t, c) => // collect metrics but only keep sites where either variant (i.e. truth or call) is phased.
Expand Down Expand Up @@ -793,8 +793,8 @@ private[vcf] object PhaseCigar {
* [[Mismatch]] otherwise.
*/
private[vcf] def cigarTypeForVariantContexts(truth: Variant, call: Variant): PhaseCigarOp = {
val truthAlleles = truth.gts.next().alleles.toSeq
val calledAlleles = call.gts.next().alleles.toSeq
val truthAlleles = truth.gts.next().calls.toSeq
val calledAlleles = call.gts.next().calls.toSeq
require(truthAlleles.length == calledAlleles.length)
require(truthAlleles.length == 2)
if (truthAlleles.head != calledAlleles.head || truthAlleles.last != calledAlleles.last) PhaseCigarOp.Mismatch
Expand Down

0 comments on commit c81cca1

Please sign in to comment.