Merge pull request #20 from broadinstitute/aw_reduceread_perf_1_GSA-761

Aw reduceread perf 1 gsa 761
This commit is contained in:
depristo 2013-02-07 12:11:05 -08:00
commit cd4aec177a
3 changed files with 6 additions and 11 deletions

View File

@ -60,10 +60,7 @@ public class BaseAndQualsCounts extends BaseCounts {
super();
this.sumInsertionQuals = new long[BaseIndex.values().length];
this.sumDeletionQuals = new long[BaseIndex.values().length];
for (final BaseIndex i : BaseIndex.values()) {
sumInsertionQuals[i.index] = 0L;
sumDeletionQuals[i.index] = 0L;
}
// Java primitive arrays comes zero-filled, so no need to do it explicitly.
}
public void incr(final byte base, final byte baseQual, final byte insQual, final byte delQual) {

View File

@ -69,10 +69,7 @@ import com.google.java.contract.Requires;
public BaseCounts() {
counts = new int[BaseIndex.values().length];
sumQuals = new long[BaseIndex.values().length];
for (final BaseIndex i : BaseIndex.values()) {
counts[i.index] = 0;
sumQuals[i.index] = 0L;
}
// Java primitive arrays comes zero-filled, so no need to do it explicitly.
}
public static BaseCounts createWithCounts(int[] countsACGT) {

View File

@ -627,9 +627,10 @@ public class ReduceReads extends ReadWalker<LinkedList<GATKSAMRecord>, ReduceRea
private void compressReadName(GATKSAMRecord read) {
String name = read.getReadName();
String compressedName = read.isReducedRead() ? "C" : "";
if (readNameHash.containsKey(name))
compressedName += readNameHash.get(name).toString();
else {
final Long readNumber = readNameHash.get(name);
if (readNumber != null) {
compressedName += readNumber.toString();
} else {
readNameHash.put(name, nextReadNumber);
compressedName += nextReadNumber.toString();
nextReadNumber++;