QQMerge branch 'develop' of https://source.jalview.org/git/jalview into develop
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 5 Oct 2016 15:13:33 +0000 (16:13 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 5 Oct 2016 15:13:33 +0000 (16:13 +0100)
help/html/features/chimera.html
help/html/releases.html
help/html/whatsNew.html
resources/embl_mapping.xml
src/jalview/datamodel/xdb/embl/EmblFile.java
src/jalview/ws/dbsources/EmblXmlSource.java
src/jalview/ws/ebi/EBIFetchClient.java
test/jalview/datamodel/xdb/embl/EmblEntryTest.java
test/jalview/datamodel/xdb/embl/EmblFileTest.java
test/jalview/datamodel/xdb/embl/EmblTestHelper.java

index 0569513..98d8966 100644 (file)
   </p>
   <p>
     Since Jalview 2.8.2, <a href="http://www.cgl.ucsf.edu/chimera/">Chimera</a>
-    (http://www.cgl.ucsf.edu/chimera/) has been integrated into Jalview
-    for interactively viewing structures opened by entries in the <strong>&quot;Structure&quot;</strong>
-    submenu in the <a href="../menus/popupMenu.html">sequence id
-      pop-up menu</a> (if you can't see this, then you need to <a
-      href="viewingpdbs.html"
-    >associate a PDB structure</a> with the sequence). Chimera is
-    available from the Jalview desktop, provided Chimera has been
-    separately installed.
+    (http://www.cgl.ucsf.edu/chimera/) can be used for viewing
+    structures opened via the <a href="structurechooser.html"><strong>&quot;View
+        Structure Data..&quot;</strong> dialog</a>.
   </p>
   <p>
     You can set a default choice of Jmol or Chimera structure viewer in
     <a href="preferences.html#structure"> Preferences</a>. You can also
     optionally specify the path to the Chimera program here (if it
-    differs from the standard paths searched by Jalview).
+    differs from the standard paths searched by Jalview).<br />
+    <strong>Please make sure your version of Chimera is up to
+      date. Jalview requires at least Chimera version 1.11.1</strong>
+  </p>
   <p>
     If you save your Jalview session as a project file, the state of any
     open Chimera windows will also be saved, and can be reopened by
     loading the project file on any machine with Chimera installed. <em>Since
       Jalview 2.9.</em>
-    <!-- <p>The following menu entries are provided for viewing structure data<br>
-  <ul>
-    <li>The <strong>&quot;Structure&#8594;View
-        Structure&#8594;</strong> submenu allows a single PDB structure to be chosen
-      for display from the available structures for a sequence.
-    </li>
-    <li>The <strong>&quot;Structure&#8594;View all <em>N</em>
-        structures
-    </strong> option will open a new window containing all structures associated
-      with the current selection.
-    </li>
-    <li>The <strong>&quot;Structure&#8594;View all <em>N</em>
-        representative structures
-    </strong> option will open a new window containing exactly one structure per
-      currently selected sequence.<br /></li>
-  </ul>
-  <br> 
-</p> -->
   <p>
     <a name="align"><strong>Superposing structures based on
         their aligned sequences</strong></a><br> If several structures are
index 3a8c9f9..6eb42bc 100755 (executable)
               <!-- JAL-2005, JAL-599 -->Alignment sort by feature scores and feature counts preserves alignment ordering (and debugged for complex feature sets).  
             </li>
             <li>
-              <!-- -->   
+              <!-- JAL-2152-->Chimera 1.11.1 minimum requirement for viewing structures with Jalview 2.10   
             </li>
             <li>
-              <!-- JAL- -->  
+              <!-- JAL-1705, JAL-1975, JAL-2050,JAL-2041,JAL-2105 -->Retrieve genome, transcript CCDS and gene ids via the Ensembl and Ensembl Genomes REST API   
+            </li>
+            <li>
+              <!-- JAL-2049 -->Protein sequence variant annotation computed for 'sequence_variant' annotation on CDS regions (Ensembl)   
             </li>
+            <li><!-- JAL-2232 -->ENA CDS 'show cross references' for Uniprot sequences</li>
             <li>
               <!-- JAL- -->  
             </li>
           <ul>
             <li><!-- JAL-2077 -->reinstate CTRL-click for opening pop-up menu on OSX</li>
             <li><!-- JAL-2018-->Export features in Jalview format (again) includes graduated colourschemes</li>
-            <li><!-- JAL-1722, JAL-2001-->More responsive when working with big alignments and lots of hidden columns</li>
+            <li><!-- JAL-2172,JAL-1722, JAL-2001-->More responsive when working with big alignments and lots of hidden columns</li>
             <li><!-- JAL-2053-->Hidden column markers not always rendered at right of alignment window</li>
             <li><!-- JAL-2067 -->Tidied up links in help file table of contents</li>
             <li><!-- JAL-2072  -->Feature based tree calculation not shown for DNA alignments</li>
             </li>
             <li><!-- JAL-1306 -->Quality and Conservation are now shown on load even when Consensus calculation is disabled</li>
             <li>
-              <!-- JAL- -->
+              <!--  -->
             </li>
             <li>
               <!-- JAL- -->
             <li><!-- JAL-2003 -->Export features should only export the currently displayed features for the current selection or view</li>
             <li><!-- JAL-2036 -->Enable 'Get Cross-References' in menu after fetching cross-references</li>
             <li><!-- JAL-2032 -->Mouseover of a copy of a sequence is not followed in the structure viewer</li>
-            <li><!-- JAL-2163 -->Titles for individual alignments in splitframe not restored from project</li>
+            <li><!-- JAL-2163 -->Titles for individual alignments in splitframe not restored from project</li>            
             <li>
               <!-- JAL-2145 -->missing autocalculated annotation at trailing end of protein alignment in transcript/product splitview when pad-gaps not enabled by default
             </li>
index 1743f1c..21e6ffa 100755 (executable)
 </head>
 <body>
   <p>
-    <strong>What's new ?</strong>
+    <strong>What's new in Jalview 2.10 ?</strong>
   </p>
   <p>
     Jalview 2.10 is the next major release in the Jalview 2 series. Full
     details are in the <a href="releases.html#Jalview.2.10.0">Jalview
       2.10 Release Notes</a>, but the highlights are below.
   </p>
-  <p>
-    <strong>Highlights in Jalview 2.10</strong>
   <ul>
     <li><strong>Ensembl sequence fetcher.</strong> Annotated Genes,
       transcripts and proteins can be retrieved via Jalview's new <a
         <li><strong>Import structures as mmCIF</strong>. Jalview
           now downloads data from the EMBL-EBI's PDBe site as <a href="features/mmcif.html">mmCIF</a>.
           This allows very large structures to be imported, such as the HIV virus capsid assembly.</li>
+        <li><strong>Chimera users will need to upgrade to
+            1.11.1.</strong>If you use Chimera to view structures downloaded by
+          Jalview 2.10, you will need to make sure you are running the
+          latest version of <a href="features/chimera.html">Chimera</a>.</li>
       </ul></li>
     <li><strong>UniProt Free Text Search.</strong> The new search
       dialog for UniProt allows you to browse and retrieve sequences
       sequence. The reference sequence for alignment views can also be
       saved and restored from Jalview projects.</li>
     <li><strong>Ensembl and ENA 'show cross-references'
-        support.</strong>The Calculations menu's 'Show cross-references' will now
+        support.</strong>The Calculations menu's <strong>'Show cross-references'</strong> will now
       offer Ensembl as well as EMBLCDS and Uniprot when CDS/Protein
       mapping data is available for download or display.</li>
+      
   </ul>
 
 </body>
index 7e494b4..01b921a 100644 (file)
@@ -26,7 +26,6 @@
          see ftp://ftp.sra.ebi.ac.uk/meta/xsd/sra_1_5/ENA.embl.xsd
          see http://www.ebi.ac.uk/ena/submit/data-formats
        -->
-       <!--
        <class name="jalview.datamodel.xdb.embl.EmblFile">
                <map-to xml="ROOT"/>
                <field name="entries" type="jalview.datamodel.xdb.embl.EmblEntry" collection="vector">
@@ -36,9 +35,7 @@
                        <bind-xml name="Error"/>
                </field>
        </class>
-       -->
        <class name="jalview.datamodel.xdb.embl.EmblEntry">
-               <map-to xml="entry"/>
                <field name="accession" type="string">
                        <bind-xml name="accession" node="attribute"/>
                </field>
index 534b38c..69870b6 100644 (file)
@@ -20,7 +20,6 @@
  */
 package jalview.datamodel.xdb.embl;
 
-import jalview.bin.Cache;
 import jalview.datamodel.DBRefEntry;
 import jalview.ws.dbsources.Uniprot;
 
@@ -28,7 +27,6 @@ import java.io.File;
 import java.io.FileReader;
 import java.io.PrintWriter;
 import java.io.Reader;
-import java.net.URL;
 import java.util.Vector;
 
 import org.exolab.castor.mapping.Mapping;
@@ -83,12 +81,12 @@ public class EmblFile
   }
 
   /**
-   * Parse an Embl XML file into an EmblEntry object
+   * Parse an EmblXML file into an EmblFile object
    * 
    * @param file
    * @return parsed EmblXML or null if exceptions were raised
    */
-  public static EmblEntry getEmblEntry(File file)
+  public static EmblFile getEmblFile(File file)
   {
     if (file == null)
     {
@@ -96,7 +94,7 @@ public class EmblFile
     }
     try
     {
-      return EmblFile.getEntry(new FileReader(file));
+      return EmblFile.getEmblFile(new FileReader(file));
     } catch (Exception e)
     {
       System.err.println("Exception whilst reading EMBLfile from " + file);
@@ -105,32 +103,26 @@ public class EmblFile
     return null;
   }
 
-  /**
-   * Reads the XML response from file and unmarshals into a Java object
-   * 
-   * @param fileReader
-   * @return
-   */
-  public static EmblEntry getEntry(Reader fileReader)
+  public static EmblFile getEmblFile(Reader file)
   {
-    EmblEntry record = new EmblEntry();
+    EmblFile record = new EmblFile();
     try
     {
       // 1. Load the mapping information from the file
       Mapping map = new Mapping(record.getClass().getClassLoader());
 
-      URL url = record.getClass().getResource("/embl_mapping.xml");
+      java.net.URL url = record.getClass().getResource("/embl_mapping.xml");
       map.loadMapping(url);
 
       // 2. Unmarshal the data
       Unmarshaller unmar = new Unmarshaller(record);
       try
       {
-        if (Cache.getDefault(Cache.CASTORLOGLEVEL,
+        // uncomment to DEBUG EMBLFile reading
+        if (jalview.bin.Cache.getDefault(jalview.bin.Cache.CASTORLOGLEVEL,
                 "debug").equalsIgnoreCase("DEBUG"))
         {
-          unmar.setDebug(Cache.log.isDebugEnabled());
-          // unmar.setDebug(true);// uncomment to debug unmarshalling
+          unmar.setDebug(jalview.bin.Cache.log.isDebugEnabled());
         }
       } catch (Exception e)
       {
@@ -139,7 +131,7 @@ public class EmblFile
       unmar.setIgnoreExtraAttributes(true);
       unmar.setMapping(map);
       unmar.setLogWriter(new PrintWriter(System.out));
-      record = (EmblEntry) unmar.unmarshal(fileReader);
+      record = (EmblFile) unmar.unmarshal(file);
 
       canonicaliseDbRefs(record);
     } catch (Exception e)
@@ -155,17 +147,13 @@ public class EmblFile
    * Change blank version to "0" in any DBRefEntry, to ensure consistent
    * comparison with other DBRefEntry in Jalview
    * 
-   * @param entry
+   * @param record
    * @see Uniprot#getDbVersion
    */
-  static void canonicaliseDbRefs(EmblEntry entry)
+  static void canonicaliseDbRefs(EmblFile record)
   {
-    if (entry == null)
+    for (EmblEntry entry : record.getEntries())
     {
-      return;
-    }
-//    for (EmblEntry entry : record.getEntries())
-//    {
       if (entry.getDbRefs() != null)
       {
         for (DBRefEntry dbref : entry.getDbRefs())
@@ -177,7 +165,7 @@ public class EmblFile
         }
       }
 
-    if (entry.getFeatures() != null)
+      if (entry.getFeatures() != null)
       {
         for (EmblFeature feature : entry.getFeatures())
         {
@@ -193,6 +181,6 @@ public class EmblFile
           }
         }
       }
-    // }
+    }
   }
 }
index 73e67aa..2049766 100644 (file)
@@ -72,7 +72,7 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
               "exception.ebiembl_retrieval_failed_on", new String[] {
                   emprefx.toLowerCase(), query.trim() }), e);
     }
