X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fdatamodel%2FMappableContactMatrixI.java;fp=src%2Fjalview%2Fws%2Fdatamodel%2FMappableContactMatrixI.java;h=97624289881e1821967ee01d768f9b5ac171c9e9;hp=0000000000000000000000000000000000000000;hb=f680b9a507cc1643c9eead990e15026c1eca4e6e;hpb=265e81c0b3599a09c312f17188e3a892e9d96c4e;ds=sidebyside diff --git a/src/jalview/ws/datamodel/MappableContactMatrixI.java b/src/jalview/ws/datamodel/MappableContactMatrixI.java new file mode 100644 index 0000000..9762428 --- /dev/null +++ b/src/jalview/ws/datamodel/MappableContactMatrixI.java @@ -0,0 +1,76 @@ +package jalview.ws.datamodel; + +import jalview.datamodel.ContactListI; +import jalview.datamodel.ContactMatrixI; +import jalview.datamodel.Mapping; +import jalview.datamodel.SequenceI; +import jalview.util.MapList; + +public interface MappableContactMatrixI extends ContactMatrixI +{ + + boolean hasReferenceSeq(); + + SequenceI getReferenceSeq(); + + /** + * remaps the matrix to a new reference sequence + * + * @param dsq + * @param sqmpping + * - mapping from current reference to new reference - 1:1 only + * @return new ContactMatrixI instance with updated mapping + */ + MappableContactMatrixI liftOver(SequenceI dsq, Mapping sqmpping); + + /** + * like ContactMatrixI.getContactList(int column) but + * + * @param localFrame + * - sequence or other object that this contact matrix is associated + * with + * @param column + * - position in localFrame + * @return ContactListI that returns contacts w.r.t. localFrame + */ + + ContactListI getMappableContactList(SequenceI localFrame, int column); + + /** + * + * Similar to AlignedCodonFrame.getMappingBetween + * + * @param sequenceRef + * - a reference sequence mappable to this contactMatrix - may be + * null + * @return null or the MapList mapping to the coordinates of the reference + * sequence (or if hasReferenceSeq() is false, and sequenceRef is + * null, any mapping present) + * + */ + MapList getMapFor(SequenceI sequenceRef); + + /** + * Locate a position in the mapped sequence for a single column in the matrix. + * this to resolve positions corresponding to column clusters + * + * @param localFrame + * - sequence derivced from reference sequence + * @param column + * - matrix row/column + * @return sequence position(s) corresponding to column in contact matrix + */ + int[] getMappedPositionsFor(SequenceI localFrame, int column); + + /** + * Locate a position in the mapped sequence for a contiguous range of columns in the matrix + * use this to resolve positions corresponding to column clusters + * + * @param localFrame + * - sequence derivced from reference sequence + * @param column + * - matrix row/column + * @return sequence position(s) corresponding to column in contact matrix + */ + int[] getMappedPositionsFor(SequenceI localFrame, int from, int to); +}