public static boolean bisulfiteBasesEqual(final byte read, final byte reference) { return bisulfiteBasesEqual(false, read, reference); }
public static boolean bisulfiteBasesEqual(final byte read, final byte reference) { return bisulfiteBasesEqual(false, read, reference); }
public static boolean bisulfiteBasesEqual(final byte read, final byte reference) { return bisulfiteBasesEqual(false, read, reference); }
/** * True if there's a C in the reference as well as read (possibly bisulfite converted) */ private boolean isC(final byte refBase, final byte readBase) { return (SequenceUtil.basesEqual(refBase, SequenceUtil.C) && SequenceUtil.bisulfiteBasesEqual(readBase, refBase)); }
/** * True if there's a C in the reference as well as read (possibly bisulfite converted) */ private boolean isC(final byte refBase, final byte readBase) { return (SequenceUtil.basesEqual(refBase, SequenceUtil.C) && SequenceUtil.bisulfiteBasesEqual(readBase, refBase)); }
/** * Helper method to handle the various use cases of base comparison. * * @param readBase the read base to match * @param refBase the reference base to match * @param negativeStrand set to true if the base to test is on the negative strand and should be reverse complemented (only applies if bisulfiteSequence is true) * @param bisulfiteSequence set to true if the base to match is a bisulfite sequence and needs to be converted * @param matchAmbiguousRef causes the match to return true when the read base is a subset of the possible IUPAC reference bases, but not the other way around * @return true if the bases match, false otherwise */ private static boolean basesMatch(final byte readBase, final byte refBase, final boolean negativeStrand, final boolean bisulfiteSequence, final boolean matchAmbiguousRef) { if (bisulfiteSequence) { if (matchAmbiguousRef) return bisulfiteBasesMatchWithAmbiguity(negativeStrand, readBase, refBase); else return bisulfiteBasesEqual(negativeStrand, readBase, refBase); } else { if (matchAmbiguousRef) return readBaseMatchesRefBaseWithAmbiguity(readBase, refBase); else return basesEqual(readBase, refBase); } }
/** * Helper method to handle the various use cases of base comparison. * * @param readBase the read base to match * @param refBase the reference base to match * @param negativeStrand set to true if the base to test is on the negative strand and should be reverse complemented (only applies if bisulfiteSequence is true) * @param bisulfiteSequence set to true if the base to match is a bisulfite sequence and needs to be converted * @param matchAmbiguousRef causes the match to return true when the read base is a subset of the possible IUPAC reference bases, but not the other way around * @return true if the bases match, false otherwise */ private static boolean basesMatch(final byte readBase, final byte refBase, final boolean negativeStrand, final boolean bisulfiteSequence, final boolean matchAmbiguousRef) { if (bisulfiteSequence) { if (matchAmbiguousRef) return bisulfiteBasesMatchWithAmbiguity(negativeStrand, readBase, refBase); else return bisulfiteBasesEqual(negativeStrand, readBase, refBase); } else { if (matchAmbiguousRef) return readBaseMatchesRefBaseWithAmbiguity(readBase, refBase); else return basesEqual(readBase, refBase); } }
if (!bisulfiteBasesEqual(read.getReadNegativeStrandFlag(), readBases[readBlockStart+i], referenceBases[referenceBlockStart+i])) { qualities += readQualities[readBlockStart+i];
if (!bisulfiteBasesEqual(read.getReadNegativeStrandFlag(), readBases[readBlockStart + i], referenceBases[referenceBlockStart + i])) { qualities += readQualities[readBlockStart + i];
if (!bisulfiteBasesEqual(read.getReadNegativeStrandFlag(), readBases[readBlockStart + i], referenceBases[referenceBlockStart + i])) { qualities += readQualities[readBlockStart + i];
if (!bisulfiteBasesEqual(read.getReadNegativeStrandFlag(), readBases[readBlockStart+i], referenceBases[referenceBlockStart+i])) { ++mismatches;
SequenceUtil.bisulfiteBasesEqual(false, readFragment[i+1], refFragment[i+1])) {
SequenceUtil.bisulfiteBasesEqual(false, readFragment[i+1], refFragment[i+1])) {
final int readBaseIndex = readIndex + i; boolean mismatch = !SequenceUtil.basesEqual(readBases[readBaseIndex], refBases[refIndex + i]); final boolean bisulfiteMatch = isBisulfiteSequenced && SequenceUtil.bisulfiteBasesEqual(record.getReadNegativeStrandFlag(), readBases[readBaseIndex], refBases[readBaseIndex]);
final int readBaseIndex = readIndex + i; boolean mismatch = !SequenceUtil.basesEqual(readBases[readBaseIndex], refBases[refIndex + i]); final boolean bisulfiteMatch = isBisulfiteSequenced && SequenceUtil.bisulfiteBasesEqual(record.getReadNegativeStrandFlag(), readBases[readBaseIndex], refBases[readBaseIndex]);