X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fanalysis%2Fscoremodels%2FFeatureDistanceModel.java;h=9c2f6d1bb0a39ba149f5045ed5265623f784c897;hb=7723baa88fa4f365c01e9f0ee9551e278219d2e5;hp=636c19b3b545760a4d6018dddd7f43da7ee51e25;hpb=8717834368bd00d8adfa47ee099288acd34363ef;p=jalview.git diff --git a/src/jalview/analysis/scoremodels/FeatureDistanceModel.java b/src/jalview/analysis/scoremodels/FeatureDistanceModel.java index 636c19b..9c2f6d1 100644 --- a/src/jalview/analysis/scoremodels/FeatureDistanceModel.java +++ b/src/jalview/analysis/scoremodels/FeatureDistanceModel.java @@ -22,9 +22,8 @@ package jalview.analysis.scoremodels; import jalview.api.AlignmentViewPanel; import jalview.api.FeatureRenderer; -import jalview.api.analysis.DistanceScoreModelI; +import jalview.api.analysis.ScoreModelI; import jalview.api.analysis.SimilarityParamsI; -import jalview.api.analysis.ViewBasedAnalysisI; import jalview.datamodel.AlignmentView; import jalview.datamodel.SeqCigar; import jalview.datamodel.SequenceFeature; @@ -38,13 +37,42 @@ import java.util.List; import java.util.Map; import java.util.Set; -public class FeatureDistanceModel implements DistanceScoreModelI, - ViewBasedAnalysisI +public class FeatureDistanceModel extends DistanceScoreModel { + private static final String NAME = "Sequence Feature Similarity"; + + private String description; + FeatureRenderer fr; + /** + * Constructor + */ + public FeatureDistanceModel() + { + } + @Override - public boolean configureFromAlignmentView(AlignmentViewPanel view) + public ScoreModelI getInstance(AlignmentViewPanel view) + { + FeatureDistanceModel instance; + try + { + instance = this.getClass().getDeclaredConstructor().newInstance(); + instance.configureFromAlignmentView(view); + return instance; + } catch (InstantiationException | IllegalAccessException e) + { + System.err.println("Error in " + getClass().getName() + + ".getInstance(): " + e.getMessage()); + return null; + } catch (ReflectiveOperationException roe) + { + return null; + } + } + + boolean configureFromAlignmentView(AlignmentViewPanel view) { fr = view.cloneFeatureRenderer(); @@ -57,17 +85,28 @@ public class FeatureDistanceModel implements DistanceScoreModelI, * features each sequence pair has at each column, ignore feature types they * have in common, and count the rest. The totals are normalised by the number * of columns processed. + *
+ * The parameters argument provides settings for treatment of gap-residue
+ * aligned positions, and whether the score is over the longer or shorter of
+ * each pair of sequences
+ *
+ * @param seqData
+ * @param params
*/
@Override
public MatrixI findDistances(AlignmentView seqData,
- SimilarityParamsI options)
+ SimilarityParamsI params)
{
- List