JAL-2629 add non-functional HMMER menu
authorTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Tue, 25 Jul 2017 11:34:26 +0000 (12:34 +0100)
committerTZVanaalten <TZVanaalten@LS30916.ad.lifesci.dundee.ac.uk>
Tue, 25 Jul 2017 11:34:26 +0000 (12:34 +0100)
resources/lang/Messages.properties
src/jalview/gui/AlignFrame.java
src/jalview/gui/AnnotationLabels.java
src/jalview/gui/PopupMenu.java
src/jalview/gui/Preferences.java
src/jalview/jbgui/GAlignFrame.java
src/jalview/jbgui/GPreferences.java

index a24e768..f05f7bc 100644 (file)
@@ -11,6 +11,7 @@ action.paste = Paste
 action.show_html_source = Show HTML Source
 action.print = Print...
 action.web_service = Web Service
+action.hmmer = HMMER
 action.cancel_job = Cancel Job
 action.start_job = Start Job
 action.revert = Revert
@@ -1311,3 +1312,9 @@ label.occupancy_descr = Number of aligned positions
 label.show_experimental = Enable experimental features
 label.show_experimental_tip = Enable any new and currently 'experimental' features (see Latest Release Notes for details)
 label.warning_hidden = Warning: {0} {1} is currently hidden
+label.change_hmmer_directory = Change HMMER suite location
+label.auto_align_seqs = Automatically Align New Sequences
+label.hmmalign = Align Sequences to HMM
+label.hmmbuild = Build HMM From Alignment
+label.hmmsearch = Search for Related Sequences
+
index 9e4f37b..b14423c 100644 (file)
@@ -383,6 +383,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       }
     });
     buildColourMenu();
+    buildHMMERMenu();
 
     if (Desktop.desktop != null)
     {
@@ -489,6 +490,19 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
   }
 
+  private void buildHMMERMenu()
+  {
+    hmmerMenu.removeAll();
+
+    hmmerMenu.add(autoAlignSeqs);
+    hmmerMenu.addSeparator();
+
+    hmmerMenu.add(hmmAlign);
+    hmmerMenu.add(hmmBuild);
+    hmmerMenu.add(hmmSearch);
+    
+  }
+
   /**
    * Change the filename and format for the alignment, and enable the 'reload'
    * button functionality.
@@ -4680,6 +4694,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             newAlignment.append(getViewport().getAlignment());
             getViewport().setAlignment(newAlignment);
             isAnnotation = true;
+            alignPanel.repaint();
 
           }
           else if (FileFormat.Jnet.equals(format))
index 445ee11..30b52f1 100755 (executable)
@@ -422,8 +422,8 @@ public class AnnotationLabels extends JPanel implements MouseListener,
     if (selectedRow < aa.length)
     {
       final String label = aa[selectedRow].label;
-      if (!(aa[selectedRow].autoCalculated
-              || label.indexOf("Information Content") > -1))
+      if (!(aa[selectedRow].autoCalculated)
+              && !(label.indexOf("Information Content") > -1))
       {
         if (aa[selectedRow].graph == AlignmentAnnotation.NO_GRAPH)
         {
index 3de7c3c..0ebd271 100644 (file)
@@ -451,7 +451,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
         buildGroupURLMenu(sg, groupLinks);
       }
       // Add a 'show all structures' for the current selection
-      Hashtable<String, PDBEntry> pdbe = new Hashtable<String, PDBEntry>(), reppdb = new Hashtable<String, PDBEntry>();
+      Hashtable<String, PDBEntry> pdbe = new Hashtable<>(), reppdb = new Hashtable<>();
       SequenceI sqass = null;
       for (SequenceI sq : ap.av.getSequenceSelection())
       {
@@ -518,7 +518,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
   void addFeatureLinks(final SequenceI seq, List<String> links)
   {
     JMenu linkMenu = new JMenu(MessageManager.getString("action.link"));
-    Map<String, List<String>> linkset = new LinkedHashMap<String, List<String>>();
+    Map<String, List<String>> linkset = new LinkedHashMap<>();
 
     for (String link : links)
     {
@@ -602,8 +602,8 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
      * the insertion order, which is the order of the annotations on the
      * alignment.
      */
-    Map<String, List<List<String>>> shownTypes = new LinkedHashMap<String, List<List<String>>>();
-    Map<String, List<List<String>>> hiddenTypes = new LinkedHashMap<String, List<List<String>>>();
+    Map<String, List<List<String>>> shownTypes = new LinkedHashMap<>();
+    Map<String, List<List<String>>> hiddenTypes = new LinkedHashMap<>();
     AlignmentAnnotationUtils.getShownHiddenTypes(shownTypes, hiddenTypes,
             AlignmentAnnotationUtils.asList(annotations), forSequences);
 
@@ -709,7 +709,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
 
     SequenceI[] seqs = ap.av.getSelectionAsNewSequence();
     String[][] idandseqs = GroupUrlLink.formStrings(seqs);
