int mappingQuality) {
long windowSize = window.getWindowSize();
long windowStart = window.getStart();
SingleReadData readData = getWindowData(windowStart, analysisResults);
// working variables
boolean outOfBounds = false;
long relative;
int pos;
if(readEnd < readStart){
System.err.println("WARNING: read alignment start is greater than end: " + readStart + " > " + readEnd);
}
//readData.numberOfProcessedReads++;
if(readEnd> window.getEnd()){
outOfBounds = true;
//readData.numberOfOutOfBoundsReads++;
}
// run read
for(long j=readStart; j<=readEnd; j++){
relative = (int)(j - windowStart);
pos = (int)(j-readStart);
if(relative<0){
} else if(relative >= windowSize){
// System.err.println("WARNING: " + read.getReadName() + " is fuera del tiesto " + relative);
break;
} else {
if (analyzeRegions) {
boolean insideOfRegion = window.getSelectedRegions().get((int)relative);
if (insideOfRegion) {
if (computeOutsideStats) {
readData =getWindowData(windowStart, analysisResults);
//statsCollector = insideCollector;
}
} else {
if (computeOutsideStats) {
readData = getWindowData(windowStart, outOfRegionsResults);
//statsCollector = outsideCollector;
} else {
continue;
}
}
}
char nucleotide = alignment[pos];
// aligned bases
readData.numberOfMappedBases++;
if (nucleotide != '-' && nucleotide != 'N') {
// mapping quality
readData.acumMappingQuality(relative, mappingQuality);
// base stats
readData.acumBase(relative, nucleotide);
}
}