// init window set
windowSize = computeWindowSize(referenceSize,numberOfWindows);
//effectiveNumberOfWindows = computeEffectiveNumberOfWindows(referenceSize,windowSize);
List<Long> windowPositions = computeWindowPositions(windowSize);
effectiveNumberOfWindows = windowPositions.size();
bamStats = new BamStats("genome", locator, referenceSize,effectiveNumberOfWindows);
logger.println("Number of windows: " + numberOfWindows +
", effective number of windows: " + effectiveNumberOfWindows);
logger.println("Chunk of reads size: " + numReadsInBunch);
logger.println("Number of threads: " + threadNumber);
bamStats.setSourceFile(bamFile);
//bamStats.setWindowReferences("w",windowSize);
bamStats.setWindowReferences("w", windowPositions);
bamStatsCollector = new BamStatsCollector();
openWindows = new ConcurrentHashMap<Long,BamGenomeWindow>();
if (saveCoverage) {
bamStats.activateCoverageReporting(pathToCoverageReport, nonZeroCoverageOnly);
}
//regions
if(selectedRegionsAvailable){
// load selected regions
loadSelectedRegions();
outsideBamStatsCollector = new BamStatsCollector();
// outside of regions stats
if (computeOutsideStats) {
outsideBamStats = new BamStats("outside", locator, referenceSize, effectiveNumberOfWindows);
outsideBamStats.setSourceFile(bamFile);
outsideBamStats.setWindowReferences("out_w", windowPositions);
openOutsideWindows = new HashMap<Long,BamGenomeWindow>();
currentOutsideWindow = nextWindow(outsideBamStats,openOutsideWindows,reference,true);