JAL-4090 JAL-1551 spotlessApply
[jalview.git] / src / jalview / ws / datamodel / MappableContactMatrixI.java
1 package jalview.ws.datamodel;
2
3 import jalview.datamodel.ContactListI;
4 import jalview.datamodel.ContactMatrixI;
5 import jalview.datamodel.Mapping;
6 import jalview.datamodel.SequenceI;
7 import jalview.util.MapList;
8
9 public interface MappableContactMatrixI extends ContactMatrixI
10 {
11
12   boolean hasReferenceSeq();
13
14   SequenceI getReferenceSeq();
15
16   /**
17    * remaps the matrix to a new reference sequence
18    * 
19    * @param dsq
20    * @param sqmpping
21    *          - mapping from current reference to new reference - 1:1 only
22    * @return new ContactMatrixI instance with updated mapping
23    */
24   MappableContactMatrixI liftOver(SequenceI dsq, Mapping sqmpping);
25
26   /**
27    * like ContactMatrixI.getContactList(int column) but
28    * 
29    * @param localFrame
30    *          - sequence or other object that this contact matrix is associated
31    *          with
32    * @param column
33    *          - position in localFrame
34    * @return ContactListI that returns contacts w.r.t. localFrame
35    */
36
37   ContactListI getMappableContactList(SequenceI localFrame, int column);
38
39   /**
40    * 
41    * Similar to AlignedCodonFrame.getMappingBetween
42    * 
43    * @param sequenceRef
44    *          - a reference sequence mappable to this contactMatrix - may be
45    *          null
46    * @return null or the MapList mapping to the coordinates of the reference
47    *         sequence (or if hasReferenceSeq() is false, and sequenceRef is
48    *         null, any mapping present)
49    * 
50    */
51   MapList getMapFor(SequenceI sequenceRef);
52
53   /**
54    * Locate a position in the mapped sequence for a single column in the matrix.
55    * this to resolve positions corresponding to column clusters
56    * 
57    * @param localFrame
58    *          - sequence derivced from reference sequence
59    * @param column
60    *          - matrix row/column
61    * @return sequence position(s) corresponding to column in contact matrix
62    */
63   int[] getMappedPositionsFor(SequenceI localFrame, int column);
64
65   /**
66    * Locate a position in the mapped sequence for a contiguous range of columns
67    * in the matrix use this to resolve positions corresponding to column
68    * clusters
69    * 
70    * @param localFrame
71    *          - sequence derivced from reference sequence
72    * @param column
73    *          - matrix row/column
74    * @return sequence position(s) corresponding to column in contact matrix
75    */
76   int[] getMappedPositionsFor(SequenceI localFrame, int from, int to);
77
78   ContactMatrixI getMappedMatrix();
79 }