import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Map;
+import jalview.ws.datamodel.MappableContactMatrixI;
+
public class ContactMapHolder implements ContactMapHolderI
{
{
if (contactmaps != null && contactmaps.size() > 0)
{
- return contactmaps.values();
+ // defensive copy, and return non redundant set of ContactMatrixI instances
+ return new HashSet<ContactMatrixI>(contactmaps.values());
}
return Collections.EMPTY_LIST;
}
{
return null;
}
+ if (cm instanceof MappableContactMatrixI)
+ {
+ if (_aa.sequenceRef != null)
+ {
+ return ((MappableContactMatrixI) cm)
+ .getMappableContactList(_aa.sequenceRef, column);
+ }
+ }
// TODO: could resolve sequence position to column position here
// TODO: what about for complexes - where contactMatrix may involve two or
// more sequences
contactmaps.put(aa.annotationId, cm);
// TODO: contact matrices could be intra or inter - more than one refseq
// possible!
- if (cm.hasReferenceSeq())
+ if (cm instanceof MappableContactMatrixI)
{
- aa.setSequenceRef(cm.getReferenceSeq());
+ aa.setSequenceRef(((MappableContactMatrixI) cm).getReferenceSeq());
}
return aa;
}
annotation.editable = false;
annotation.graph = AlignmentAnnotation.CONTACT_MAP;
annotation.calcId = cm.getType();
- annotation.label = cm.getAnnotLabel();
- annotation.description = cm.getAnnotDescr();
+ if (annotation.label == null || "".equals(annotation.label))
+ {
+ annotation.label = cm.getAnnotLabel();
+
+ }
+ if (annotation.description == null || "".equals(annotation.description))
+ {
+ annotation.description = cm.getAnnotDescr();
+ }
contactmaps.put(annotation.annotationId, cm);
}
}