Merge branch 'develop' of https://source.jalview.org/git/jalview.git into develop
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 26 May 2016 13:05:02 +0000 (14:05 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 26 May 2016 13:05:02 +0000 (14:05 +0100)
12 files changed:
help/html/features/mmcif.html [new file with mode: 0644]
help/html/features/seqmappings.html
help/html/features/sifts_mapping_output.png [new file with mode: 0644]
help/html/features/siftsmapping.html [new file with mode: 0644]
help/html/features/viewingpdbs.html
src/jalview/bin/Cache.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/Preferences.java
src/jalview/gui/TreePanel.java
src/jalview/io/HtmlSvgOutput.java
src/jalview/util/ImageMaker.java
src/jalview/ws/dbsources/Pdb.java

diff --git a/help/html/features/mmcif.html b/help/html/features/mmcif.html
new file mode 100644 (file)
index 0000000..6df0fd4
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<title>mmCIF File Format</title>
+</head>
+<body>
+       <strong>mmCIF File Format</strong>
+       <p>The mmCIF file format (macromolecular Crystallographic
+               Information) was developed under the auspices of the International Union of Crystallography (IUCr) to extend the Crystallographic Information
+               File (CIF) data representation used for describing small molecule
+               structures and associated diffraction experiments.</p>
+       <strong>Merits of mmCIF file format</strong>
+       <ul>
+               <li>Large structures (containing >62 chains and/or 99999 ATOM
+                       records) that cannot be fully represented in the PDB file format are
+                       available in the PDB archive as single PDBx/mmCIF files.</li>
+               <li>PDBx/mmCIF file format provides richer data annotation</li>         
+               <li>PDBx/mmCIF became the standard PDB archive format in 2014.
+                       Since 2016 the PDB File Format is no longer being modified or
+                       extended to support new content.
+               </li>
+       </ul>
+
+       <em>mmCIF file format support for importing 3D structure data from
+               flat file and EMBL-PDBe via mmCIF was added in Jalview 2.9.1</em>
+</body>
+</html>
\ No newline at end of file
index ac63c9e..60ac6ab 100644 (file)
@@ -42,5 +42,7 @@
     retrieved by the <a href="seqfetch.html">Sequence Fetcher</a>, and
     allows sequence features to be mapped directly from Uniprot das
     sources to their coding region on EMBL sequence records.
+  </p>
+   <p>In Jalview 2.9.1 <a href="siftsmapping.html">SIFTS Mapping</a> was added as a better means for explicitly identifying the coordinates corresponding to a displayed sequence when viewing a PDB structure associated with a sequence </p>
 </body>
 </html>
diff --git a/help/html/features/sifts_mapping_output.png b/help/html/features/sifts_mapping_output.png
new file mode 100644 (file)
index 0000000..3c28b81
Binary files /dev/null and b/help/html/features/sifts_mapping_output.png differ
diff --git a/help/html/features/siftsmapping.html b/help/html/features/siftsmapping.html
new file mode 100644 (file)
index 0000000..c344a20
--- /dev/null
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<title>SIFTS Mapping</title>
+</head>
+<body>
+  <p><strong>SIFTS Mapping</strong></p>
+  
+  <p>
+       SIFTS (Structure integration with function, taxonomy
+       and sequences) provides an up-to-date resource for residue-level
+       mapping between Uniprot and PDB entries. The information is updated and
+       released weekly simultaneously with the release of new PDB entries.
+       SIFTS Entries are published as XML files and made publicly available via an FTP
+       site hosted at the European Bioinformatics Institute. 
+  </p>
+       
+  <p>
+    At the point of viewing a PDB structure, Jalview downloads a SIFTS file 
+       for the target entry and uses it to accurately map the sequence residues with the 
+       structure residue. Prior to SIFTS integration, Jalview uses Needleman and Wunsch 
+       Alignment algorithm to  map sequence residues to structure residues, and that may not 
+       always result to a correct mapping since it is computational determined.        
+  </p>
+  
+  <p>
+       The default method for 'Sequence &harr; Structure' mapping can be configured 
+       in the Structure tab in the <strong>Tools &rarr; Preferences</strong> dialog box. When 'SIFTS' 
+       is enabled as the default, all mappings between 'Sequence &harr; Structure' is 
+       performed via SIFTS provided that there is a valid SIFTS entry for PDB structure. If no 
+       valid SIFTS resource is available, then the 'Sequence &harr; Structure' mapping falls 
+       back to Needleman and Wunsch Alignment algorithm.
+  </p>
+       
+  <p>To verify the mapping method used, you can view the mapping output via the structure viewer menu <strong>File &rarr; View mapping.</strong> A sample mapping output can be seen in the screenshot below. The highlighted position shows the method used. </p>     
+  <p>
+       <img src="sifts_mapping_output.png" align="left" alt="SIFTS mapping output" />
+  </p>
+       
+  <p><em>SIFTS Mapping integration was added in Jalview 2.9.1</em></p>
+       
+</body>
+</html>
\ No newline at end of file
index 4d35516..d4819f1 100755 (executable)
   </p>
 
   <p>
+    <strong>Importing PDB Entries or files in mmCIF format</strong><br>
+    <a href="mmcif.html">mmCIF file format</a> provides an alternative means for 
+    importing 3D structure data from flat file and EMBL-PDBe 
+    web-service. To enable mmCIF as the default format for 
+    importing PBD sequences from the PDB sequence fetcher, add or modify the 
+    property  
+    <code>DEFAULT_STRUCTURE_FORMAT=mmCIF</code> in Jalview properties file. 
+    Once this is done, the steps followed in retrieving PDB format files above can 
+    be followed to obtain the same data with mmCIF. <em>mmCIF format file support was added in Jalview 2.9.1.</em></p>
+    
+   
+
+  <p>
     <strong>Associating a large number of PDB files to
       sequences in an alignment</strong><br /> It is often the case when working
     with structure alignments that you will have a directory of PDB
index 7911cd5..38aa55f 100755 (executable)
@@ -426,7 +426,7 @@ public class Cache
     System.out
             .println("Jalview Version: " + codeVersion + codeInstallation);
 
-    Pdb.setCurrentDefaultFomart(jalview.bin.Cache.getDefault(
+    Pdb.setCurrentDefaultFormat(jalview.bin.Cache.getDefault(
             "DEFAULT_STRUCTURE_FORMAT", DEFAULT_STRUCTURE_FORMAT));
     // jnlpVersion will be null if we're using InstallAnywhere
     // Dont do this check if running in headless mode
index 0419b6f..3e3780a 100644 (file)
@@ -5038,6 +5038,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               "text/uri-list;class=java.lang.String");
       if (t.isDataFlavorSupported(DataFlavor.javaFileListFlavor))
       {
+        Cache.log.debug("Drop handled as javaFileListFlavor");
         // Works on Windows and MacOSX
         evt.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
         files = (java.util.List) t
@@ -5045,14 +5046,20 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       }
       else if (t.isDataFlavorSupported(uriListFlavor))
       {
+        Cache.log.debug("Drop handled as uriListFlavor");
         // This is used by Unix drag system
         evt.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
         String data = (String) t.getTransferData(uriListFlavor);
         if (data == null)
         {
+          Cache.log.debug("standard URIListFlavor (" + uriListFlavor
+                  + ") doesn't resolve. trying others.");
           // try 'best' dataflavor
           data = (String) t.getTransferData(DataFlavor
                   .selectBestTextFlavor(t.getTransferDataFlavors()));
+          Cache.log.debug("Dataflavor "
+                  + DataFlavor.selectBestTextFlavor(t
+                          .getTransferDataFlavors()) + " returned " + data);
         }
         files = new java.util.ArrayList(1);
         for (java.util.StringTokenizer st = new java.util.StringTokenizer(
@@ -5078,6 +5085,24 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             files.add(file.toString());
           }
         }
+        if (files.size() < 1)
+        {
+          Cache.log
+                  .debug("Couldn't resolve drop data with 'best text'. Here are the supported flavors:");
+          if (data == null && Cache.log.isDebugEnabled())
+          {
+            for (DataFlavor fl : t.getTransferDataFlavors())
+            {
+              Cache.log.debug("Supported transfer dataflavor: "
+                      + fl.toString());
+              Object df = t.getTransferData(fl);
+              if (df != null)
+              {
+                Cache.log.debug("Retrieves: " + df);
+              }
+            }
+          }
+        }
       }
     } catch (Exception e)
     {
index 6b2d3c4..ea090a3 100755 (executable)
@@ -360,7 +360,7 @@ public class Preferences extends GPreferences
      * Set Output tab defaults
      */
     epsRendering
-            .addItem(MessageManager.getString("label.prompt_each_time"));
+.addItem("Prompt each time");
     epsRendering.addItem(MessageManager.getString("label.lineart"));
     epsRendering.addItem(MessageManager.getString("action.text"));
     epsRendering.setSelectedItem(Cache.getDefault("EPS_RENDERING",
index 9522144..ae73baa 100755 (executable)
@@ -161,6 +161,7 @@ public class TreePanel extends GTreePanel
 
     av.addPropertyChangeListener(new java.beans.PropertyChangeListener()
     {
+      @Override
       public void propertyChange(PropertyChangeEvent evt)
       {
         if (evt.getPropertyName().equals("alignment"))
@@ -196,6 +197,7 @@ public class TreePanel extends GTreePanel
 
   }
 
+  @Override
   public void viewMenu_menuSelected()
   {
     buildAssociatedViewMenu();
@@ -231,6 +233,7 @@ public class TreePanel extends GTreePanel
       buttonGroup.add(item);
       item.addActionListener(new ActionListener()
       {
+        @Override
         public void actionPerformed(ActionEvent evt)
         {
           treeCanvas.applyToAllViews = false;
@@ -249,6 +252,7 @@ public class TreePanel extends GTreePanel
     itemf.setSelected(treeCanvas.applyToAllViews);
     itemf.addActionListener(new ActionListener()
     {
+      @Override
       public void actionPerformed(ActionEvent evt)
       {
         treeCanvas.applyToAllViews = itemf.isSelected();
@@ -276,6 +280,7 @@ public class TreePanel extends GTreePanel
       }
     }
 
+    @Override
     public void run()
     {
 
@@ -389,6 +394,7 @@ public class TreePanel extends GTreePanel
    * @param e
    *          DOCUMENT ME!
    */
+  @Override
   public void textbox_actionPerformed(ActionEvent e)
   {
     CutAndPasteTransfer cap = new CutAndPasteTransfer();
@@ -434,6 +440,7 @@ public class TreePanel extends GTreePanel
    * @param e
    *          DOCUMENT ME!
    */
+  @Override
   public void saveAsNewick_actionPerformed(ActionEvent e)
   {
     JalviewFileChooser chooser = new JalviewFileChooser(
@@ -474,12 +481,14 @@ public class TreePanel extends GTreePanel
    * @param e
    *          DOCUMENT ME!
    */
+  @Override
   public void printMenu_actionPerformed(ActionEvent e)
   {
     // Putting in a thread avoids Swing painting problems
     treeCanvas.startPrinting();
   }
 
+  @Override
   public void originalSeqData_actionPerformed(ActionEvent e)
   {
     if (!tree.hasOriginalSequenceData())
@@ -547,6 +556,7 @@ public class TreePanel extends GTreePanel
    * @param e
    *          DOCUMENT ME!
    */
+  @Override
   public void fitToWindow_actionPerformed(ActionEvent e)
   {
     treeCanvas.fitToWindow = fitToWindow.isSelected();
@@ -637,6 +647,7 @@ public class TreePanel extends GTreePanel
    * @param e
    *          DOCUMENT ME!
    */
+  @Override
   public void font_actionPerformed(ActionEvent e)
   {
     if (treeCanvas == null)
@@ -666,6 +677,7 @@ public class TreePanel extends GTreePanel
    * @param e
    *          DOCUMENT ME!
    */
+  @Override
   public void distanceMenu_actionPerformed(ActionEvent e)
   {
     treeCanvas.setShowDistances(distanceMenu.isSelected());
@@ -677,6 +689,7 @@ public class TreePanel extends GTreePanel
    * @param e
    *          DOCUMENT ME!
    */
+  @Override
   public void bootstrapMenu_actionPerformed(ActionEvent e)
   {
     treeCanvas.setShowBootstrap(bootstrapMenu.isSelected());
@@ -688,6 +701,7 @@ public class TreePanel extends GTreePanel
    * @param e
    *          DOCUMENT ME!
    */
+  @Override
   public void placeholdersMenu_actionPerformed(ActionEvent e)
   {
     treeCanvas.setMarkPlaceholders(placeholdersMenu.isSelected());
@@ -699,6 +713,7 @@ public class TreePanel extends GTreePanel
    * @param e
    *          DOCUMENT ME!
    */
+  @Override
   public void epsTree_actionPerformed(ActionEvent e)
   {
     boolean accurateText = true;
@@ -708,7 +723,8 @@ public class TreePanel extends GTreePanel
 
     // If we need to prompt, and if the GUI is visible then
     // Prompt for EPS rendering style
-    if (renderStyle.equalsIgnoreCase("Prompt each time")
+    if (renderStyle.equalsIgnoreCase(MessageManager
+            .getString("label.prompt_each_time"))
             && !(System.getProperty("java.awt.headless") != null && System
                     .getProperty("java.awt.headless").equals("true")))
     {
@@ -772,6 +788,7 @@ public class TreePanel extends GTreePanel
    * @param e
    *          DOCUMENT ME!
    */
+  @Override
   public void pngTree_actionPerformed(ActionEvent e)
   {
     int width = treeCanvas.getWidth();
@@ -828,6 +845,7 @@ public class TreePanel extends GTreePanel
     tree.applyToNodes(new NodeTransformI()
     {
 
+      @Override
       public void transform(BinaryNode node)
       {
         if (node instanceof SequenceNode
index e554b8e..3bd175b 100644 (file)
@@ -124,7 +124,8 @@ public class HtmlSvgOutput
         }
       }
 
-      if (renderStyle.equalsIgnoreCase("lineart"))
+      if (renderStyle.equalsIgnoreCase(MessageManager
+              .getString("label.lineart")))
       {
         g1.setRenderingHint(SVGHints.KEY_DRAW_STRING_TYPE,
                 SVGHints.VALUE_DRAW_STRING_TYPE_VECTOR);
index b7aa4ca..9bc732b 100755 (executable)
@@ -272,7 +272,8 @@ MessageManager.formatMessage(
       }
     }
 
-    if (renderStyle.equalsIgnoreCase("lineart"))
+    if (renderStyle.equalsIgnoreCase(MessageManager
+            .getString("label.lineart")))
     {
       ig2.setRenderingHint(SVGHints.KEY_DRAW_STRING_TYPE,
               SVGHints.VALUE_DRAW_STRING_TYPE_VECTOR);
index 4a089f7..f41d86a 100644 (file)
@@ -132,11 +132,11 @@ public class Pdb extends EbiFileRetrievedProxy
       stopQuery();
       return null;
     }
-    String ext = getCurrentDefaultFomart().equalsIgnoreCase("mmcif") ? ".cif"
+    String ext = getCurrentDefaultFormat().equalsIgnoreCase("mmcif") ? ".cif"
             : ".xml";
     EBIFetchClient ebi = new EBIFetchClient();
     file = ebi.fetchDataAsFile("pdb:" + id,
-            getCurrentDefaultFomart().toLowerCase(), "raw", ext)
+            getCurrentDefaultFormat().toLowerCase(), "raw", ext)
             .getAbsolutePath();
     stopQuery();
     if (file == null)
@@ -148,7 +148,7 @@ public class Pdb extends EbiFileRetrievedProxy
 
       pdbAlignment = new FormatAdapter().readFile(file,
               jalview.io.AppletFormatAdapter.FILE,
-              getCurrentDefaultFomart());
+              getCurrentDefaultFormat());
       if (pdbAlignment != null)
       {
         List<SequenceI> toremove = new ArrayList<SequenceI>();
@@ -263,12 +263,12 @@ public class Pdb extends EbiFileRetrievedProxy
     return 0;
   }
 
-  public static String getCurrentDefaultFomart()
+  public static String getCurrentDefaultFormat()
   {
     return currentDefaultFomart;
   }
 
-  public static void setCurrentDefaultFomart(String currentDefaultFomart)
+  public static void setCurrentDefaultFormat(String currentDefaultFomart)
   {
     Pdb.currentDefaultFomart = currentDefaultFomart;
   }