Map<Character, Color> nucleotideColors = SequenceRenderer.getNucleotideColors();
for (int idx = 0; idx < scores.size(); idx++) {
LocusScore score = scores.get(idx);
int startPosition = score.getStart();
int endPosition = score.getEnd();
int pX = (int) (rect.getX() + (startPosition - context.getOrigin()) / context.getScale());
int dX = Math.max(1,
(int) (rect.getX() + (endPosition - context.getOrigin()) / context.getScale()) - pX);
if (dX > 4) {
dX -= 2;
pX++;
}
if (pX + dX < 0) {
continue;
} else if (pX > context.getVisibleRect().getMaxX()) {
break;
}
float totalCount = score.getScore();
int pY = (int) rect.getMaxY() - 1;
float dataMax = getDataRange().getMaximum();
double height = (totalCount * rect.getHeight() / dataMax);
height = Math.min(height, rect.height - 1);
for (char c : nucleotides) {
try {
LocusScore ns = nScores.get(c).get(idx);
float count = ns.getScore() * totalCount;
//pY = drawBar(context, idx, rect, dataMax, pY, pX, dX, c, count);
Graphics2D tGraphics = context.getGraphic2DForColor(nucleotideColors.get(c));
int h = (int) Math.round(count * height / totalCount);