-    return getEmblSequenceRecords(emprefx, reply);
+    return getEmblSequenceRecords(emprefx, query, reply);
   }
 
   /**
@@ -81,38 +81,46 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy
    * @param emprefx
    *          either EMBL or EMBLCDS strings are allowed - anything else will
    *          not retrieve emblxml
+   * @param query
    * @param file
    *          the EMBL XML file containing the results of a query
    * @return
    * @throws Exception
    */
-  public AlignmentI getEmblSequenceRecords(String emprefx, File reply)
-          throws Exception
+  public AlignmentI getEmblSequenceRecords(String emprefx, String query,
+          File reply) throws Exception
   {
-    EmblEntry entry = null;
+    EmblFile efile = null;
+    List<SequenceI> seqs = new ArrayList<SequenceI>();
 
     if (reply != null && reply.exists())
     {
       file = reply.getAbsolutePath();
       if (reply.length() > EMBL_NOT_FOUND_REPLY.length())
       {
-        entry = EmblFile.getEmblEntry(reply);
+        efile = EmblFile.getEmblFile(reply);
       }
     }
 
-    // TODO don't need peptides any more?
     List<SequenceI> peptides = new ArrayList<SequenceI>();
-    AlignmentI al = null;
-    if (entry != null)
+    if (efile != null)
     {
-      SequenceI seq = entry.getSequence(emprefx, peptides);
-      if (seq != null)
+      for (EmblEntry entry : efile.getEntries())
       {
-        seq.deriveSequence();
-        // place DBReferences on dataset and refer
-        al = new Alignment(new SequenceI[] { seq });
+        SequenceI seq = entry.getSequence(emprefx, peptides);
+        if (seq != null)
+        {
+          seqs.add(seq.deriveSequence());
+          // place DBReferences on dataset and refer
+        }
       }
     }
+
+    AlignmentI al = null;
+    if (!seqs.isEmpty())
+    {
+      al = new Alignment(seqs.toArray(new SequenceI[seqs.size()]));
+    }
     stopQuery();
     return al;
   }
