{
for (int i = 0; i < aa.length; i++)
{
+ if (aa[i]==null)
+ {
+ System.err.println("Null annotation row: ignoring.");
+ continue;
+ }
if (!aa[i].visible)
{
continue;
}
this.setPreferredSize(new Dimension(1, height));
- ap.alabels.validate();
+ if (ap!=null)
+ {
+ // revalidate only when the alignment panel is fully constructed
+ ap.validate();
+ }
return height;
}
int column;
int aaMax = aa.annotations.length - 1;
-
+ boolean renderHistogram = true, renderProfile = true;
+ if (aa.autoCalculated && aa.label.startsWith("Consensus")) {
+ // TODO: generalise this to have render styles for consensus/profile data
+ if (aa.groupRef!=null)
+ {
+ renderHistogram = aa.groupRef.isShowConsensusHistogram();
+ renderProfile = aa.groupRef.isIncludeAllConsSymbols();
+ } else {
+ renderHistogram = av.isShowConsensusHistogram();
+ renderProfile = av.isShowConsensusProfile();
+ }
+ }
while (x < eRes - sRes)
{
column = sRes + x;
x++;
continue;
}
-
if (aa.annotations[column].colour == null)
g.setColor(Color.black);
else
y1 = y
- (int) (((aa.annotations[column].value - min) / (range)) * aa.graphHeight);
- if (y1 - y2 > 0)
+ if (renderHistogram)
+ {
+ if (y1 - y2 > 0)
{
g.fillRect(x * av.charWidth, y2, av.charWidth, y1 - y2);
}
{
g.fillRect(x * av.charWidth, y1, av.charWidth, y2 - y1);
}
+ }
// draw profile if available
- if (aa.annotations[column].value!=0)
+ if (aa.annotations[column].value!=0 && renderProfile)
{
int profl[] = getProfileFor(aa,column);
int ht = y1,htn=y2-y1;//aa.graphHeight;
private int[] getProfileFor(AlignmentAnnotation aa, int column)
{
if (aa.autoCalculated && aa.label.startsWith("Consensus")) {
- if (aa.groupRef!=null && aa.groupRef.consensusData!=null) {
+ if (aa.groupRef!=null && aa.groupRef.consensusData!=null && aa.groupRef.isIncludeAllConsSymbols()) {
return AAFrequency.extractProfile(aa.groupRef.consensusData[column],aa.groupRef.getIgnoreGapsConsensus());
}
// TODO extend annotation row to enable dynamic and static profile data to be stored
- if (aa.groupRef==null && aa.sequenceRef==null)
+ if (aa.groupRef==null && aa.sequenceRef==null && av.isShowConsensusProfile())
{
return AAFrequency.extractProfile(av.hconsensus[column],av.getIgnoreGapsConsensus());
}