super(alignViewport, alignPanel);
}
+ @Override
+ public String getCalcName()
+ {
+ return "Information";
+ }
+
/**
* Recomputes Information annotations for any HMM consensus sequences (for
* alignment and/or groups)
{
return;
}
- if (calcMan.isPending(this))
+ if (alignViewport.isClosed())
{
+ abortAndDestroy();
return;
}
- calcMan.notifyStart(this);
- // long started = System.currentTimeMillis();
- try
+ AlignmentI alignment = alignViewport.getAlignment();
+ int aWidth = alignment == null ? -1 : alignment.getWidth();
+ if (aWidth < 0)
{
- if (calcMan.isPending(this))
- {
- // another instance of this is waiting to run
- calcMan.workerComplete(this);
- return;
- }
- while (!calcMan.notifyWorking(this))
- {
- // another thread in progress, wait my turn
- try
- {
- if (ap != null)
- {
- ap.paintAlignment(false, false);
- }
- Thread.sleep(200);
- } catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
- if (alignViewport.isClosed())
- {
- abortAndDestroy();
- return;
- }
-
- AlignmentI alignment = alignViewport.getAlignment();
- int aWidth = alignment == null ? -1 : alignment.getWidth();
- if (aWidth < 0)
- {
- calcMan.workerComplete(this);
- return;
- }
+ return;
+ }
- /*
- * compute information profiles for any HMM consensus sequences
- * for the alignment or sub-groups
- */
- computeProfiles(alignment);
+ /*
+ * compute information profiles for any HMM consensus sequences
+ * for the alignment or sub-groups
+ */
+ computeProfiles(alignment);
- /*
- * construct the corresponding annotations
- */
- updateAnnotation();
+ /*
+ * construct the corresponding annotations
+ */
+ updateAnnotation();
- if (ap != null)
- {
- ap.adjustAnnotationHeight();
- ap.paintAlignment(true, true);
- }
- } catch (OutOfMemoryError error)
+ if (ap != null)
{
- calcMan.disableWorker(this);
- ap.raiseOOMWarning("calculating information", error);
- } finally
- {
- calcMan.workerComplete(this);
+ ap.adjustAnnotationHeight();
+ ap.paintAlignment(true, true);
}
}
*/
protected AlignmentAnnotation getGapAnnotation()
{
- return alignViewport.getOccupancyAnnotation();
+ return alignViewport.getAlignmentGapAnnotation();
}
/**
for (SequenceGroup group : alignment.getGroups())
{
hmmSeqs = group.getHmmSequences();
- ProfilesI profiles = group.getHmmProfiles();
- float m = updateInformationAnnotation(hmmSeqs.get(0), profiles, group,
- infos);
- maxInformation = Math.max(maxInformation, m);
+ if (!hmmSeqs.isEmpty())
+ {
+ ProfilesI profiles = group.getHmmProfiles();
+ float m = updateInformationAnnotation(hmmSeqs.get(0), profiles,
+ group, infos);
+ maxInformation = Math.max(maxInformation, m);
+ }
}
/*