Class | Line # | Actions | |||
---|---|---|---|---|---|
ScoreModelI | 30 | 2 | 2 |
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.api.analysis; | |
22 | ||
23 | import java.util.List; | |
24 | ||
25 | import jalview.api.AlignmentViewPanel; | |
26 | import jalview.datamodel.AlignmentView; | |
27 | import jalview.datamodel.SequenceI; | |
28 | import jalview.math.MatrixI; | |
29 | ||
30 | public interface ScoreModelI | |
31 | { | |
32 | /** | |
33 | * Answers a name for the score model, suitable for display in menus. Names | |
34 | * should be unique across score models in use. | |
35 | * | |
36 | * @return | |
37 | * @see jalview.analysis.scoremodels.ScoreModels#forName(String) | |
38 | */ | |
39 | String getName(); | |
40 | ||
41 | /** | |
42 | * Answers an informative description of the model, suitable for use in | |
43 | * tooltips. Descriptions may be internationalised, and need not be unique | |
44 | * (but should be). | |
45 | * | |
46 | * @return | |
47 | */ | |
48 | String getDescription(); | |
49 | ||
50 | /** | |
51 | * Answers true if this model is applicable for nucleotide data (so should be | |
52 | * shown in menus in that context) | |
53 | * | |
54 | * @return | |
55 | */ | |
56 | boolean isDNA(); | |
57 | ||
58 | /** | |
59 | * Answers true if this model is applicable for peptide data (so should be | |
60 | * shown in menus in that context) | |
61 | * | |
62 | * @return | |
63 | */ | |
64 | boolean isProtein(); | |
65 | ||
66 | // TODO getName, isDNA, isProtein can be static methods in Java 8 | |
67 | ||
68 | 25 | default public boolean isSecondaryStructure() |
69 | { | |
70 | 25 | return false; |
71 | } | |
72 | ||
73 | /** | |
74 | * Answers false by default Answers true if the data has secondary structure | |
75 | * (so should be shown in menus in that context) | |
76 | * | |
77 | * @return | |
78 | */ | |
79 | ||
80 | /** | |
81 | * Returns a distance score for the given sequence regions, that is, a matrix | |
82 | * whose value [i][j] is the distance of sequence i from sequence j by some | |
83 | * measure. The options parameter provides configuration choices for how the | |
84 | * similarity score is calculated. | |
85 | * | |
86 | * @param seqData | |
87 | * @param options | |
88 | * @return | |
89 | */ | |
90 | ||
91 | MatrixI findDistances(AlignmentView seqData, SimilarityParamsI options); | |
92 | ||
93 | /** | |
94 | * Returns a similarity score for the given sequence regions, that is, a | |
95 | * matrix whose value [i][j] is the similarity of sequence i to sequence j by | |
96 | * some measure. The options parameter provides configuration choices for how | |
97 | * the similarity score is calculated. | |
98 | * | |
99 | * @param seqData | |
100 | * @param options | |
101 | * @return | |
102 | */ | |
103 | MatrixI findSimilarities(AlignmentView seqData, | |
104 | SimilarityParamsI options); | |
105 | ||
106 | /** | |
107 | * Returns a score model object configured for the given alignment view. | |
108 | * Depending on the score model, this may just be a singleton instance, or a | |
109 | * new instance configured with data from the view. | |
110 | * | |
111 | * @param avp | |
112 | * @return | |
113 | */ | |
114 | ScoreModelI getInstance(AlignmentViewPanel avp); | |
115 | ||
116 | /** | |
117 | * Score models may create multiple leaves for a single sequence - implement | |
118 | * this method if you do | |
119 | * | |
120 | * @param sequences | |
121 | * - sequences to be filtered/expanded set of leaves | |
122 | * @param seqData | |
123 | * - origin | |
124 | * @param labels | |
125 | * - strings to show instead of the SequenceI.getName() for each | |
126 | * element of sequences attached to leaves | |
127 | * @return filtered/expanded set of leaves to be analysed | |
128 | */ | |
129 | 0 | default SequenceI[] expandSeqData(SequenceI[] sequences, |
130 | AlignmentView seqData, SimilarityParamsI scoreParams, | |
131 | List<String> labels) | |
132 | { | |
133 | 0 | return sequences; |
134 | }; | |
135 | } |