/**
* consensus calculation property
*/
- private boolean includeAllConsSymbols=false;
+ private boolean showConsensusProfile=false;
/**
* @return the includeAllConsSymbols
*/
public boolean isIncludeAllConsSymbols()
{
- return includeAllConsSymbols;
+ return showConsensusProfile;
}
}
/**
+ * Max Gaps Threshold for performing a conservation calculation
+ * TODO: make this a configurable property - or global to an alignment view
+ */
+ private int consPercGaps=25;
+ /**
* calculate residue conservation for group - but only if necessary.
*/
public void recalcConservation()
try
{
- Hashtable cnsns[] = AAFrequency.calculate(sequences, startRes, endRes + 1, includeAllConsSymbols);
+ Hashtable cnsns[] = AAFrequency.calculate(sequences, startRes, endRes + 1, showConsensusProfile);
if (consensus != null)
{
_updateConsensusRow(cnsns);
ResidueProperties.propHash, 3, sequences, startRes,
endRes + 1);
c.calculate();
- c.verdict(false, 25);
+ c.verdict(false, consPercGaps);
if (conservation!=null)
{
_updateConservationRow(c);
{
getConservation();
}
+ // update Labels
+ conservation.label = "Conservation for "+getName();
+ conservation.description = "Conservation for group "+getName()+" less than " + consPercGaps
+ + "% gaps";
// preserve width if already set
int aWidth = (conservation.annotations!=null) ? (endRes<conservation.annotations.length ? conservation.annotations.length : endRes+1) : endRes+1;
conservation.annotations = null;
{
getConsensus();
}
+ consensus.label = "Consensus for "+getName();
+ consensus.description = "Percent Identity";
consensusData = cnsns;
// preserve width if already set
int aWidth = (consensus.annotations!=null) ? (endRes<consensus.annotations.length ? consensus.annotations.length : endRes+1) : endRes+1;
consensus.annotations = null;
consensus.annotations = new Annotation[aWidth]; // should be alignment width
- AAFrequency.completeConsensus(consensus,cnsns,startRes,endRes+1,ignoreGapsInConsensus, includeAllConsSymbols); // TODO: setting container for ignoreGapsInConsensusCalculation);
+ AAFrequency.completeConsensus(consensus,cnsns,startRes,endRes+1,ignoreGapsInConsensus, showConsensusProfile); // TODO: setting container for ignoreGapsInConsensusCalculation);
}
/**
this.showUnconserved = displayNonconserved;
}
AlignmentAnnotation consensus=null,conservation=null;
+
+ /**
+ * flag indicating if consensus histogram should be rendered
+ */
+ private boolean showConsensusHistogram;
+
+
/**
*
* @return automatically calculated consensus row
}
if (consensus==null)
{
- consensus = new AlignmentAnnotation("Consensus for "+getName(), "PID",
+ consensus = new AlignmentAnnotation("","",
new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
consensus.hasText = true;
consensus.autoCalculated = true;
consensus.groupRef = this;
}
+ consensus.label = "Consensus for "+getName();
+ consensus.description = "Percent Identity";
return consensus;
}
/**
* @return autoCalculated annotation row
*/
public AlignmentAnnotation getConservationRow() {
- int ConsPercGaps = 25;
if (conservation == null) {
- conservation = new AlignmentAnnotation("Conservation for "+getName(),
- "Conservation for group "+getName()+" less than " + ConsPercGaps
- + "% gaps", new Annotation[1], 0f, 11f,
+ conservation = new AlignmentAnnotation("","", new Annotation[1], 0f, 11f,
AlignmentAnnotation.BAR_GRAPH);
conservation.hasText = true;
conservation.autoCalculated = true;
conservation.groupRef = this;
- }
-
+ }
+ conservation.label = "Conservation for "+getName();
+ conservation.description = "Conservation for group "+getName()+" less than " + consPercGaps
+ + "% gaps";
return conservation;
}
*/
public void setIncludeAllConsSymbols(boolean includeAllConsSymbols)
{
- if (this.includeAllConsSymbols!=includeAllConsSymbols && consensus!=null) {
- this.includeAllConsSymbols = includeAllConsSymbols;
+ if (this.showConsensusProfile!=includeAllConsSymbols && consensus!=null) {
+ this.showConsensusProfile = includeAllConsSymbols;
+ recalcConservation();
+ }
+ this.showConsensusProfile = includeAllConsSymbols;
+ }
+
+
+ /**
+ *
+ * @param showConsHist flag indicating if the consensus histogram for this group should be rendered
+ */
+ public void setShowConsensusHistogram(boolean showConsHist)
+ {
+
+ if (showConsensusHistogram!=showConsHist && consensus!=null) {
+ this.showConsensusHistogram = showConsHist;
recalcConservation();
}
- this.includeAllConsSymbols = includeAllConsSymbols;
+ this.showConsensusHistogram = showConsHist;
+ }
+ /**
+ * @return the showConsensusHistogram
+ */
+ public boolean isShowConsensusHistogram()
+ {
+ return showConsensusHistogram;
+ }
}
-}