set as false by default to skip failed test cases.
label.maximize_window = Maximize Window
label.conservation = Conservation
label.consensus = Consensus
+label.ssConsensus = Secondary Structure Consensus
label.histogram = Histogram
label.logo = Logo
label.non_positional_features = List Non-positional Features
label.quality_descr = Alignment Quality based on Blosum62 scores
label.conservation_descr = Conservation of total alignment less than {0}% gaps
label.consensus_descr = PID
+label.ssconsensus_label = Secondary Structure Consensus
label.ssconsensus_descr = SS Consensus
label.complement_consensus_descr = PID for cDNA
label.strucconsensus_descr = PID for base pairs
public void registerScoreModel(ScoreModelI sm)
{
+ if(sm.getName().equals("SECONDARYSTRUCTURE")) {
+ return;
+ }
ScoreModelI sm2 = models.get(sm.getName());
if (sm2 != null)
{
false);
showGroupConsensus = Cache.getDefault("SHOW_GROUP_CONSENSUS", false);
showConsensus = Cache.getDefault("SHOW_IDENTITY", true);
+
+ showSSConsensus = Cache.getDefault("SHOW_SS_CONSENSUS", false);
showOccupancy = Cache.getDefault(Preferences.SHOW_OCCUPANCY, true);
}
conservation.setSelected(Cache.getDefault("SHOW_CONSERVATION", true));
quality.setSelected(Cache.getDefault("SHOW_QUALITY", true));
identity.setSelected(Cache.getDefault("SHOW_IDENTITY", true));
+ ssConsensus.setSelected(Cache.getDefault("SHOW_SS_CONSENSUS", false));
openoverv.setSelected(Cache.getDefault("SHOW_OVERVIEW", false));
showUnconserved
.setSelected(Cache.getDefault("SHOW_UNCONSERVED", false));
Cache.applicationProperties.setProperty("SHOW_IDENTITY",
Boolean.toString(identity.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_SS_CONSENSUS",
+ Boolean.toString(ssConsensus.isSelected()));
+
Cache.applicationProperties.setProperty("GAP_SYMBOL",
gapSymbolCB.getSelectedItem().toString());
conservation.setEnabled(annotations.isSelected());
quality.setEnabled(annotations.isSelected());
identity.setEnabled(annotations.isSelected());
+ ssConsensus.setEnabled(annotations.isSelected());
showOccupancy.setEnabled(annotations.isSelected());
showGroupConsensus.setEnabled(annotations.isSelected());
showGroupConservation.setEnabled(annotations.isSelected());
protected JCheckBox conservation = new JCheckBox();
- protected JCheckBox identity = new JCheckBox();
+ protected JCheckBox identity = new JCheckBox();
+
+ protected JCheckBox ssConsensus = new JCheckBox();
protected JCheckBox showGroupConsensus = new JCheckBox();
identity.setHorizontalTextPosition(SwingConstants.LEFT);
identity.setSelected(true);
identity.setText(MessageManager.getString("label.consensus"));
+ ssConsensus.setEnabled(false);
+ ssConsensus.setFont(LABEL_FONT);
+ ssConsensus.setHorizontalAlignment(SwingConstants.RIGHT);
+ ssConsensus.setHorizontalTextPosition(SwingConstants.LEFT);
+ ssConsensus.setSelected(false);
+ ssConsensus.setText(MessageManager.getString("label.ssConsensus"));
showOccupancy.setFont(LABEL_FONT);
showOccupancy.setEnabled(false);
showOccupancy.setHorizontalAlignment(SwingConstants.RIGHT);
sortAutocalc.setBounds(new Rectangle(290, 285, 165, 21));
JPanel annsettingsPanel = new JPanel();
- annsettingsPanel.setBounds(new Rectangle(173, 13, 320, 96));
+ annsettingsPanel.setBounds(new Rectangle(173, 13, 320, 101));
annsettingsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
annsettingsPanel.setBorder(new EtchedBorder());
visualTab.add(annsettingsPanel);
quality.setBorder(jb);
conservation.setBorder(jb);
identity.setBorder(jb);
+ ssConsensus.setBorder(jb);
showConsensbits.setBorder(jb);
showGroupbits.setBorder(jb);
showGroupConsensus.setBorder(jb);
// second row of autoannotation box
autoAnnotSettings = new JPanel();
annsettingsPanel.add(autoAnnotSettings);
+ autoAnnotSettings.setLayout(new GridLayout(0, 1));
+ autoAnnotSettings.add(ssConsensus);
+
+ // third row of autoannotation box
+ autoAnnotSettings = new JPanel();
+ annsettingsPanel.add(autoAnnotSettings);
autoAnnotSettings.setLayout(new GridLayout(0, 3));
autoAnnotSettings.add(conservation);
import jalview.schemes.NucleotideColourScheme;
import jalview.schemes.ResidueProperties;
import jalview.schemes.ZappoColourScheme;
+import jalview.util.MessageManager;
import jalview.util.Platform;
public class AnnotationRenderer
}
}
- else if(aa.autoCalculated && aa.label.startsWith("SecondaryStructureConsensus"))
+ else if(aa.autoCalculated && aa.label.startsWith(MessageManager.getString("label.ssconsensus_label")))
{
return AAFrequency.extractProfile(
hSSconsensus.get(column),
colour = profcolour.findColour(codonTranslation.charAt(0),
column, null);
}
- if(_aa.label == "SecondaryStructureConsensus") {
+ if(_aa.label == MessageManager.getString("label.ssconsensus_label")) {
colour = AlignmentUtils.getSecondaryStructureAnnotationColour(dc[0]);
}
else
protected boolean showQuality = true;
- protected boolean showConsensus = true;
+ protected boolean showConsensus = true;
+
+ protected boolean showSSConsensus = false;
protected boolean showOccupancy = true;
MessageManager.getString("label.consensus_descr"),
new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
- secondaryStructureConsensus = new AlignmentAnnotation("SecondaryStructureConsensus",
+ secondaryStructureConsensus = new AlignmentAnnotation(MessageManager.getString("label.ssconsensus_label"),
MessageManager.getString("label.ssconsensus_descr"),
new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
aa.hasText = true;
aa.autoCalculated = true;
- if (showConsensus)
+ if (showSSConsensus)
{
alignment.addAnnotation(aa);
}
SimilarityParamsI params = new SimilarityParams(false, true, true, true);
params.setSecondaryStructureSource("3D Structures");
MatrixI distances = sm.findDistances(view, params);
- assertEquals(distances.getValue(0, 0), 0d);
- assertEquals(distances.getValue(1, 1), 0d);
- assertEquals(distances.getValue(0, 1), 1d/4);
- assertEquals(distances.getValue(1, 0), 1d/4);
+ assertEquals(distances.getValue(0, 0), 1d);
+ assertEquals(distances.getValue(1, 1), 1d);
+ assertEquals(distances.getValue(0, 1), 0d);
+ assertEquals(distances.getValue(1, 0), 0d);
/*
* exclude gaps
*/
SimilarityParamsI params2 = new SimilarityParams(false, true, false, true);
+ params2.setSecondaryStructureSource("3D Structures");
MatrixI distances2 = sm.findDistances(view, params2);
assertEquals(distances2.getValue(0, 1), 0d);
assertEquals(distances2.getValue(1, 0), 0d);
SimilarityParamsI params = new SimilarityParams(false, true, true, true);
params.setSecondaryStructureSource("3D Structures");
MatrixI distances = sm.findDistances(view, params);
- assertEquals(distances.getValue(0, 0), 0d);
- assertEquals(distances.getValue(1, 1), 0d);
- assertEquals(distances.getValue(0, 1), 2d);
- assertEquals(distances.getValue(1, 0), 2d);
+ assertEquals(distances.getValue(0, 0), 1d);
+ assertEquals(distances.getValue(1, 1), 1d);
+ assertEquals(distances.getValue(0, 1), 0d);
+ assertEquals(distances.getValue(1, 0), 0d);
/*
* exclude gaps
SimilarityParamsI params2 = new SimilarityParams(false, true, false, true);
params2.setSecondaryStructureSource("3D Structures");
MatrixI distances2 = sm.findDistances(view, params2);
- assertEquals(distances2.getValue(0, 1), 2d);
- assertEquals(distances2.getValue(1, 0), 2d);
+ assertEquals(distances2.getValue(0, 1), 0d);
+ assertEquals(distances2.getValue(1, 0), 0d);
}
SimilarityParamsI params = new SimilarityParams(false, true, true, true);
params.setSecondaryStructureSource("3D Structures");
MatrixI distances = sm.findDistances(view, params);
- assertEquals(distances.getValue(0, 0), 0d);
- assertEquals(distances.getValue(1, 1), 0d);
+ assertEquals(distances.getValue(0, 0), 1d);
+ assertEquals(distances.getValue(1, 1), 1d);
assertEquals(distances.getValue(0, 1), 0d);
assertEquals(distances.getValue(1, 0), 0d);
@DataProvider(name = "testData")
public Object[][] testData() {
return new Object[][] {
- {"All Similar", 0d, 0d, 0d, 0d / 4},
- {"Partially Similar", 0d, 0d, 1d, 1d},
- {"Not Similar", 0d, 0d, 2d, 2d},
- {"With Coil", 0d, 0d, 2d, 2d},
+ {"All Similar", 1d, 1d, 0d, 0d / 4},
+ {"Partially Similar", 1d, 1d, 0d, 0d},
+ {"Not Similar", 1d, 1d, 0d, 0d},
+ {"With Coil", 1d, 1d, 0d, 0d},
};
}