index 5531512..1dff32f 100644 (file)
@@ -208,7 +208,6 @@ public class EBIFetchClient
       if (outFile != null)
       {
         FileOutputStream fio = new FileOutputStream(outFile);
-        // fio.write("<?xml version='1.0' encoding='UTF-8'?>\n".getBytes());
         byte[] bb = new byte[32 * 1024];
         int l;
         while ((l = is.read(bb)) > 0)
index f332fa6..abe5099 100644 (file)
@@ -1,7 +1,6 @@
 package jalview.datamodel.xdb.embl;
 
 import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNotNull;
 import static org.testng.AssertJUnit.assertNull;
 import static org.testng.AssertJUnit.assertSame;
 
@@ -41,21 +40,20 @@ public class EmblEntryTest
     // not the whole sequence but enough for this test...
     List<SequenceI> peptides = new ArrayList<SequenceI>();
     SequenceIdMatcher matcher = new SequenceIdMatcher(peptides);
-    EmblEntry ef = EmblTestHelper.getEmblFile();
-    assertNotNull(ef);
-    // assertEquals(1, ef.getEntries().size());
-    // EmblEntry testee = ef.getEntries().get(0);
+    EmblFile ef = EmblTestHelper.getEmblFile();
+    assertEquals(1, ef.getEntries().size());
+    EmblEntry testee = ef.getEntries().get(0);
     String sourceDb = "EMBL";
-    SequenceI dna = ef.makeSequence(sourceDb);
+    SequenceI dna = testee.makeSequence(sourceDb);
 
     /*
      * parse three CDS features, with two/one/no Uniprot cross-refs
      */
-    for (EmblFeature feature : ef.getFeatures())
+    for (EmblFeature feature : ef.getEntries().get(0).getFeatures())
     {
       if ("CDS".equals(feature.getName()))
       {
-        ef.parseCodingFeature(feature, sourceDb, dna, peptides, matcher);
+        testee.parseCodingFeature(feature, sourceDb, dna, peptides, matcher);
       }
     }
 
index 6afdced..906436f 100644 (file)
 package jalview.datamodel.xdb.embl;
 
 import static org.testng.AssertJUnit.assertEquals;
-import static org.testng.AssertJUnit.assertNotNull;
 import static org.testng.AssertJUnit.assertNull;
 
 import jalview.datamodel.DBRefEntry;
 
+import java.util.Vector;
+
 import org.testng.annotations.Test;
 
 public class EmblFileTest
@@ -34,10 +35,9 @@ public class EmblFileTest
   @Test(groups = { "Functional" })
   public void testGetEmblFile()
   {
-    EmblEntry entry = EmblTestHelper.getEmblFile();
-    assertNotNull(entry);
-    // assertEquals(1, entries.size());
-    // EmblEntry entry = entries.get(0);
+    Vector<EmblEntry> entries = EmblTestHelper.getEmblFile().getEntries();
+    assertEquals(1, entries.size());
+    EmblEntry entry = entries.get(0);
 
     assertEquals("X07547", entry.getAccession());
     assertEquals("C. trachomatis plasmid", entry.getDescription());
index a79bdb8..6349164 100644 (file)
@@ -7,7 +7,7 @@ public class EmblTestHelper
   // adapted from http://www.ebi.ac.uk/ena/data/view/X07547&display=xml
   // dna and translations truncated for convenience
   private static final String TESTDATA = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
-          // + "<ROOT>"
+          + "<ROOT>"
           + "<entry accession=\"X07547\" version=\"1\" entryVersion=\"8\""
           + " dataClass=\"STD\" taxonomicDivision=\"PRO\""
           + " moleculeType=\"genomic DNA\" sequenceLength=\"7499\" topology=\"linear\""
@@ -52,10 +52,10 @@ public class EmblTestHelper
            */
           + "<sequence>GGTATGTCCTCTAGTACAAAC\n"
           + "ACCCCCAATATTGTGATATAATTAAAAACATAGCAT"
- + "</sequence></entry>";
+          + "</sequence></entry></ROOT>";
 
-  static EmblEntry getEmblFile()
+  static EmblFile getEmblFile()
   {
-    return EmblFile.getEntry(new StringReader(TESTDATA));
+    return EmblFile.getEmblFile(new StringReader(TESTDATA));
   }
 }