1f81e637ff98e25a4350e68311af2730985754dc
[jalview.git] / src / jalview / api / analysis / ScoreModelI.java
1 package jalview.api.analysis;
2
3 import jalview.api.AlignmentViewPanel;
4 import jalview.datamodel.AlignmentView;
5 import jalview.math.MatrixI;
6
7 public interface ScoreModelI
8 {
9   /**
10    * Answers a name for the score model, suitable for display in menus. Names
11    * should be unique across score models in use.
12    * 
13    * @return
14    * @see jalview.analysis.scoremodels.ScoreModels#forName(String)
15    */
16   String getName();
17
18   /**
19    * Answers an informative description of the model, suitable for use in
20    * tooltips. Descriptions may be internationalised, and need not be unique
21    * (but should be).
22    * 
23    * @return
24    */
25   String getDescription();
26
27   /**
28    * Answers true if this model is applicable for nucleotide data (so should be
29    * shown in menus in that context)
30    * 
31    * @return
32    */
33   boolean isDNA();
34
35   /**
36    * Answers true if this model is applicable for peptide data (so should be
37    * shown in menus in that context)
38    * 
39    * @return
40    */
41   boolean isProtein();
42
43   // TODO getName, isDNA, isProtein can be static methods in Java 8
44
45   /**
46    * Returns a distance score for the given sequence regions, that is, a matrix
47    * whose value [i][j] is the distance of sequence i from sequence j by some
48    * measure. The options parameter provides configuration choices for how the
49    * similarity score is calculated.
50    * 
51    * @param seqData
52    * @param options
53    * @return
54    */
55
56   MatrixI findDistances(AlignmentView seqData, SimilarityParamsI options);
57
58   /**
59    * Returns a similarity score for the given sequence regions, that is, a
60    * matrix whose value [i][j] is the similarity of sequence i to sequence j by
61    * some measure. The options parameter provides configuration choices for how
62    * the similarity score is calculated.
63    * 
64    * @param seqData
65    * @param options
66    * @return
67    */
68   MatrixI findSimilarities(AlignmentView seqData,
69           SimilarityParamsI options);
70
71   /**
72    * Returns a score model object configured for the given alignment view.
73    * Depending on the score model, this may just be a singleton instance, or a
74    * new instance configured with data from the view.
75    * 
76    * @param avp
77    * @return
78    */
79   ScoreModelI getInstance(AlignmentViewPanel avp);
80 }