new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
consensus.hasText = true;
consensus.autoCalculated = true;
+
+ //TODO check if this can done accordingly
+ strucConsensus = new AlignmentAnnotation("StrucConsensus", "PID",
+ new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
+ strucConsensus.hasText = true;
+ strucConsensus.autoCalculated = true;
if (Cache.getDefault("SHOW_IDENTITY", true))
{
alignment.addAnnotation(consensus);
+ //TODO: Make own if for structure
+ alignment.addAnnotation(strucConsensus);
}
+
}
if (jalview.bin.Cache.getProperty("DEFAULT_COLOUR") != null)
//--------START Structure Conservation
public void updateStrucConsensus(final AlignmentPanel ap)
{
- // see note in mantis : issue number 8585
+ // see note in mantis : issue number 8585
if (strucConsensus == null || !autoCalculateStrucConsensus)
{
return;
public void run()
{
- updatingStrucConsensus = true;
+ updatingStrucConsensus = true;
while (UPDATING_STRUC_CONSENSUS)
{
try
strucConsensus.annotations = new Annotation[aWidth];
hStrucConsensus = new Hashtable[aWidth];
+
+ AlignmentAnnotation[] aa = ap.av.getAlignment().getAlignmentAnnotation();
+ AlignmentAnnotation rnaStruc = null;
+ for(int i=0; i<aa.length;i++){
+ if(aa[i].getRNAStruc() != null){
+ rnaStruc=aa[i];
+ break;
+ }
+ }
+
AlignmentAnnotation rna = ap.av.getAlignment().getAlignmentAnnotation()[0];
StructureFrequency.calculate(alignment.getSequencesArray(), 0,
- alignment.getWidth(), hStrucConsensus, true, rna);
+ alignment.getWidth(), hStrucConsensus, true, rnaStruc);
//TODO AlignmentAnnotation rnaStruc!!!
updateAnnotation(true);
if (globalColourScheme != null)
} catch (OutOfMemoryError error)
{
- alignment.deleteAnnotation(consensus);
+ alignment.deleteAnnotation(strucConsensus);
strucConsensus = null;
hStrucConsensus = null;
// TODO: make calls thread-safe, so if another thread calls this method,
// it will either return or wait until one calculation is finished.
if (immediate
- || (!updatingConsensus && consensus != null && hconsensus != null))
- {
+ || (!updatingStrucConsensus && strucConsensus != null && hStrucConsensus != null))
+ {
StructureFrequency.completeConsensus(strucConsensus, hStrucConsensus, 0,
- hStrucConsensus.length, ignoreGapsInConsensusCalculation,
+ hStrucConsensus.length, false,
showSequenceLogo);
}
}
{
updateConsensus(ap);
}
-
if(autoCalculateStrucConsensus)
{
updateStrucConsensus(ap);