reverting last changes. no cacheing

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2526 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
asivache 2010-01-06 18:59:37 +00:00
parent a17d725c35
commit eb899741e1
1 changed files with 7 additions and 13 deletions

View File

@ -20,9 +20,7 @@ import net.sf.samtools.SAMRecord;
public class ReadBackedPileup implements Iterable<PileupElement> { public class ReadBackedPileup implements Iterable<PileupElement> {
private GenomeLoc loc = null; private GenomeLoc loc = null;
private ArrayList<PileupElement> pileup = null; private ArrayList<PileupElement> pileup = null;
byte [] bases = null; // will be used to cache pileup bases after first call to getBases
byte [] mapquals = null; // will be used to cache pileup mapping quals after first call to getMappingQuals
private int size = 0; // cached value of the size of the pileup private int size = 0; // cached value of the size of the pileup
private int nDeletions = 0; // cached value of the number of deletions private int nDeletions = 0; // cached value of the number of deletions
private int nMQ0Reads = 0; // cached value of the number of MQ0 reads private int nMQ0Reads = 0; // cached value of the number of MQ0 reads
@ -397,11 +395,9 @@ public class ReadBackedPileup implements Iterable<PileupElement> {
* @return * @return
*/ */
public byte[] getBases() { public byte[] getBases() {
if ( bases == null ) { byte[] v = new byte[size()];
bases = new byte[size()]; for ( ExtendedPileupElement pile : this.extendedForeachIterator() ) { v[pile.getPileupOffset()] = pile.getBase(); }
for ( ExtendedPileupElement pile : this.extendedForeachIterator() ) { bases[pile.getPileupOffset()] = pile.getBase(); } return v;
}
return bases;
} }
/** /**
@ -429,11 +425,9 @@ public class ReadBackedPileup implements Iterable<PileupElement> {
* @return * @return
*/ */
public byte[] getMappingQuals() { public byte[] getMappingQuals() {
if ( mapquals == null ) { byte[] v = new byte[size()];
mapquals = new byte[size()]; for ( ExtendedPileupElement pile : this.extendedForeachIterator() ) { v[pile.getPileupOffset()] = (byte)pile.getRead().getMappingQuality(); }
for ( ExtendedPileupElement pile : this.extendedForeachIterator() ) { mapquals[pile.getPileupOffset()] = (byte)pile.getRead().getMappingQuality(); } return v;
}
return mapquals;
} }