Changed the intensities array order from cycle,channel to channel,cycle. This, I'm told, is a far more efficient allocation strategy.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1084 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
kiran 2009-06-24 15:41:06 +00:00
parent 3112302ec9
commit 7b5d8d7604
2 changed files with 19 additions and 9 deletions

View File

@ -98,7 +98,8 @@ public class BasecallingReadModel {
double[] fourIntensity = new double[4]; double[] fourIntensity = new double[4];
for (int channel = 0; channel < 4; channel++) { for (int channel = 0; channel < 4; channel++) {
fourIntensity[channel] = (double) ints[cycle][channel]; //fourIntensity[channel] = (double) ints[cycle][channel];
fourIntensity[channel] = (double) ints[channel][cycle];
} }
basemodels[cycle].addMeanPoint(probMatrix, fourIntensity); basemodels[cycle].addMeanPoint(probMatrix, fourIntensity);
@ -135,7 +136,8 @@ public class BasecallingReadModel {
double[] fourIntensity = new double[4]; double[] fourIntensity = new double[4];
for (int channel = 0; channel < 4; channel++) { for (int channel = 0; channel < 4; channel++) {
fourIntensity[channel] = (double) ints[cycle][channel]; //fourIntensity[channel] = (double) ints[cycle][channel];
fourIntensity[channel] = (double) ints[channel][cycle];
} }
basemodels[cycle].addCovariancePoint(probMatrix, fourIntensity); basemodels[cycle].addCovariancePoint(probMatrix, fourIntensity);
@ -207,7 +209,8 @@ public class BasecallingReadModel {
double[] fourIntensity = new double[4]; double[] fourIntensity = new double[4];
for (int channel = 0; channel < 4; channel++) { for (int channel = 0; channel < 4; channel++) {
fourIntensity[channel] = (double) read.getIntensities()[cycle][channel]; //fourIntensity[channel] = (double) read.getIntensities()[cycle][channel];
fourIntensity[channel] = (double) read.getIntensities()[channel][cycle];
} }
fpr.add(cycle, computeProbabilities(cycle, basePrev, qualPrev, fourIntensity)); fpr.add(cycle, computeProbabilities(cycle, basePrev, qualPrev, fourIntensity));

View File

@ -58,7 +58,8 @@ public class RawRead implements Comparable<RawRead> {
sequence = pastedReadString[1][4].substring(cycleBegin, cycleEnd + 1).getBytes(); sequence = pastedReadString[1][4].substring(cycleBegin, cycleEnd + 1).getBytes();
quals = new byte[sequence.length]; quals = new byte[sequence.length];
intensities = new short[sequence.length][4]; //intensities = new short[sequence.length][4];
intensities = new short[4][sequence.length];
for (int cycle = cycleBegin, offset = 0; cycle <= cycleEnd; cycle++, offset++) { for (int cycle = cycleBegin, offset = 0; cycle <= cycleEnd; cycle++, offset++) {
byte maxQual = -50; byte maxQual = -50;
@ -75,7 +76,8 @@ public class RawRead implements Comparable<RawRead> {
double doubleChannelIntensity = Double.valueOf(pastedReadString[0][fullReadIndex]); double doubleChannelIntensity = Double.valueOf(pastedReadString[0][fullReadIndex]);
short shortChannelIntensity = (short) doubleChannelIntensity; short shortChannelIntensity = (short) doubleChannelIntensity;
intensities[offset][channel] = shortChannelIntensity; //intensities[offset][channel] = shortChannelIntensity;
intensities[channel][offset] = shortChannelIntensity;
} }
} }
} }
@ -181,14 +183,14 @@ public class RawRead implements Comparable<RawRead> {
/** /**
* Get the raw read intensities. * Get the raw read intensities.
* *
* @return the (readLength)x(numChannels) array of raw intensities * @return the (numChannels)x(readLength) array of raw intensities
*/ */
public short[][] getIntensities() { return intensities; } public short[][] getIntensities() { return intensities; }
/** /**
* Set the raw intensities. * Set the raw intensities.
* *
* @param intensities the (readLength)x(numChannels) array of raw intensities * @param intensities the (numChannels)x(readLength) array of raw intensities
*/ */
public void setIntensities(short[][] intensities) { this.intensities = intensities; } public void setIntensities(short[][] intensities) { this.intensities = intensities; }
@ -239,12 +241,17 @@ public class RawRead implements Comparable<RawRead> {
byte[] newSequence = new byte[cycleStop - cycleStart + 1]; byte[] newSequence = new byte[cycleStop - cycleStart + 1];
byte[] newQuals = new byte[cycleStop - cycleStart + 1]; byte[] newQuals = new byte[cycleStop - cycleStart + 1];
short[][] newIntensities = new short[cycleStop - cycleStart + 1][4]; //short[][] newIntensities = new short[cycleStop - cycleStart + 1][4];
short[][] newIntensities = new short[4][cycleStop - cycleStart + 1];
for (int cycle = cycleStart, offset = 0; cycle <= cycleStop; cycle++, offset++) { for (int cycle = cycleStart, offset = 0; cycle <= cycleStop; cycle++, offset++) {
newSequence[offset] = sequence[cycle]; newSequence[offset] = sequence[cycle];
newQuals[offset] = quals[cycle]; newQuals[offset] = quals[cycle];
newIntensities[offset] = intensities[cycle]; //newIntensities[offset] = intensities[cycle];
for (int channel = 0; channel < 4; channel++) {
newIntensities[channel][offset] = intensities[channel][cycle];
}
} }
subRead.setSequence(newSequence); subRead.setSequence(newSequence);