JAL-2068 framework and example scripts for pluggable alignment
[jalview.git] / src / jalview / workers / FeatureCounterI.java
1 package jalview.workers;
2
3 import jalview.datamodel.SequenceFeature;
4
5 import java.util.List;
6
7 /**
8  * An interface for a type that returns counts of any value of interest at a
9  * sequence position that can be determined from the sequence character and any
10  * features present at that position
11  * 
12  */
13 public interface FeatureCounterI
14 {
15   /**
16    * Returns a count of some property of interest, for example
17    * <ul>
18    * <li>the number of variant features at the position</li>
19    * <li>the number of Cath features of status 'True Positive'</li>
20    * <li>1 if the residue is hydrophobic, else 0</li>
21    * <li>etc</li>
22    * </ul>
23    * 
24    * @param residue
25    *          the residue (or gap) at the position
26    * @param a
27    *          list of any sequence features which include the position
28    */
29   int count(String residue, List<SequenceFeature> features);
30
31   /**
32    * Returns a name for the annotation that this is counting, for use as the
33    * displayed label
34    * 
35    * @return
36    */
37   String getName();
38
39   /**
40    * Returns a description for the annotation, for display as a tooltip
41    * 
42    * @return
43    */
44   String getDescription();
45
46   /**
47    * Returns the colour (as [red, green, blue] values in the range 0-255) to use
48    * for the minimum value on histogram bars. If this is different to
49    * getMaxColour(), then bars will have a graduated colour.
50    * 
51    * @return
52    */
53   int[] getMinColour();
54
55   /**
56    * Returns the colour (as [red, green, blue] values in the range 0-255) to use
57    * for the maximum value on histogram bars. If this is the same as
58    * getMinColour(), then bars will have a single colour (not graduated).
59    * 
60    * @return
61    */
62   int[] getMaxColour();
63 }