-    Hashtable<String, Object[]> commonDbrefs = new Hashtable<String, Object[]>();
+    Hashtable<String, Object[]> commonDbrefs = new Hashtable<>();
     for (int sq = 0; sq < seqs.length; sq++)
     {
 
@@ -1368,8 +1368,8 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
      * Temporary store to hold distinct calcId / type pairs for the tooltip.
      * Using TreeMap means calcIds are shown in alphabetical order.
      */
-    SortedMap<String, String> tipEntries = new TreeMap<String, String>();
-    final Map<SequenceI, List<AlignmentAnnotation>> candidates = new LinkedHashMap<SequenceI, List<AlignmentAnnotation>>();
+    SortedMap<String, String> tipEntries = new TreeMap<>();
+    final Map<SequenceI, List<AlignmentAnnotation>> candidates = new LinkedHashMap<>();
     AlignmentI al = this.ap.av.getAlignment();
     AlignmentUtils.findAddableReferenceAnnotations(forSequences,
             tipEntries, candidates, al);
@@ -1889,8 +1889,8 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
       return;
     }
 
-    List<SequenceI> seqs = new ArrayList<SequenceI>();
-    List<SequenceFeature> features = new ArrayList<SequenceFeature>();
+    List<SequenceI> seqs = new ArrayList<>();
+    List<SequenceFeature> features = new ArrayList<>();
 
     /*
      * assemble dataset sequences, and template new sequence features,
index cccdd2e..8b4f85f 100755 (executable)
@@ -155,7 +155,7 @@ public class Preferences extends GPreferences
      * .properties file as '|' separated strings
      */
 
-    groupURLLinks = new ArrayList<String>();
+    groupURLLinks = new ArrayList<>();
   }
 
   JInternalFrame frame;
@@ -221,6 +221,9 @@ public class Preferences extends GPreferences
             "SHOW_CONSENSUS_HISTOGRAM", true));
     showConsensLogo.setSelected(Cache.getDefault("SHOW_CONSENSUS_LOGO",
             false));
+    showInformationHistogram.setSelected(
+            Cache.getDefault("SHOW_INFORMATION_HISTOGRAM", true));
+    showHMMLogo.setSelected(Cache.getDefault("SHOW_HMM_LOGO", false));
     showNpTooltip.setSelected(Cache
             .getDefault("SHOW_NPFEATS_TOOLTIP", true));
     showDbRefTooltip.setSelected(Cache.getDefault("SHOW_DBREFS_TOOLTIP",
@@ -585,6 +588,10 @@ public class Preferences extends GPreferences
             Boolean.toString(showConsensHistogram.isSelected()));
     Cache.applicationProperties.setProperty("SHOW_CONSENSUS_LOGO",
             Boolean.toString(showConsensLogo.isSelected()));
+    Cache.applicationProperties.setProperty("SHOW_INFORMATION_HISTOGRAM",
+            Boolean.toString(showConsensHistogram.isSelected()));
+    Cache.applicationProperties.setProperty("SHOW_HMM_LOGO",
+            Boolean.toString(showHMMLogo.isSelected()));
     Cache.applicationProperties.setProperty("ANTI_ALIAS",
             Boolean.toString(smoothFont.isSelected()));
     Cache.applicationProperties.setProperty(SCALE_PROTEIN_TO_CDNA,
@@ -863,6 +870,8 @@ public class Preferences extends GPreferences
             && (identity.isSelected() || showGroupConsensus.isSelected()));
     showConsensLogo.setEnabled(annotations.isSelected()
             && (identity.isSelected() || showGroupConsensus.isSelected()));
+    showInformationHistogram.setEnabled(annotations.isSelected());
+    showHMMLogo.setEnabled(annotations.isSelected());
   }
 
   @Override
index 085e9fc..ea56bbb 100755 (executable)
@@ -67,6 +67,16 @@ public class GAlignFrame extends JInternalFrame
 
   protected JMenu webService = new JMenu();
 
+  protected JMenu hmmerMenu = new JMenu();
+
+  protected JCheckBoxMenuItem autoAlignSeqs = new JCheckBoxMenuItem();
+
+  protected JMenuItem hmmAlign = new JMenuItem();
+
+  protected JMenuItem hmmSearch = new JMenuItem();
+
+  protected JMenuItem hmmBuild = new JCheckBoxMenuItem();
+
   protected JMenuItem webServiceNoServices;
 
   protected JCheckBoxMenuItem viewBoxesMenuItem = new JCheckBoxMenuItem();
