diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/CovariateCounterWalker.java b/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/CovariateCounterWalker.java index 983b77303..42bd8af9c 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/CovariateCounterWalker.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/recalibration/CovariateCounterWalker.java @@ -301,7 +301,7 @@ public class CovariateCounterWalker extends LocusWalker { refBase = ref.getBase(); // Skip if this base is an 'N' or etc. - if( BaseUtils.isRegularBase( (char)(bases[offset]) ) ) { + if( BaseUtils.isRegularBase( bases[offset] ) ) { // SOLID bams have inserted the reference base into the read if the color space in inconsistent with the read base so skip it if( !gatkRead.getReadGroup().getPlatform().toUpperCase().contains("SOLID") || RAC.SOLID_RECAL_MODE.equalsIgnoreCase("DO_NOTHING") || !RecalDataManager.isInconsistentColorSpace( gatkRead, offset ) ) { @@ -310,7 +310,7 @@ public class CovariateCounterWalker extends LocusWalker { updateDataFromRead( gatkRead, offset, refBase ); } else { // calculate SOLID reference insertion rate - if( refBase == (char)bases[offset] ) { + if( refBase == bases[offset] ) { solidInsertedReferenceBases++; } else { otherColorSpaceInconsistency++; diff --git a/java/src/org/broadinstitute/sting/utils/sam/AlignmentUtils.java b/java/src/org/broadinstitute/sting/utils/sam/AlignmentUtils.java index 4c6932668..3b4154549 100644 --- a/java/src/org/broadinstitute/sting/utils/sam/AlignmentUtils.java +++ b/java/src/org/broadinstitute/sting/utils/sam/AlignmentUtils.java @@ -64,6 +64,7 @@ public class AlignmentUtils { return getMismatchCount(r, refSeq, refIndex).numMismatches; } + @Deprecated public static int numMismatches(SAMRecord r, String refSeq, int refIndex ) { if ( r.getReadUnmappedFlag() ) return 1000000; return numMismatches(r, StringUtil.stringToBytes(refSeq), refIndex); @@ -73,11 +74,14 @@ public class AlignmentUtils { return getMismatchCount(r, refSeq, refIndex).mismatchQualities; } + @Deprecated public static long mismatchingQualities(SAMRecord r, String refSeq, int refIndex ) { if ( r.getReadUnmappedFlag() ) return 1000000; return numMismatches(r, StringUtil.stringToBytes(refSeq), refIndex); } + // todo -- this code and mismatchesInRefWindow should be combined and optimized into a single + // todo -- high performance implementation. We can do a lot better than this right now private static MismatchCount getMismatchCount(SAMRecord r, byte[] refSeq, int refIndex) { MismatchCount mc = new MismatchCount(); @@ -188,9 +192,12 @@ public class AlignmentUtils { if ( ignoreTargetSite && ref.getLocus().getStart() == currentPos ) continue; - char readChr = (char)readBases[readIndex]; - if ( Character.toUpperCase(readChr) != Character.toUpperCase(refChr) ) + byte readChr = readBases[readIndex]; + if ( readChr != refChr ) sum += (qualitySumInsteadOfMismatchCount) ? readQualities[readIndex] : 1; +// char readChr = (char)readBases[readIndex]; +// if ( Character.toUpperCase(readChr) != Character.toUpperCase(refChr) ) +// sum += (qualitySumInsteadOfMismatchCount) ? readQualities[readIndex] : 1; } break; case I: