JAL-4464 also knowndefect for not storing/restoring group associated secondary structure consensus
secondary structure for an alignment of protein sequences where one or
more sequences have secondary structure annotation, in the same way
as is done with the <a href="consensus.html">sequence consensus</a>.</p>
+ <p>Secondary structure consensus rows will only be shown if
+ there are secondary structure data available for two or more
+ sequences in the alignment.</p>
<p>
<em>Sources of secondary structure data</em></p>
<p>Sequences can have several different secondary structure
</strong><em> Enable or disable the display of the Consensus Logo
above the consensus sequence.</em></li>
<li><strong>Show SS Consensus Histogram<br>
- </strong><em> Enable or disable the display of histogram for Secondary Structure Consensus.</em></li>
+ </strong><em> Enable or disable the display of histogram for
+ Secondary Structure Consensus.</em><br/><br/><em>Note:
+ consensus secondary structure rows are not shown when no secondary
+ structure annotations are present for sequences in the alignment.
+ Use <strong><a href="popupmenu.html#addrefannot">Add Reference Annotation</a></strong>
+ from the sequence or selection popup menu to add annotations from
+ structures or secondary structure predictions associated with
+ the sequences in the alignment.</em></li>
<li><strong>Normalise Consensus Logo<br>
</strong><em>When enabled, scales all logo stacks to the same
height, making it easier to compare symbol diversity in
(only available for protein alignments).</em></li>
<li><strong>Group Consensus<br>
</strong><em> When ticked, display a consensus row for all groups.</em></li>
+ <li><strong>Group Secondary Structure Consensus<br>
+ </strong><em> When ticked, display a consensus secondary structure row for all groups.</em></li>
</ul></li>
</ul>
<p> </p>
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_ssconsensus_histogram = Show SS Consensus Histogram
label.apply_all_groups = Apply to all groups
label.autocalculated_annotation = Autocalculated Annotation
label.show_secondary_structure = Show Secondary Structure
+label.show_secondary_structure_consensus = Show Secondary Structure Consensus
label.show_first = Show first
label.show_last = Show last
label.struct_from_pdb = Process secondary structure from PDB
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.ssconsensus_descr = Secondary Structure Consensus
label.complement_consensus_descr = PID for cDNA
label.strucconsensus_descr = PID for base pairs
label.occupancy_descr = Number of aligned positions
return null; // No radio button is selected
}
+ protected void showSSConsensus_actionPerformed(ActionEvent e)
+ {
+ viewport.setShowSSConsensus(showSSConsensus.getState());
+ alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
+ }
+
/*
* (non-Javadoc)
*
alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
}
+
+
+ @Override
+ protected void showGroupSSConsensus_actionPerformed(ActionEvent e)
+ {
+ viewport.setShowGroupSSConsensus(showGroupSSConsensus.getState());
+ alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
+
+ }
/*
* (non-Javadoc)
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;
-import java.awt.Menu;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
import jalview.analysis.GeneticCodes;
import jalview.api.SplitContainerI;
import jalview.bin.Cache;
-import jalview.bin.Console;
import jalview.gui.JvSwingUtils;
import jalview.gui.Preferences;
import jalview.io.FileFormats;
-import jalview.log.JLoggerLog4j;
import jalview.schemes.ResidueColourScheme;
-import jalview.util.Log4j;
import jalview.util.MessageManager;
import jalview.util.Platform;
protected JCheckBoxMenuItem jPred = new JCheckBoxMenuItem();
+ protected JCheckBoxMenuItem showSSConsensus = new JCheckBoxMenuItem();
+
+ protected JCheckBoxMenuItem showGroupSSConsensus = new JCheckBoxMenuItem();
+
protected JCheckBoxMenuItem showGroupConsensus = new JCheckBoxMenuItem();
protected JCheckBoxMenuItem showGroupConservation = new JCheckBoxMenuItem();
});
+ showSSConsensus.setText(MessageManager
+ .getString("label.show_secondary_structure_consensus"));
+ showSSConsensus.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showSSConsensus_actionPerformed(e);
+ }
+
+ });
+
+ 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"));
showGroupConsensus.addActionListener(new ActionListener()
autoAnnMenu.add(showSSConsensusHistogram);
autoAnnMenu.add(showSequenceLogo);
autoAnnMenu.add(normaliseSequenceLogo);
+ // autoAnnMenu.add(showSSConsensus);
autoAnnMenu.addSeparator();
autoAnnMenu.add(showGroupConservation);
autoAnnMenu.add(showGroupConsensus);
+ autoAnnMenu.add(showGroupSSConsensus);
annotationsMenu.add(autoAnnMenu);
sort.add(sortIDMenuItem);
// selectMenu.addSeparator();
// selectMenu.add(listenToViewSelections);
}
+
+
+ protected void showSSConsensus_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
protected void createPNG_actionPerformed(ActionEvent object)
{
// TODO Auto-generated method stub
}
-
protected void showGroupConsensus_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
}
+ protected void showGroupSSConsensus_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
protected void showGroupConservation_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
import java.util.Map;
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
-import jalview.analysis.Connectivity;
import jalview.analysis.Conservation;
import jalview.analysis.TreeModel;
import jalview.api.AlignCalcManagerI;
*/
protected boolean showGroupConsensus = false;
+ protected boolean showGroupSSConsensus = false;
+
/**
* should consensus profile be rendered by default
*/
return showGroupConsensus;
}
+ public boolean isShowGroupSSConsensus()
+ {
+ return showGroupSSConsensus;
+ }
+
/**
* @param showGroupConsensus
* the showGroupConsensus to set
this.showGroupConsensus = showGroupConsensus;
}
+ public void setShowGroupSSConsensus(boolean showGroupSSConsensus)
+ {
+ this.showGroupSSConsensus = showGroupSSConsensus;
+ }
+
+ /**
+ * @param showSSConsensus
+ * the showSSConsensus to set
+ */
+ public void setShowSSConsensus(boolean showSSConsensus)
+ {
+ this.showSSConsensus = showSSConsensus;
+ }
+
/**
*
* @return flag to indicate if the consensus histogram should be rendered by
boolean updateCalcs = false;
boolean conv = isShowGroupConservation();
boolean cons = isShowGroupConsensus();
+ boolean sscons = isShowGroupSSConsensus();
boolean showprf = isShowSequenceLogo();
boolean showSSprf = isShowSequenceSSLogo();
boolean showConsHist = isShowConsensusHistogram();
{
updateCalcs = true;
alignment.addAnnotation(sg.getConsensus(), 0);
+ }
+ if (sscons)
+ {
+ updateCalcs = true;
alignment.addAnnotation(sg.getSSConsensus(), 0);
}
// refresh the annotation rows
try
{
AlignmentAnnotation ssConsensus = getSSConsensusAnnotation();
- AlignmentAnnotation gap = getGapAnnotation();
- if ((ssConsensus == null && gap == null) || calcMan.isPending(this))
+ if ((ssConsensus == null) || calcMan.isPending(this))
{
calcMan.workerComplete(this);
return;
{
ssConsensus.annotations = new Annotation[aWidth];
}
- AlignmentAnnotation gap = getGapAnnotation();
- if (gap != null)
- {
- gap.annotations = new Annotation[aWidth];
- }
}
/**
}
/**
- * Get the Gap annotation for the alignment
- *
- * @return
- */
- protected AlignmentAnnotation getGapAnnotation()
- {
- return alignViewport.getAlignmentGapAnnotation();
- }
-
- /**
* update the consensus annotation from the sequence profile data using
* current visualization settings.
*/
&& hSSConsensus != null)
{
deriveSSConsensus(ssConsensus, hSSConsensus);
- AlignmentAnnotation gap = getGapAnnotation();
- if (gap != null)
- {
- deriveGap(gap, hSSConsensus);
- }
ssConsensus.hasData=hSSConsensus.getCount()>0;
}
}
/**
- * Convert the computed consensus data into a gap annotation row for display.
- *
- * @param gapAnnotation
- * the annotation to be populated
- * @param hconsensus
- * the computed consensus data
- */
- protected void deriveGap(AlignmentAnnotation gapAnnotation,
- ProfilesI hconsensus)
- {
- long nseq = getSequences().length;
- AAFrequency.completeGapAnnot(gapAnnotation, hconsensus,
- hconsensus.getStartColumn(), hconsensus.getEndColumn() + 1,
- nseq);
- }
-
- /**
* Get the consensus data stored on the viewport.
*
* @return