public static List < Range < Long > > mismatches ( final AlignmentPair alignmentPair ) { checkNotNull ( alignmentPair ) ; List < Range < Long > > mismatches = new ArrayList < Range < Long > > ( ) ; int mismatchStart = - 1 ; for ( int i = 1 , length = alignmentPair . length ( ) + 1 ; i < length ; i ++ ) { if ( isMismatchSymbol ( alignmentPair . symbolAt ( i ) ) ) { if ( mismatchStart < 0 ) { mismatchStart = i ; } } else { if ( mismatchStart > 0 ) { // biojava coordinates are 1-based mismatches . add ( Range . closedOpen ( Long . valueOf ( mismatchStart - 1L ) , Long . valueOf ( i - 1L ) ) ) ; mismatchStart = - 1 ; } } } if ( mismatchStart > 0 ) { mismatches . add ( Range . closedOpen ( Long . valueOf ( mismatchStart - 1L ) , Long . valueOf ( alignmentPair . length ( ) ) ) ) ; } return mismatches ; }
Return the alignment mismatches in the specified alignment pair as 0 - based [ closed open ) ranges .