import jalview.util.DBRefUtils;
import jalview.util.MapList;
import jalview.util.StringUtils;
+import jalview.ws.datamodel.alphafold.MappableContactMatrix;
/**
*
}
aa.annotations = _aa;
aa.setSequenceRef(this);
+ if (cm instanceof MappableContactMatrix && !((MappableContactMatrix) cm).hasReferenceSeq())
+ {
+ ((MappableContactMatrix) cm).setRefSeq(this);
+ }
aa.createSequenceMapping(this, getStart(), false);
addAlignmentAnnotation(aa);
return aa;
return toSeq;
}
- protected void setRefSeq(SequenceI _refSeq)
+ /**
+ * set the reference sequence and construct the mapping between the start-end positions of given sequence and row/columns of contact matrix
+ * @param _refSeq
+ */
+ public void setRefSeq(SequenceI _refSeq)
{
refSeq = _refSeq;
while (refSeq.getDatasetSequence() != null)
}
}
}
- return ContactMatrixI.super.getGroupsFor(column);
+ return super.getGroupsFor(column);
}
HashMap<BitSet,Color> colorMap = new HashMap<>();
&& al.getAlignmentAnnotation().length == 1);
AlignmentAnnotation alan = al.findAnnotations(sq, null, cm_aan.label)
.iterator().next();
+ ContactMatrixI t_cm = al.getContactMatrixFor(alan);
+ assertNotNull("No contact map for the transferred annotation row.",t_cm);
+ assertTrue(t_cm instanceof SeqDistanceContactMatrix);
+ assertTrue(((SeqDistanceContactMatrix)t_cm).hasReferenceSeq());
+
ContactListI cl = al.getContactListFor(alan, 1);
assertNotNull(
"No contact matrix recovered after reference annotation transfer",