a8cb059fbb26d7757eefbef895cf978879c4770c
[jalview.git] / src / jalview / workers / FeatureSetCounterI.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
22 package jalview.workers;
23
24 import jalview.datamodel.SequenceFeature;
25
26 import java.util.List;
27
28 /**
29  * Like FeatureCounterI but returns a vector of counts for a set of features
30  * 
31  * An interface for a type that returns counts of any value of interest at a
32  * sequence position that can be determined from the sequence character and any
33  * features present at that position
34  * 
35  */
36 public interface FeatureSetCounterI extends ColumnCounterI
37 {
38   /**
39    * Returns a count of some property of interest, for example
40    * <ul>
41    * <li>the number of variant features at the position</li>
42    * <li>the number of Cath features of status 'True Positive'</li>
43    * <li>1 if the residue is hydrophobic, else 0</li>
44    * <li>etc</li>
45    * </ul>
46    * 
47    * @param residue
48    *          the residue (or gap) at the position
49    * @param a
50    *          list of any sequence features which include the position
51    */
52   int[] count(String residue, List<SequenceFeature> features);
53
54   /**
55    * Returns a name for the annotation that this is counting, for use as the
56    * displayed label
57    * 
58    * @return
59    */
60   String[] getNames();
61
62   /**
63    * Returns a description for the annotation, for display as a tooltip
64    * 
65    * @return
66    */
67   String[] getDescriptions();
68
69   /**
70    * Returns the colour (as [red, green, blue] values in the range 0-255) to use
71    * for the minimum value on histogram bars. If this is different to
72    * getMaxColour(), then bars will have a graduated colour.
73    * 
74    * @return
75    */
76   int[] getMinColour();
77
78   /**
79    * Returns the colour (as [red, green, blue] values in the range 0-255) to use
80    * for the maximum value on histogram bars. If this is the same as
81    * getMinColour(), then bars will have a single colour (not graduated).
82    * 
83    * @return
84    */
85   int[] getMaxColour();
86 }