@Override
public AlignmentAnnotation findOrCreateAnnotation(String name,
- boolean autoCalc, SequenceI seqRef, SequenceGroup groupRef)
+ String calcId, boolean autoCalc, SequenceI seqRef, SequenceGroup groupRef)
{
+ assert(name!=null);
for (AlignmentAnnotation annot : getAlignmentAnnotation())
{
if (annot.autoCalculated == autoCalc
- && annot.getCalcId().equals(name)
+ && (name.equals(annot.label))
+ && (calcId==null || annot.getCalcId().equals(calcId))
&& annot.sequenceRef == seqRef && annot.groupRef == groupRef)
{
return annot;
AlignmentAnnotation annot = new AlignmentAnnotation(name, name,
new Annotation[1], 0f, 0f, AlignmentAnnotation.BAR_GRAPH);
annot.hasText = false;
- annot.setCalcId(new String(name));
+ annot.setCalcId(new String(calcId));
annot.autoCalculated = autoCalc;
if (seqRef != null)
{
/**
* search for or create a specific annotation row on the alignment
- *
- * @param method - CalcId for the annotation (must match)
+ * @param name name for annotation (must match)
+ * @param calcId calcId for the annotation (null or must match)
* @param autoCalc - value of autocalc flag for the annotation
* @param seqRef - null or specific sequence reference
* @param groupRef - null or specific group reference
+ * @param method - CalcId for the annotation (must match)
+ *
* @return existing annotation matching the given attributes
*/
- public AlignmentAnnotation findOrCreateAnnotation(String name, boolean autoCalc,
- SequenceI seqRef, SequenceGroup groupRef);
+ public AlignmentAnnotation findOrCreateAnnotation(String name, String calcId,
+ boolean autoCalc, SequenceI seqRef, SequenceGroup groupRef);
/**
* move the given group up or down in the alignment by the given number of rows.
}
}
// this will overwrite any existing t-coffee scores for the alignment
- AlignmentAnnotation aa=al.findOrCreateAnnotation(TCOFFEE_SCORE,false,s,null);
+ AlignmentAnnotation aa=al.findOrCreateAnnotation(TCOFFEE_SCORE,TCOFFEE_SCORE,false,s, null);
if (s!=null)
{
aa.label="T-COFFEE";
{
// simple annotation row
annotation = alignViewport.getAlignment()
- .findOrCreateAnnotation(scr.getMethod(), true, null,
- null);
+ .findOrCreateAnnotation(scr.getMethod(), getCalcId(), true,
+ null, null);
+
Annotation[] elm = new Annotation[alWidth];
if (alWidth == gapMap.length) // scr.getScores().size())
{