colorByFrame(cglyph, gSpan.getMin() + prev_add);
prev_add += 3 - (gSpan.getLength() % 3); //Keep a track of no of complete amino acid added.
cglyph.setCoords(gSpan.getMin(), 0, gSpan.getLength(), 20);
aGlyph.addChild(cglyph);
if (amino_acid != null) {
SequenceGlyph sg = new ColoredResiduesGlyph(false);
int start = prev_amino_end;
int end = start + gSpan.getLength();
String sub_amino_acid = amino_acid.substring(start, end);
prev_amino_end += gSpan.getLength();
sg.setResidues(sub_amino_acid);
sg.setCoords(gSpan.getMin(), 0, gSpan.getLength(), 20);
sg.setForegroundColor(col_amino_acid);
sg.setBackgroundColor(cglyph.getBackgroundColor());
aGlyph.addChild(sg);
}
}
}