private List<LocusScore> getLocusScoresForChr(String chr, int startLocation, int endLocation, int zoom) { List<LocusScore> scores; int chrLength = getChrLength(chr); if (chrLength == 0) { scores = Collections.emptyList(); } else { endLocation = Math.min(endLocation, chrLength); // By definition there are 2^z tiles per chromosome, and 700 bins per tile, where z is the zoom level. // By definition there are 2^z tiles per chromosome, and 700 bins per tile, where z is the zoom level. //int maxZoom = (int) (Math.log(chrLength / 700) / Globals.log2) + 1; //int z = Math.min(zReq, maxZoom); int nTiles = (int) Math.pow(2, zoom); double binSize = Math.max(1, (((double) chrLength) / nTiles) / 700); scores = computeSummaryScores(chr, startLocation, endLocation, binSize); } return scores; }