public int[][] ChrInt(int[] SNPIdx) { int[][] chrint = new int[SNPIdx.length][2]; int c = 0; int idx = 0; for (int i = 0; i < ap.ChromosomeNumber(); i++) { for (int j = 0; j < ap.IntervalNumberAtChromosome(i); j++) { if (c == SNPIdx[idx]) { chrint[idx][0] = i; chrint[idx][1] = j; idx++; if (idx == SNPIdx.length) { break; } } c++; } if (idx == SNPIdx.length) { break; } } return chrint; }