more use of new ReadBackedPileup optimizations

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2187 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2009-11-30 20:04:01 +00:00
parent f5fe28cc28
commit add2fa7ab4
2 changed files with 9 additions and 10 deletions

View File

@ -3,6 +3,7 @@ package org.broadinstitute.sting.gatk.walkers.genotyper;
import net.sf.samtools.SAMRecord;
import org.broadinstitute.sting.utils.*;
import org.broadinstitute.sting.utils.pileup.ReadBackedPileup;
import org.broadinstitute.sting.utils.pileup.PileupElement;
import org.broadinstitute.sting.utils.genotype.DiploidGenotype;
import static java.lang.Math.log10;
@ -277,20 +278,18 @@ public class GenotypeLikelihoods implements Cloneable {
public int add(ReadBackedPileup pileup, boolean ignoreBadBases) {
int n = 0;
for (int i = 0; i < pileup.getReads().size(); i++) {
int offset = pileup.getOffsets().get(i);
for ( PileupElement p : pileup ) {
byte base = p.getBase();
// ignore deletions
if ( offset == -1 )
if ( base == PileupElement.DELETION_BASE )
continue;
SAMRecord read = pileup.getReads().get(i);
char base = (char)read.getReadBases()[offset];
byte qual = read.getBaseQualities()[offset];
if ( ! ignoreBadBases || ! badBase(base) ) {
n += add(base, qual, read, offset);
byte qual = p.getQual();
if ( ! ignoreBadBases || ! badBase((char)base) ) {
n += add((char)base, qual, p.getRead(), p.getOffset());
}
}
return n;
}

View File

@ -250,7 +250,7 @@ public class VCFGenotypeCall extends AlleleConstrainedGenotype implements ReadBa
* @return the number of reads we're backed by
*/
public int getReadCount() {
return (mCoverage > 0 ? mCoverage : (mPileup != null ? mPileup.getReads().size() : 0));
return (mCoverage > 0 ? mCoverage : (mPileup != null ? mPileup.size() : 0));
}
/**