</strong><em>If this is selected the "Annotation Panel" will be
displayed below the alignment. The default setting is to display the conservation
calculation, quality calculation and consensus values as bar charts. </em></li>
+ <li><strong>Autocalculated Annotation<br></strong>Settings for the display of autocalculated annotation.
+ <ul><li>
+ <strong>Apply to all groups<br></strong>
+ When ticked, any settings will be applied to all autocalculated annotation.
+ </li>
+ <li>
+ <strong>Show Consensus Histogram<br></strong>
+ Enable or disable the display of the histogram above the consensus sequence.
+ </li>
+ <li>
+ <strong>Show Consensus Profile<br></strong>
+ Enable or disable the display of the sequence logo above the consensus sequence.
+ </li>
+ <li>
+ <strong>Group Conservation<br></strong>
+ When ticked, display a conservation row for all groups (only available for protein alignments).
+ </li>
+ <li>
+ <strong>Apply to all groups<br></strong>
+ When ticked, display a consensus row for all groups.
+ </li>
+ </ul>
+ </li>
<li><strong>Automatic Scrolling<br>
</strong><em>When selected, the view will automatically scroll to display the
highlighted sequence position corresponding to the position under the mouse
* <li>SORT_BY_TREE (false) sort the current alignment view according to the
* order of a newly displayed tree</li>
* <li>DBFETCH_USEPICR (false) use PICR to recover valid DB references from sequence ID strings before attempting retrieval from any datasource</li>
- * <li>
- * </li>
+ * <li>SHOW_GROUP_CONSENSUS (false) Show consensus annotation for groups in the alignment.</li>
+ * <li>SHOW_GROUP_CONSERVATION (false) Show conservation annotation for groups in the alignment.</li>
+ * <li>SHOW_CONSENSUS_HISTOGRAM (false) Show consensus annotation row's histogram.</li>
+ * <li>SHOW_CONSENSUS_PROFILE (false) Show consensus annotation row's sequence logo.</li>
+ *
+ * <li></li>
*
* <li></li>
*
showTranslation.setVisible(nucleotide);
conservationMenuItem.setEnabled(!nucleotide);
modifyConservation.setEnabled(!nucleotide);
-
+ showGroupConservation.setEnabled(!nucleotide);
// Remember AlignFrame always starts as protein
if (!nucleotide)
{
showUnconservedMenuItem.setSelected(av.showUnconserved);
showGroupConsensus.setSelected(av.showGroupConsensus);
showGroupConservation.setSelected(av.showGroupConservation);
+ showConsensusHistogram.setSelected(av.showConsensusHistogram);
+ showConsensusProfile.setSelected(av.showConsensusProfile);
setColourSelected(ColourSchemeProperty.getColourName(av
.getGlobalColourScheme()));
protected void showGroupConsensus_actionPerformed(ActionEvent e)
{
viewport.setShowGroupConsensus(showGroupConsensus.getState());
- alignPanel.updateAnnotation();
+ alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
}
protected void showGroupConservation_actionPerformed(ActionEvent e)
{
viewport.setShowGroupConservation(showGroupConservation.getState());
- alignPanel.updateAnnotation();
+ alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
+ }
+
+ /* (non-Javadoc)
+ * @see jalview.jbgui.GAlignFrame#showConsensusHistogram_actionPerformed(java.awt.event.ActionEvent)
+ */
+ protected void showConsensusHistogram_actionPerformed(ActionEvent e)
+ {
+ viewport.setShowConsensusHistogram(showConsensusHistogram.getState());
+ alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
+ }
+
+ /* (non-Javadoc)
+ * @see jalview.jbgui.GAlignFrame#showConsensusProfile_actionPerformed(java.awt.event.ActionEvent)
+ */
+ protected void showConsensusProfile_actionPerformed(ActionEvent e)
+ {
+ viewport.setShowConsensusProfile(showConsensusProfile.getState());
+ alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
+ }
+ protected void applyAutoAnnotationSettings_actionPerformed(ActionEvent e)
+ {
+ alignPanel.updateAnnotation(applyAutoAnnotationSettings.getState());
}
/*
alignment.addAnnotation(quality);
}
+ showGroupConservation = Cache.getDefault("SHOW_GROUP_CONSERVATION", false);
+
+ {
+
+ }
}
+ showConsensusHistogram = Cache.getDefault("SHOW_CONSENSUS_HISTOGRAM", true);
+ showConsensusProfile = Cache.getDefault("SHOW_CONSENSUS_PROFILE", false);
+ showGroupConsensus = Cache.getDefault("SHOW_GROUP_CONSENSUS", false);
// TODO: add menu option action that nulls or creates consensus object depending on if the user wants to see the annotation or not in a specific alignment
consensus = new AlignmentAnnotation("Consensus", "PID",
new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
* should consensus rows be shown for groups
*/
boolean showGroupConsensus = false;
+ /**
+ * should consensus profile be rendered by default
+ */
+ public boolean showConsensusProfile = false;
+ /**
+ * should consensus histograms be rendered by default
+ */
+ public boolean showConsensusHistogram = true;
+ /**
+ * @return the showConsensusProfile
+ */
+ public boolean isShowConsensusProfile()
+ {
+ return showConsensusProfile;
+ }
+ /**
+ * @param showConsensusProfile the showConsensusProfile to set
+ */
+ public void setShowConsensusProfile(boolean showConsensusProfile)
+ {
+ this.showConsensusProfile = showConsensusProfile;
+ }
+ /**
+ * @param showConsensusHistogram the showConsensusHistogram to set
+ */
+ public void setShowConsensusHistogram(boolean showConsensusHistogram)
+ {
+ this.showConsensusHistogram = showConsensusHistogram;
+ }
/**
* @return the showGroupConservation
this.includeAllConsensusSymbols = includeAllConsensusSymbols;
}
+ /**
+ *
+ * @return flag to indicate if the consensus histogram should be rendered by default
+ */
+ public boolean isShowConsensusHistogram()
+ {
+ return this.showConsensusHistogram;
+ }
+
}
import java.beans.*;
import java.io.*;
+import java.util.Hashtable;
import java.util.Vector;
import java.awt.*;
*/
public void updateAnnotation()
{
+ updateAnnotation(false);
+ }
+ public void updateAnnotation(boolean applyGlobalSettings)
+ {
boolean updateCalcs = false;
boolean conv = av.isShowGroupConservation();
boolean cons = av.isShowGroupConsensus();
+ boolean showprf = av.isShowConsensusProfile();
+ boolean showConsHist = av.isShowConsensusHistogram();
+
boolean sortg = true;
// remove old automatic annotation
// intersect alignment annotation with alignment groups
AlignmentAnnotation[] aan = av.alignment.getAlignmentAnnotation();
+ Hashtable oldrfs = new Hashtable();
for (int an = 0; an < aan.length; an++)
{
if (aan[an].autoCalculated && aan[an].groupRef != null)
{
+ oldrfs.put(aan[an].groupRef, aan[an].groupRef);
av.alignment.deleteAnnotation(aan[an]);
aan[an] = null;
}
{
updateCalcs = false;
sg = (SequenceGroup) gr.elementAt(g);
-
+ if (applyGlobalSettings || !oldrfs.containsKey(sg))
+ {
+ // set defaults for this group's conservation/consensus
+ sg.setIncludeAllConsSymbols(showprf);
+ sg.setShowConsensusHistogram(showConsHist);
+ }
if (conv)
{
updateCalcs = true;
sg.recalcConservation();
}
}
+ oldrfs.clear();
adjustAnnotationHeight();
}
}
{
if (aa[selectedRow].groupRef!=null)
{
- ap.seqPanel.ap.idPanel.highlightSearchResults(aa[selectedRow].groupRef.getSequences(null));
if (evt.getClickCount()>=2)
{
// todo: make the ap scroll to the selection
- ap.av.setSelectionGroup(new SequenceGroup(aa[selectedRow].groupRef));
+ ap.seqPanel.ap.idPanel.highlightSearchResults(null);
+ ap.av.setSelectionGroup(//new SequenceGroup(
+ aa[selectedRow].groupRef); // );
ap.paintAlignment(false);
+ } else {
+ ap.seqPanel.ap.idPanel.highlightSearchResults(aa[selectedRow].groupRef.getSequences(null));
}
return;
} else
// av and sequencegroup need to implement same interface for
if (aaa.groupRef != null)
{
+ final JCheckBoxMenuItem chist = new JCheckBoxMenuItem(
+ "Show Group Histogram", aa[selectedRow].groupRef
+ .isShowConsensusHistogram());
+ chist.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ // TODO: pass on reference
+ // to ap
+ // so the
+ // view
+ // can be
+ // updated.
+ aaa.groupRef.setShowConsensusHistogram(chist.getState());
+ ap.repaint();
+ // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+ }
+ });
+ pop.add(chist);
final JCheckBoxMenuItem cprof = new JCheckBoxMenuItem(
- "Show Full Profile", aa[selectedRow].groupRef
+ "Show Group Logo", aa[selectedRow].groupRef
.isIncludeAllConsSymbols());
cprof.addActionListener(new ActionListener()
{
});
pop.add(cprof);
} else {
-/* final JCheckBoxMenuItem cprof = new JCheckBoxMenuItem(
- "Show Full Profile", aa[selectedRow].groupRef
- .isIncludeAllConsSymbols());
+ final JCheckBoxMenuItem chist = new JCheckBoxMenuItem(
+ "Show Histogram", av.isShowConsensusHistogram());
+ chist.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent e)
+ {
+ // TODO: pass on reference
+ // to ap
+ // so the
+ // view
+ // can be
+ // updated.
+ av.setShowConsensusHistogram(chist.getState());
+ ap.repaint();
+ // ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+ }
+ });
+ pop.add(chist);
+ final JCheckBoxMenuItem cprof = new JCheckBoxMenuItem(
+ "Show Logo", av.isShowConsensusProfile());
cprof.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
// view
// can be
// updated.
- aaa.groupRef.setIncludeAllConsSymbols(cprof.getState());
+ av.setShowConsensusProfile(cprof.getState());
ap.repaint();
// ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
}
});
- pop.add(cprof); */
+ pop.add(cprof);
}
final JMenuItem consclipbrd = new JMenuItem(COPYCONS_SEQ);
consclipbrd.addActionListener(this);
*/
groupURLLinks = new Vector();
- groupURLLinks.addElement("UNIPROT|EnVision2|http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?workflow=Default&datasetName=JalviewIDs$DATASETID$&input=$SEQUENCEIDS$&inputType=0|,");
- // TODO: make sequence Group URL links more efficiently generated so popup menu does not take so long.
- // groupURLLinks.addElement("Seqs|EnVision2|http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?workflow=Default&datasetName=JalviewSeqs$DATASETID$&input=$SEQUENCES=/([A-Za-z]+)+/=$&inputType=1|,");
+ groupURLLinks.addElement("UNIPROT|EnVision2|http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?tool=Jalview&workflow=Default&datasetName=JalviewIDs$DATASETID$&input=$SEQUENCEIDS$&inputType=0|,");
+ groupURLLinks.addElement("Seqs|EnVision2|http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?tool=Jalview&workflow=Default&datasetName=JalviewSeqs$DATASETID$&input=$SEQUENCES=/([A-Za-z]+)+/=$&inputType=1|,");
}
fullScreen.setSelected(Cache.getDefault("SHOW_FULLSCREEN", false));
annotations.setSelected(Cache.getDefault("SHOW_ANNOTATIONS", true));
- conservation.setEnabled(Cache.getDefault("SHOW_ANNOTATIONS", true));
- quality.setEnabled(Cache.getDefault("SHOW_ANNOTATIONS", true));
- identity.setEnabled(Cache.getDefault("SHOW_ANNOTATIONS", true));
-
conservation.setSelected(Cache.getDefault("SHOW_CONSERVATION", true));
quality.setSelected(Cache.getDefault("SHOW_QUALITY", true));
identity.setSelected(Cache.getDefault("SHOW_IDENTITY", true));
autoCalculateConsCheck.setSelected(Cache.getDefault(
"AUTO_CALC_CONSENSUS", true));
+ showGroupConsensus.setSelected(Cache.getDefault("SHOW_GROUP_CONSENSUS",false));
+ showGroupConservation.setSelected(Cache.getDefault("SHOW_GROUP_CONSERVATION", false));
+ showConsensHistogram.setSelected(Cache.getDefault("SHOW_CONSENSUS_HISTOGRAM",true));
+ showConsensProfile.setSelected(Cache.getDefault("SHOW_CONSENSUS_PROFILE",false));
+
padGaps.setSelected(Cache.getDefault("PAD_GAPS", false));
/***************************************************************************
usagestats.setSelected(Cache.getDefault("USAGESTATS", false));
questionnaire.setSelected(Cache.getProperty("NOQUESTIONNAIRES")==null); // note antisense here
versioncheck.setSelected(Cache.getDefault("VERSION_CHECK", true)); // default is true
-
+ annotations_actionPerformed(null); // update the display of the annotation settings
try
{
jbInit();
Cache.applicationProperties.setProperty("ID_ITALICS", Boolean
.toString(idItalics.isSelected()));
Cache.applicationProperties.setProperty("SHOW_UNCONSERVED",Boolean.toString(showUnconserved.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_GROUP_CONSENSUS",Boolean.toString(showGroupConsensus.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_GROUP_CONSERVATION",Boolean.toString(showGroupConservation.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_CONSENSUS_HISTOGRAM",Boolean.toString(showConsensHistogram.isSelected()));
+ Cache.applicationProperties.setProperty("SHOW_CONSENSUS_PROFILE",Boolean.toString(showConsensProfile.isSelected()));
Cache.applicationProperties.setProperty("ANTI_ALIAS", Boolean
.toString(smoothFont.isSelected()));
conservation.setEnabled(annotations.isSelected());
quality.setEnabled(annotations.isSelected());
identity.setEnabled(annotations.isSelected());
+ showConsensHistogram.setEnabled(annotations.isSelected());
+ showConsensProfile.setEnabled(annotations.isSelected());
+ showGroupConsensus.setEnabled(annotations.isSelected());
+ showGroupConservation.setEnabled(annotations.isSelected());
}
public void newLink_actionPerformed(ActionEvent e)
private JMenuItem justifyLeftMenuItem=new JMenuItem();
private JMenuItem justifyRightMenuItem=new JMenuItem();
-
+
+ JMenu autoAnnMenu = new JMenu();
protected JCheckBoxMenuItem showGroupConsensus=new JCheckBoxMenuItem();
protected JCheckBoxMenuItem showGroupConservation=new JCheckBoxMenuItem();
+ protected JCheckBoxMenuItem showConsensusHistogram=new JCheckBoxMenuItem();
+ protected JCheckBoxMenuItem showConsensusProfile=new JCheckBoxMenuItem();
+ protected JCheckBoxMenuItem applyAutoAnnotationSettings=new JCheckBoxMenuItem();
private JMenuItem grpsFromSelection = new JMenuItem();
public GAlignFrame()
}
});
+ showConsensusHistogram.setText("Show Consensus Histogram");
+ showConsensusHistogram.addActionListener(new ActionListener()
+ {
+
+ public void actionPerformed(ActionEvent e)
+ {
+ showConsensusHistogram_actionPerformed(e);
+ }
+
+ });
+ showConsensusProfile.setText("Show Consensus Logo");
+ showConsensusProfile.addActionListener(new ActionListener()
+ {
+
+ public void actionPerformed(ActionEvent e)
+ {
+ showConsensusProfile_actionPerformed(e);
+ }
+
+ });
+ applyAutoAnnotationSettings.setText("Apply to all groups");
+ applyAutoAnnotationSettings.setState(false);
+ applyAutoAnnotationSettings.setVisible(true);
+ applyAutoAnnotationSettings.addActionListener(new ActionListener()
+ {
+
+ public void actionPerformed(ActionEvent e)
+ {
+ applyAutoAnnotationSettings_actionPerformed(e);
+ }
+
+ });
nucleotideColour.setText("Nucleotide");
nucleotideColour.addActionListener(new java.awt.event.ActionListener()
}
});
tooltipSettingsMenu.setText("Sequence ID Tooltip");
+ autoAnnMenu.setText("Autocalculated Annotation");
alignFrameMenuBar.add(fileMenu);
alignFrameMenuBar.add(editMenu);
alignFrameMenuBar.add(selectMenu);
viewMenu.addSeparator();
viewMenu.add(followHighlightMenuItem);
viewMenu.add(annotationPanelMenuItem);
- viewMenu.add(showGroupConservation);
- viewMenu.add(showGroupConsensus);
+ autoAnnMenu.add(applyAutoAnnotationSettings);
+ autoAnnMenu.add(showConsensusHistogram);
+ autoAnnMenu.add(showConsensusProfile);
+ autoAnnMenu.addSeparator();
+ autoAnnMenu.add(showGroupConservation);
+ autoAnnMenu.add(showGroupConsensus);
+ viewMenu.add(autoAnnMenu);
viewMenu.addSeparator();
viewMenu.add(showSeqFeatures);
//viewMenu.add(showSeqFeaturesHeight);
selectMenu.add(grpsFromSelection);
}
+ protected void applyAutoAnnotationSettings_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void showConsensusHistogram_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void showConsensusProfile_actionPerformed(ActionEvent e)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
protected void makeGrpsFromSelection_actionPerformed(ActionEvent e)
{
// TODO Auto-generated method stub
JPanel jPanel3 = new JPanel();
+ JPanel autoAnnotSettings1 = new JPanel();
+
+ JPanel autoAnnotSettings2 = new JPanel();
+
JPanel exportTab = new JPanel();
JLabel epsLabel = new JLabel();
protected JCheckBox usagestats = new JCheckBox();
protected JCheckBox questionnaire = new JCheckBox();
protected JCheckBox versioncheck = new JCheckBox();
+ protected JLabel showGroupbits = new JLabel();
+ protected JLabel showConsensbits = new JLabel();
+ protected JCheckBox showConsensProfile = new JCheckBox();
+ protected JCheckBox showConsensHistogram = new JCheckBox();
+ protected JCheckBox showGroupConsensus = new JCheckBox();
+ protected JCheckBox showGroupConservation = new JCheckBox();
/**
* Creates a new GPreferences object.
identity.setHorizontalTextPosition(SwingConstants.LEFT);
identity.setSelected(true);
identity.setText("Consensus");
+ showGroupbits.setFont(verdana11);
+ showGroupbits.setHorizontalAlignment(SwingConstants.RIGHT);
+ showGroupbits.setHorizontalTextPosition(SwingConstants.LEFT);
+ showGroupbits.setText("Group:");
+ showConsensbits.setFont(verdana11);
+ showConsensbits.setHorizontalAlignment(SwingConstants.RIGHT);
+ showConsensbits.setHorizontalTextPosition(SwingConstants.LEFT);
+ showConsensbits.setText("Consensus:");
+ showConsensHistogram.setEnabled(false);
+ showConsensHistogram.setFont(verdana11);
+ showConsensHistogram.setHorizontalAlignment(SwingConstants.RIGHT);
+ showConsensHistogram.setHorizontalTextPosition(SwingConstants.LEFT);
+ showConsensHistogram.setSelected(true);
+ showConsensHistogram.setText("Histogram");
+ showConsensProfile.setEnabled(false);
+ showConsensProfile.setFont(verdana11);
+ showConsensProfile.setHorizontalAlignment(SwingConstants.RIGHT);
+ showConsensProfile.setHorizontalTextPosition(SwingConstants.LEFT);
+ showConsensProfile.setSelected(true);
+ showConsensProfile.setText("Profile");
+ showGroupConsensus.setEnabled(false);
+ showGroupConsensus.setFont(verdana11);
+ showGroupConsensus.setHorizontalAlignment(SwingConstants.RIGHT);
+ showGroupConsensus.setHorizontalTextPosition(SwingConstants.LEFT);
+ showGroupConsensus.setSelected(true);
+ showGroupConsensus.setText("Consensus");
+ showGroupConservation.setEnabled(false);
+ showGroupConservation.setFont(verdana11);
+ showGroupConservation.setHorizontalAlignment(SwingConstants.RIGHT);
+ showGroupConservation.setHorizontalTextPosition(SwingConstants.LEFT);
+ showGroupConservation.setSelected(true);
+ showGroupConservation.setText("Conservation");
annotations.setFont(verdana11);
annotations.setHorizontalAlignment(SwingConstants.RIGHT);
annotations.setHorizontalTextPosition(SwingConstants.LEFT);
jPanel2.setLayout(gridLayout2);
gridLayout2.setRows(13);
jPanel3.setBounds(new Rectangle(173, 35, 274, 26));
+ autoAnnotSettings1.setBounds(new Rectangle(173,53,274,26));// new Rectangle(173, 116, 274, 78));
+ autoAnnotSettings2.setBounds(new Rectangle(173,72,274,26));
exportTab.setLayout(null);
epsLabel.setFont(verdana11);
epsLabel.setHorizontalAlignment(SwingConstants.RIGHT);
visualTab.add(fontNameCB);
visualTab.add(fontSizeCB);
visualTab.add(fontStyleCB);
+ visualTab.add(autoAnnotSettings1);
+ visualTab.add(autoAnnotSettings2);
jPanel3.add(conservation);
jPanel3.add(identity);
jPanel3.add(quality);
+ autoAnnotSettings1.setLayout(new FlowLayout());
+ autoAnnotSettings2.setLayout(new FlowLayout());
+ autoAnnotSettings1.add(showConsensbits);
+ autoAnnotSettings1.add(showConsensHistogram);
+ autoAnnotSettings1.add(showConsensProfile);
+ autoAnnotSettings2.add(showGroupbits);
+ autoAnnotSettings2.add(showGroupConsensus);
+ autoAnnotSettings2.add(showGroupConservation);
visualTab.add(jPanel2);
linkPanel.add(editLinkButtons, BorderLayout.EAST);