Merge branch 'features/JAL-2295setChimeraAttributes' into spikes/mungo
[jalview.git] / src / jalview / workers / FeatureCounterI.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.workers;
22
23 import jalview.datamodel.SequenceFeature;
24
25 import java.util.List;
26
27 /**
28  * An interface for a type that returns counts of any value of interest at a
29  * sequence position that can be determined from the sequence character and any
30  * features present at that position
31  * 
32  */
33 public interface FeatureCounterI
34 {
35   /**
36    * Returns a count of some property of interest, for example
37    * <ul>
38    * <li>the number of variant features at the position</li>
39    * <li>the number of Cath features of status 'True Positive'</li>
40    * <li>1 if the residue is hydrophobic, else 0</li>
41    * <li>etc</li>
42    * </ul>
43    * 
44    * @param residue
45    *          the residue (or gap) at the position
46    * @param a
47    *          list of any sequence features which include the position
48    */
49   int count(String residue, List<SequenceFeature> features);
50
51   /**
52    * Returns a name for the annotation that this is counting, for use as the
53    * displayed label
54    * 
55    * @return
56    */
57   String getName();
58
59   /**
60    * Returns a description for the annotation, for display as a tooltip
61    * 
62    * @return
63    */
64   String getDescription();
65
66   /**
67    * Returns the colour (as [red, green, blue] values in the range 0-255) to use
68    * for the minimum value on histogram bars. If this is different to
69    * getMaxColour(), then bars will have a graduated colour.
70    * 
71    * @return
72    */
73   int[] getMinColour();
74
75   /**
76    * Returns the colour (as [red, green, blue] values in the range 0-255) to use
77    * for the maximum value on histogram bars. If this is the same as
78    * getMinColour(), then bars will have a single colour (not graduated).
79    * 
80    * @return
81    */
82   int[] getMaxColour();
83 }