@@ -139,23 +139,25 @@ private List<SummaryTile> getSummaryTilesForRange(String chr, int startLocation,
139
139
}
140
140
endLocation = Math .min (endLocation , chrLength );
141
141
142
- // By definition there are 2^z tiles per chromosome, and 700 bins per tile, where z is the zoom level.
143
- //int maxZoom = (int) (Math.log(chrLength/700) / Globals.log2) + 1;
144
- //int z = Math.min(zReq, maxZoom);
145
- int z = zReq ;
146
- int nTiles = (int ) Math .pow (2 , z );
147
- //double binSize = Math.max(1, (((double) chrLength) / nTiles) / 700);
148
-
149
142
150
143
int adjustedStart = Math .max (0 , startLocation );
151
144
int adjustedEnd = Math .min (chrLength , endLocation );
152
145
153
146
154
147
if (cacheSummaryTiles && !FrameManager .isGeneListMode () && !FrameManager .isExomeMode ()) {
155
- double tileWidth = ((double ) chrLength ) / nTiles ;
148
+
149
+ // By definition there are 2^z tiles per chromosome, and 700 bins per tile, where z is the zoom level.
150
+ //int maxZoom = (int) (Math.log(chrLength/700) / Globals.log2) + 1;
151
+ //int z = Math.min(zReq, maxZoom);
152
+ int z = zReq ;
153
+ int virtualTileCount = (int ) Math .pow (2 , z );
154
+
155
+ double tileWidth = ((double ) chrLength ) / virtualTileCount ;
156
156
int startTile = (int ) (adjustedStart / tileWidth );
157
157
int endTile = (int ) (Math .min (chrLength , adjustedEnd ) / tileWidth ) + 1 ;
158
- List <SummaryTile > tiles = new ArrayList (nTiles );
158
+ List <SummaryTile > tiles = null ;
159
+
160
+ tiles = new ArrayList (endTile - startTile + 1 );
159
161
for (int t = startTile ; t <= endTile ; t ++) {
160
162
int tileStart = (int ) (t * tileWidth );
161
163
int tileEnd = Math .min (chrLength , (int ) ((t + 1 ) * tileWidth ));
@@ -310,11 +312,11 @@ SummaryTile computeSummaryTile(String chr, int tileNumber, int startLocation, in
310
312
private LocusScore getCompositeScore (Accumulator accumulator , int accumulatedStart , int accumulatedEnd ) {
311
313
LocusScore ls ;
312
314
if (accumulator .getNpts () == 1 ) {
313
- ls = new NamedScore (accumulatedStart , accumulatedEnd , accumulator .getData ()[0 ], accumulator .getNames ()[0 ]);
315
+ ls = new NamedScore (accumulatedStart , accumulatedEnd , accumulator .getRepData ()[0 ], accumulator .getRepProbes ()[0 ]);
314
316
} else {
315
317
float value = accumulator .getValue ();
316
- ls = new CompositeScore (accumulatedStart , accumulatedEnd , value , accumulator .getData (),
317
- accumulator .getNames (), windowFunction );
318
+ ls = new CompositeScore (accumulatedStart , accumulatedEnd , value , accumulator .getRepData (),
319
+ accumulator .getRepProbes (), windowFunction );
318
320
}
319
321
return ls ;
320
322
0 commit comments