label.hide_selected_annotations = Hide selected annotations
label.show_selected_annotations = Show selected annotations
label.group_consensus = Group Consensus
+label.group_ss_consensus = Group Secondary Structure Consensus
label.group_conservation = Group Conservation
label.show_consensus_histogram = Show Consensus Histogram
label.show_consensus_logo = Show Consensus Logo
import java.util.Map;
import jalview.analysis.AAFrequency;
+import jalview.analysis.AlignmentUtils;
import jalview.analysis.Conservation;
import jalview.renderer.ResidueShader;
import jalview.renderer.ResidueShaderI;
private boolean showSSConsensusHistogram;
private AnnotatedCollectionI context;
+
+ public Map<String, ProfilesI> hSSConsensusProfileMap;
/**
* Creates a new SequenceGroup object.
cs.setConsensus(cnsns);
upd = true;
}
-
- Map<String, ProfilesI> hSSConsensusProfileMap = new HashMap<String, ProfilesI>();
+
+ hSSConsensusProfileMap = new HashMap<String, ProfilesI>();
List <String> ssSources = new ArrayList<String>();
+ AnnotatedCollectionI aa = this.getContext();
- //ssSources = AlignmentUtils.extractSSSourceInAlignmentAnnotation(ssConsensus.toArray());
+ if(aa !=null )
+ {
+ ssSources = AlignmentUtils.extractSSSourceInAlignmentAnnotation(aa.getAlignmentAnnotation());
+ }
if(ssSources != null) {
ssSources.add(MessageManager.getString("option.ss_providers_all"));
: endRes + 1;
aa.annotations = null;
aa.annotations = new Annotation[aWidth]; // should be alignment width
-
+
AAFrequency.completeSSConsensus(aa, profile, startRes, endRes + 1,
ignoreGapsInConsensus, showSequenceLogo, nseq); // TODO: setting
// container
{
return null;
}
- if (ssConsensus == null)
+ if (ssConsensus == null && ssSources!=null)
{
ssConsensus = new ArrayList<AlignmentAnnotation>();
}
+ @Override
+ protected void showGroupSSConsensus_actionPerformed(ActionEvent e)
+ {
+ viewport.setShowGroupSSConsensus(showGroupSSConsensus.getState());
+ alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
+
+ }
/*
* (non-Javadoc)
*
protected JMenuItem expandViews = new JMenuItem();
- protected JCheckBoxMenuItem showSSConsensus = new JCheckBoxMenuItem();
+ protected JCheckBoxMenuItem showSSConsensus = new JCheckBoxMenuItem();
+
+ protected JCheckBoxMenuItem showGroupSSConsensus = new JCheckBoxMenuItem();
protected JCheckBoxMenuItem showGroupConsensus = new JCheckBoxMenuItem();
}
});
+
+ showGroupSSConsensus
+ .setText(MessageManager.getString("label.group_ss_consensus"));
+ showGroupSSConsensus.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showGroupSSConsensus_actionPerformed(e);
+ }
+
+ });
showGroupConsensus
.setText(MessageManager.getString("label.group_consensus"));
autoAnnMenu.add(showConsensusHistogram);
autoAnnMenu.add(showSequenceLogo);
autoAnnMenu.add(normaliseSequenceLogo);
- autoAnnMenu.add(showSSConsensus);
+ //autoAnnMenu.add(showSSConsensus);
autoAnnMenu.addSeparator();
autoAnnMenu.add(showGroupConservation);
autoAnnMenu.add(showGroupConsensus);
+ autoAnnMenu.add(showGroupSSConsensus);
annotationsMenu.add(autoAnnMenu);
sort.add(sortIDMenuItem);
// TODO Auto-generated method stub
}
+
+ protected void showGroupSSConsensus_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
protected void showGroupConservation_actionPerformed(ActionEvent e)
{
if(aa.autoCalculated && aa.label.startsWith(MessageManager.getString("label.ssconsensus_label")))
{
- if(hSSconsensus!=null) {
+
+ if(aa.groupRef != null && aa.groupRef.hSSConsensusProfileMap != null
+ && aa.groupRef.isShowSequenceLogo()) {
+ for (String source : aa.groupRef.hSSConsensusProfileMap.keySet()) {
+ if(aa.description.startsWith(source)) {
+
+ return AAFrequency.extractProfile(
+ aa.groupRef.hSSConsensusProfileMap.get(source).get(column),
+ aa.groupRef.getIgnoreGapsConsensus());
+ }
+ }
+ }
+
+ if(hSSconsensus!=null && aa.groupRef == null) {
for (String source : hSSconsensus.keySet()) {
if(aa.description.startsWith(source)) {
// settings appropriately
// TODO: generalise this to have render styles for consensus/profile
// data
- if (row.groupRef != null && row == row.groupRef.getConsensus())
+ if (row.groupRef != null &&
+ (row == row.groupRef.getConsensus() || row.groupRef.getSSConsensus(null).contains(row)))
{
renderHistogram = row.groupRef.isShowConsensusHistogram();
renderProfile = row.groupRef.isShowSequenceLogo();
* should consensus rows be shown for groups
*/
protected boolean showGroupConsensus = false;
+
+
+ protected boolean showGroupSSConsensus = false;
/**
* should consensus profile be rendered by default
{
return showGroupConsensus;
}
+
+ public boolean isShowGroupSSConsensus()
+ {
+ return showGroupSSConsensus;
+ }
+
/**
* @param showGroupConsensus
this.showGroupConsensus = showGroupConsensus;
}
+ public void setShowGroupSSConsensus(boolean showGroupSSConsensus)
+ {
+ this.showGroupSSConsensus = showGroupSSConsensus;
+ }
+
/**
* @param showSSConsensus
* the showSSConsensus to set
boolean updateCalcs = false;
boolean conv = isShowGroupConservation();
boolean cons = isShowGroupConsensus();
+ boolean sscons = isShowGroupSSConsensus();
boolean showprf = isShowSequenceLogo();
boolean showConsHist = isShowConsensusHistogram();
boolean normLogo = isNormaliseSequenceLogo();
{
updateCalcs = true;
alignment.addAnnotation(sg.getConsensus(), 0);
-
+ }
+ if(sscons)
+ {
+ updateCalcs = true;
List<String> secondaryStructureSources = getSecondaryStructureSources();
if(secondaryStructureSources !=null) {
List<AlignmentAnnotation> ssAa = sg.getSSConsensus(secondaryStructureSources);