Skip to content

Commit d5e8d64

Browse files
committed
Fixed Pearson's bug
1 parent 6e5f245 commit d5e8d64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/org/broad/igv/hic/data/MatrixZoomData.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public BasicMatrix computePearsons(DensityFunction df) {
286286
int size = oe.getRowDimension();
287287
int num = 0;
288288
for (int i = 0; i < size; i++) {
289-
if (i == nonCentromereColumns[num]) {
289+
if (num < nonCentromereColumns.length && i == nonCentromereColumns[num]) {
290290
RealVector v = oe.getRowVector(i);
291291
double m = getVectorMean(v);
292292
RealVector newV = v.mapSubtract(m);
@@ -299,7 +299,7 @@ public BasicMatrix computePearsons(DensityFunction df) {
299299
RealVector v = new ArrayRealVector(size);
300300
num = 0;
301301
for (int i = 0; i < size; i++) {
302-
if (i != nonCentromereColumns[num]) {
302+
if (num < nonCentromereColumns.length && i != nonCentromereColumns[num]) {
303303
rm.setRowVector(i, v);
304304
rm.setColumnVector(i, v);
305305
} else num++;

0 commit comments

Comments
 (0)