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