1 package jalview.datamodel;
4 import java.util.Arrays;
5 import java.util.BitSet;
8 public interface ContactMatrixI
11 ContactListI getContactList(int column);
17 String getAnnotDescr();
19 String getAnnotLabel();
22 * string indicating how the contactMatrix should be rendered - stored in calcId
30 public GroupSetI getGroupSet();
32 /// proxy methods to simplify use of the interface
33 /// Mappable contact matrices can override these to perform mapping
35 default public boolean hasGroupSet()
37 return getGroupSet()!=null;
40 default boolean hasGroups() {
41 return hasGroupSet() && getGroupSet().hasGroups();
45 default BitSet getGroupsFor(int column) {
48 BitSet colbitset = new BitSet();
49 colbitset.set(column);
52 return getGroupSet().getGroupsFor(column);
55 default List<BitSet> getGroups() {
58 return Arrays.asList();
60 return getGroupSet().getGroups();
63 default boolean hasTree() {
64 return hasGroupSet() ? getGroupSet().hasTree() : false;
68 * Newick representation of clustered matrix
69 * @return null unless hasTree is true
71 default String getNewick() {
72 return hasGroupSet() ? getGroupSet().getNewick(): null;
75 default String getTreeMethod() {
76 return hasGroupSet() ? getGroupSet().getTreeMethod() :null;
79 default boolean hasCutHeight() {
80 return hasGroupSet() ? getGroupSet().hasCutHeight() : false;
83 default double getCutHeight() {
84 return hasGroupSet() ? getGroupSet().getCutHeight():0;
87 default void updateGroups(List<BitSet> colGroups)
91 getGroupSet().updateGroups(colGroups);
95 default void setColorForGroup(BitSet bs, Color color)
99 getGroupSet().setColorForGroup(bs, color);
103 default Color getColourForGroup(BitSet bs)
107 return getGroupSet().getColourForGroup(bs);
115 void setGroupSet(GroupSet makeGroups);