label.score_model_pid = % Identity
label.score_model_blosum62 = BLOSUM62
label.score_model_pam250 = PAM 250
+label.score_model_smithwatermanscore = Score between two sequences aligned with Smith-Waterman with default Peptide/Nucleotide matrix
+label.score_model_sequencefeaturesimilarity = Distance measure of average number of features not shared at sequence positions
label.score_model_conservation = Physicochemical property conservation
label.score_model_enhconservation = Physicochemical property conservation
label.status_bar = Status bar
public class FeatureDistanceModel implements DistanceScoreModelI,
ViewBasedAnalysisI
{
+ private static final String NAME = "Sequence Feature Similarity";
+
+ private String description;
+
FeatureRenderer fr;
+ /**
+ * Constructor
+ */
+ public FeatureDistanceModel()
+ {
+ }
+
@Override
public boolean configureFromAlignmentView(AlignmentViewPanel view)
@Override
public String getName()
{
- return "Sequence Feature Similarity";
+ return NAME;
+ }
+
+ @Override
+ public String getDescription()
+ {
+ return description;
}
@Override
public class PIDModel implements SimilarityScoreModelI,
PairwiseScoreModelI
{
+ private static final String NAME = "PID";
+
+ private String description;
+
+ /**
+ * Constructor
+ */
+ public PIDModel()
+ {
+ }
@Override
public String getName()
{
- return "% Identity (PID)";
+ return NAME;
+ }
+
+ @Override
+ public String getDescription()
+ {
+ return description;
}
@Override
/*
* the name of the model as shown in menus
+ * each score model in use should have a unique name
*/
private String name;
/*
+ * a description for the model as shown in tooltips
+ */
+ private String description;
+
+ /*
* the characters that the model provides scores for
*/
private char[] symbols;
}
@Override
+ public String getDescription()
+ {
+ return description;
+ }
+
+ @Override
public boolean isDNA()
{
return !peptide;
{
return new String(symbols);
}
+
+ public void setDescription(String desc)
+ {
+ description = desc;
+ }
}
{
private static final String NAME = "Smith Waterman Score";
+ private String description;
+
+ /**
+ * Constructor
+ */
+ public SmithWatermanModel()
+ {
+ }
+
@Override
public MatrixI findSimilarities(AlignmentView seqData,
SimilarityParamsI options)
}
@Override
- public String toString()
+ public String getDescription()
{
- return "Score between two sequences aligned with Smith Waterman with default Peptide/Nucleotide matrix";
+ return description;
}
}
String getName();
/**
+ * Answers an informative description of the model, suitable for use in
+ * tooltips. Descriptions may be internationalised, and need not be unique
+ * (but should be).
+ *
+ * @return
+ */
+ String getDescription();
+
+ /**
* Answers true if this model is applicable for nucleotide data (so should be
* shown in menus in that context)
*
for (final ScoreModelI sm : ScoreModels.getInstance().getModels())
{
final String name = sm.getName();
- // create an entry for this score matrix for use in PCA
- JCheckBoxMenuItem jm = new JCheckBoxMenuItem();
- jm.setText(MessageManager.getStringOrReturn("label.score_model_",
- name));
+ JCheckBoxMenuItem jm = new JCheckBoxMenuItem(name);
+
+ /*
+ * if the score model doesn't provide a description, try to look one
+ * up in the text bundle, falling back on its name
+ */
+ String tooltip = sm.getDescription();
+ if (tooltip == null)
+ {
+ tooltip = MessageManager.getStringOrReturn("label.score_model_",
+ name);
+ }
+ jm.setToolTipText(tooltip);
jm.setSelected(pcaModel.getScoreModelName().equals(name));
if ((pcaModel.isNucleotide() && sm.isDNA())
|| (!pcaModel.isNucleotide() && sm.isProtein()))
assertTrue(sm instanceof SimilarityScoreModelI);
assertTrue(sm instanceof PairwiseScoreModelI);
assertFalse(sm instanceof DistanceScoreModelI);
- assertEquals(sm.getName(), "% Identity (PID)");
+ assertEquals(sm.getName(), "PID");
assertEquals(((PairwiseScoreModelI) sm).getPairwiseScore('R', 'C'), 0f);
assertEquals(((PairwiseScoreModelI) sm).getPairwiseScore('R', 'r'), 1f);