JAL-4134 JAL-3855 store/restore groups, tree and threshold used to cluster a PAE...
[jalview.git] / src / jalview / datamodel / ContactMatrixI.java
1 package jalview.datamodel;
2
3 import java.util.Arrays;
4 import java.util.BitSet;
5 import java.util.List;
6
7 public interface ContactMatrixI
8 {
9
10   ContactListI getContactList(int column);
11
12   float getMin();
13
14   float getMax();
15
16   boolean hasReferenceSeq();
17
18   SequenceI getReferenceSeq();
19
20   String getAnnotDescr();
21
22   String getAnnotLabel();
23
24   /**
25    * string indicating how the contactMatrix should be rendered - stored in calcId
26    * @return 
27    */
28   String getType();
29
30   int getWidth();
31   int getHeight();
32   
33   default boolean hasGroups() {
34     return false;
35   }
36   default BitSet getGroupsFor(int column) {
37     BitSet colbitset  = new BitSet();
38     colbitset.set(column);
39     return colbitset;
40   }
41
42   default List<BitSet> getGroups() {
43     return Arrays.asList();
44   }
45
46   default boolean hasTree() {
47     return false;
48   }
49
50   /**
51    * Newick representation of clustered matrix
52    * @return null unless hasTree is true
53    */
54   default String getNewick() {
55     return null;
56   }
57
58   default String getTreeMethod() {
59     return null;
60   }
61
62   default boolean hasCutHeight() {
63     return false;
64   }
65
66   default double getCutHeight() {
67     return 0;
68   }
69 }