@@ -253,6 +263,7 @@ public class GAlignFrame extends JInternalFrame
   private void jbInit() throws Exception
   {
     initColourMenu();
+    initHMMERMenu();
 
     JMenuItem saveAs = new JMenuItem(
             MessageManager.getString("action.save_as"));
@@ -293,6 +304,7 @@ public class GAlignFrame extends JInternalFrame
     JMenu calculateMenu = new JMenu(
             MessageManager.getString("action.calculate"));
     webService.setText(MessageManager.getString("action.web_service"));
+    hmmerMenu.setText(MessageManager.getString("action.hmmer"));
     JMenuItem selectAllSequenceMenuItem = new JMenuItem(
             MessageManager.getString("action.select_all"));
     keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_A, Toolkit
@@ -1696,6 +1708,7 @@ public class GAlignFrame extends JInternalFrame
     alignFrameMenuBar.add(colourMenu);
     alignFrameMenuBar.add(calculateMenu);
     alignFrameMenuBar.add(webService);
+    alignFrameMenuBar.add(hmmerMenu);
 
     fileMenu.add(fetchSequence);
     fileMenu.add(addSequenceMenu);
@@ -1863,6 +1876,23 @@ public class GAlignFrame extends JInternalFrame
    * Constructs the entries on the Colour menu (but does not add them to the
    * menu).
    */
+  protected void initHMMERMenu()
+  {
+    autoAlignSeqs = new JCheckBoxMenuItem(
+            MessageManager.getString("label.auto_align_seqs"));
+    hmmAlign = new JMenuItem(MessageManager.getString("label.hmmalign"));
+    hmmBuild = new JMenuItem(MessageManager.getString("label.hmmbuild"));
+    hmmSearch = new JMenuItem(MessageManager.getString("label.hmmsearch"));
+    autoAlignSeqs.addActionListener(new ActionListener()
+    {
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        autoAlignSeqs_actionPerformed(autoAlignSeqs.isSelected());
+      }
+    });
+
+  }
   protected void initColourMenu()
   {
     applyToAllGroups = new JCheckBoxMenuItem(
@@ -2342,6 +2372,22 @@ public class GAlignFrame extends JInternalFrame
   {
   }
 
+  protected void autoAlignSeqs_actionPerformed(boolean selected)
+  {
+  }
+
+  protected void hmmAlign_actionPerformed(ActionEvent e)
+  {
+  }
+
+  protected void hmmBuild_actionPerformed(ActionEvent e)
+  {
+  }
+
+  protected void hmmSearch_actionPerformed(ActionEvent e)
+  {
+  }
+
   public void createPNG(java.io.File f)
   {
   }
index 1ad95dd..20b97b2 100755 (executable)
@@ -95,11 +95,11 @@ public class GPreferences extends JPanel
 
   protected JCheckBox rightAlign = new JCheckBox();
 
-  protected JComboBox<String> fontSizeCB = new JComboBox<String>();
+  protected JComboBox<String> fontSizeCB = new JComboBox<>();
 
-  protected JComboBox<String> fontStyleCB = new JComboBox<String>();
+  protected JComboBox<String> fontStyleCB = new JComboBox<>();
 
-  protected JComboBox<String> fontNameCB = new JComboBox<String>();
+  protected JComboBox<String> fontNameCB = new JComboBox<>();
 
   protected JCheckBox showOccupancy = new JCheckBox();
 
@@ -111,15 +111,15 @@ public class GPreferences extends JPanel
 
   protected JCheckBox scaleProteinToCdna = new JCheckBox();
 
-  protected JComboBox<String> gapSymbolCB = new JComboBox<String>();
+  protected JComboBox<String> gapSymbolCB = new JComboBox<>();
 
   protected JCheckBox wrap = new JCheckBox();
 
-  protected JComboBox<String> sortby = new JComboBox<String>();
+  protected JComboBox<String> sortby = new JComboBox<>();
 
-  protected JComboBox<String> sortAnnBy = new JComboBox<String>();
+  protected JComboBox<String> sortAnnBy = new JComboBox<>();
 
-  protected JComboBox<String> sortAutocalc = new JComboBox<String>();
+  protected JComboBox<String> sortAutocalc = new JComboBox<>();
 
   protected JCheckBox startupCheckbox = new JCheckBox();
 
@@ -142,10 +142,15 @@ public class GPreferences extends JPanel
 
   protected JCheckBox showConsensLogo = new JCheckBox();
 
+  protected JCheckBox showInformationHistogram = new JCheckBox();
+
+  protected JCheckBox showHMMLogo = new JCheckBox();
+
   protected JCheckBox showDbRefTooltip = new JCheckBox();
 
   protected JCheckBox showNpTooltip = new JCheckBox();
 
+
   /*
    * Structure tab and components
    */
@@ -159,7 +164,7 @@ public class GPreferences extends JPanel
 
   protected JCheckBox addTempFactor = new JCheckBox();
 
-  protected JComboBox<String> structViewer = new JComboBox<String>();
+  protected JComboBox<String> structViewer = new JComboBox<>();
 
   protected JTextField chimeraPath = new JTextField();
 
@@ -176,9 +181,9 @@ public class GPreferences extends JPanel
 
   protected JPanel maxColour = new JPanel();
 
-  protected JComboBox<String> protColour = new JComboBox<String>();
+  protected JComboBox<String> protColour = new JComboBox<>();
 
-  protected JComboBox<String> nucColour = new JComboBox<String>();
+  protected JComboBox<String> nucColour = new JComboBox<>();
 
   /*
    * Connections tab components
@@ -216,7 +221,7 @@ public class GPreferences extends JPanel
   /*
    * Output tab components
    */
-  protected JComboBox<Object> epsRendering = new JComboBox<Object>();
+  protected JComboBox<Object> epsRendering = new JComboBox<>();
 
   protected JLabel userIdWidthlabel = new JLabel();