import jalview.workers.AlignCalcManager;
import jalview.workers.ComplementConsensusThread;
import jalview.workers.ConsensusThread;
+import jalview.workers.InformationThread;
import jalview.workers.StrucConsensusThread;
import java.awt.Color;
public boolean autoCalculateConsensus = true;
+ public boolean autoCalculateInformation = true;
+
protected boolean autoCalculateStrucConsensus = true;
protected boolean ignoreGapsInConsensusCalculation = false;
protected AlignmentAnnotation[] groupConservation;
- protected AlignmentAnnotation informationContent;
+ protected AlignmentAnnotation[] groupInformation;
+
+ protected AlignmentAnnotation information;
+
+ /**
+ * results of alignment information analysis for visible portion of view
+ */
+ protected ProfilesI hinformation = null;
/**
* results of alignment consensus analysis for visible portion of view
}
@Override
+ public ProfilesI setSequenceInformationHash()
+ {
+ return hinformation;
+ }
+
+ @Override
+ public ProfilesI getSequenceInformationHash()
+ {
+ return hinformation;
+ }
+
+ @Override
public Hashtable[] getComplementConsensusHash()
{
return hcomplementConsensus;
@Override
public AlignmentAnnotation getAlignmentInformationAnnotation()
{
- return informationContent;
+ return information;
}
@Override
}
}
+ /**
+ * trigger update of information annotation
+ */
+ public void updateInformation(final AlignmentViewPanel ap)
+ {
+ if (information == null)
+ {
+ return;
+ }
+ if (calculator
+ .getRegisteredWorkersOfClass(InformationThread.class) == null)
+ {
+ calculator.registerWorker(new InformationThread(this, ap));
+ }
+
+ }
+
// --------START Structure Conservation
public void updateStrucConsensus(final AlignmentViewPanel ap)
{
* defensively null out references to large objects in case
* this object is not garbage collected (as if!)
*/
+ information = null;
consensus = null;
complementConsensus = null;
strucConsensus = null;
if (showHMMSequenceLogo != this.showHMMSequenceLogo)
{
this.showHMMSequenceLogo = showHMMSequenceLogo;
+ calculator.updateAnnotationFor(InformationThread.class);
}
this.showHMMSequenceLogo = showHMMSequenceLogo;
}
ignoreBelowBackGroundFrequencyCalculation = b;
if (ap != null)
{
- // updateConsensus(ap);
- if (residueShading != null)
- {
- residueShading.setThreshold(residueShading.getThreshold(),
- ignoreBelowBackGroundFrequencyCalculation);
- }
+ updateInformation(ap);
}
}
{
updateStrucConsensus(ap);
}
+ if (information != null)
+ {
+ updateInformation(ap);
+ }
// Reset endRes of groups if beyond alignment width
int alWidth = alignment.getWidth();
rs.alignmentChanged(alignment, hiddenRepSequences);
rs.setConsensus(hconsensus);
+ rs.setInformation(hinformation);
if (rs.conservationApplied())
{
rs.setConservation(Conservation.calculateConservation("All",
}
}
+
/**
* If this is a protein alignment and there are mappings to cDNA, adds the
* cDNA consensus annotation and returns true, else returns false.
}
}
+ public void initInformation(SequenceI hmmSequence)
+ {
+ information = new AlignmentAnnotation("Information",
+ MessageManager.getString("label.information_description"),
+ new Annotation[1], 0f, 6.52f, AlignmentAnnotation.BAR_GRAPH);
+ information.hasText = true;
+ information.autoCalculated = true;
+ information.hasText = true;
+ information.autoCalculated = false;
+ information.sequenceRef = hmmSequence;
+ alignment.addAnnotation(information);
+ }
+
// these should be extracted from the view model - style and settings for
// derived annotation
private void initGapCounts()
boolean showprf = isShowSequenceLogo();
boolean showConsHist = isShowConsensusHistogram();
boolean normLogo = isNormaliseSequenceLogo();
+ boolean showHMMPrf = isShowHMMSequenceLogo();
+ boolean showInfoHist = isShowInformationHistogram();
+ boolean normHMMLogo = isNormaliseHMMSequenceLogo();
/**
* TODO reorder the annotation rows according to group/sequence ordering on
sg.setshowSequenceLogo(showprf);
sg.setShowConsensusHistogram(showConsHist);
sg.setNormaliseSequenceLogo(normLogo);
+ sg.setshowHMMSequenceLogo(showHMMPrf);
+ sg.setShowInformationHistogram(showInfoHist);
+ sg.setNormaliseHMMSequenceLogo(normHMMLogo);
}
if (conv)
{