result[column] = profile;
}
- return new Profiles(result);
+ return new Profiles(seqCount, result);
// long elapsed = System.currentTimeMillis() - now;
// jalview.bin.Console.outPrintln(elapsed);
}
int seqCount = sequences.length;
ProfileI[] result = new ProfileI[width];
-
+ int maxSSannotcount=0;
for (int column = start; column < end; column++)
{
}
result[column] = profile;
+ maxSSannotcount=Math.max(maxSSannotcount, ssCount);
}
- return new Profiles(result);
+ return new Profiles(maxSSannotcount,result);
}
/**
*/
return;
}
-
+
for (int i = startCol; i < endCol; i++)
{
ProfileI profile = profiles.get(i);
*/
{
String rememberAs = calcId + "!" + displayLabel;
- if (aa.visible && !addedToShown.contains(rememberAs))
+ if (aa.isForDisplay() && !addedToShown.contains(rememberAs)) // exclude noData annotations
{
if (!shownTypes.containsKey(calcId))
{
BitSet result = new BitSet();
for (AlignmentAnnotation ann : annotations)
{
- if (ann.graph == AlignmentAnnotation.LINE_GRAPH && ann.visible)
+ if (ann.graph == AlignmentAnnotation.LINE_GRAPH && ann.visible)
{
int gg = ann.graphGroup;
if (gg > -1)
for (AlignmentAnnotation annot : aa)
{
- if (annot.visible)
+ if (annot.isForDisplay())
{
return annot;
}
* protein we need a smarter way to 'translate' without generating
* invalid (unbalanced) structure annotation.
*/
- if (annotation.autoCalculated || !annotation.visible
+ if (annotation.autoCalculated || !annotation.isForDisplay()
|| annotation.isRNA())
{
continue;
/** is the row visible */
public boolean visible = true;
+
+ /**
+ * is there data for this annotation row to display ? if not then hide it!
+ * For rows that are only shown when data is present (default true)
+ */
+ public boolean hasData=true;
+
+
public int graphGroup = -1;
this.label = annotation.label;
this.padGaps = annotation.padGaps;
this.visible = annotation.visible;
+ this.hasData = annotation.hasData;
this.centreColLabels = annotation.centreColLabels;
this.scaleColLabel = annotation.scaleColLabel;
this.showAllColLabels = annotation.showAllColLabels;
{
return graphMin < graphMax;
}
+
+ /**
+ * @return true if hasData and visible are true
+ */
+ public boolean isForDisplay()
+ {
+ return hasData && visible;
+ }
/**
* delete any columns in alignmentAnnotation that are hidden (including
public class Profiles implements ProfilesI
{
-
+ int sourceCount;
+
private ProfileI[] profiles;
- public Profiles(ProfileI[] p)
+ public Profiles(int sourceCount, ProfileI[] p)
{
+ this.sourceCount=sourceCount;
profiles = p;
}
return profiles == null ? 0 : profiles.length - 1;
}
+ @Override
+ public int getCount()
+ {
+ return sourceCount;
+ }
}
int getStartColumn();
int getEndColumn();
+
+ /**
+ *
+ * @return number of contributing sequences/annotation rows
+ */
+ int getCount();
}
for (i = 0; i < al.getAlignmentAnnotation().length; i++)
{
AlignmentAnnotation aa = al.getAlignmentAnnotation()[i];
- if (visibleOnly && !aa.visible)
+ if (visibleOnly && !aa.isForDisplay())
{
continue;
}
for (int i = 0; i < aa.length; i++)
{
selectedRow = -1;
- if (!aa[i].visible)
+ if (!aa[i].isForDisplay())
{
continue;
}
for (int i = 0; i < aa.length; i++)
{
visible = true;
- if (!aa[i].visible && !includeHidden)
+ if (!aa[i].isForDisplay() && !includeHidden)
{
hasHiddenRows = true;
continue;
olY = y;
// look ahead to next annotation
for (nexAA = i + 1; nexAA < aa.length
- && (!aa[nexAA].visible && includeHidden); nexAA++)
+ && (!aa[nexAA].isForDisplay() && includeHidden); nexAA++)
;
y += aa[i].height;
if (clip)
for (int i = 0; i < aa.length; i++)
{
- if (aa[i].visible)
+ if (aa[i].isForDisplay())
{
height += aa[i].height;
}
int height = 0, lheight = 0;
for (int i = 0; i < aa.length; i++)
{
- if (aa[i].visible)
+ if (aa[i].isForDisplay())
{
lheight = height;
height += aa[i].height;
}
Annotation[] row_annotations = row.annotations;
- if (!row.visible)
+ if (!row.isForDisplay())
{
continue;
}
{
// is this a sensible way of determining type of annotation?
- if (annotations[i].visible && annotations[i].isRNA()
+ if (annotations[i].isForDisplay() && annotations[i].isRNA()
&& annotations[i].isValidStruc())
{
annotation = annotations[i];
jalview.bin.Console.errPrintln("Null annotation row: ignoring.");
continue;
}
- if (!aa.visible)
+ if (!aa.isForDisplay())
{
continue;
}
{
deriveGap(gap, hSSConsensus);
}
+
+ ssConsensus.hasData=hSSConsensus.getCount()>0;
}
}
{
for (int i = 0; i < aa.length; i++)
{
- if (aa[i].visible && aa[i].isRNA() && aa[i].isValidStruc())
+ if (aa[i].isForDisplay() && aa[i].isRNA() && aa[i].isValidStruc())
{
rnaStruc = aa[i];
break;
Collections.<SequenceI> emptyList(), 3, 12);
PA.setValue(cons, "consSequence", new Sequence("s", "abc"));
sg.getGroupColourScheme().setConservation(cons);
- sg.getGroupColourScheme().setConsensus(new Profiles(null));
+ sg.getGroupColourScheme().setConsensus(new Profiles(0,null));
sg.setDisplayBoxes(false);
sg.setDisplayText(false);
sg.setColourText(true);
profiles[2] = new Profile(4, 4, 0, "");
profiles[3] = new Profile(4, 1, 2, "T");
ResidueShader ccs = new ResidueShader(new PIDColourScheme());
- ccs.setConsensus(new Profiles(profiles));
+ ccs.setConsensus(new Profiles(3,profiles));
/*
* no threshold
{
return 0;
}
+
+ @Override
+ public int getCount()
+ {
+ // TODO Auto-generated method stub
+ return 0;
+ }
};
return consensus;