Merge branch 'documentation/JAL-2418_release2102' into develop
authorJim Procter <jprocter@issues.jalview.org>
Wed, 9 Aug 2017 20:15:27 +0000 (21:15 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 9 Aug 2017 20:15:27 +0000 (21:15 +0100)
examples/legacyblosum62.scm [new file with mode: 0644]
help/html/calculations/pca.html
help/html/releases.html
src/jalview/ws/dbsources/Pfam.java
src/jalview/ws/dbsources/PfamFull.java
src/jalview/ws/dbsources/PfamSeed.java
src/jalview/ws/dbsources/RfamFull.java
src/jalview/ws/dbsources/RfamSeed.java
src/jalview/ws/dbsources/Xfam.java
test/jalview/io/testProps.jvprops
test/jalview/ws/dbsources/XfamFetcherTest.java

diff --git a/examples/legacyblosum62.scm b/examples/legacyblosum62.scm
new file mode 100644 (file)
index 0000000..57072cf
--- /dev/null
@@ -0,0 +1,33 @@
+ScoreMatrix BLOSUM62Legacy
+#
+# The BLOSUM62 substitution matrix, as used in earlier versions of jalview
+#
+# Scores are not symbol case sensitive, unless column(s) are provided for lower case characters
+# The 'guide symbol' at the start of each row of score values is optional
+# Values may be integer or floating point, delimited by tab, space, comma or combinations
+#
+        A       R       N       D       C       Q       E       G       H       I       L       K       M       F       P       S       T       W       Y       V       B       Z       X       * 
+A       4      -1      -2      -2       0      -1      -1       0      -2      -1      -1      -1      -1      -2      -1       1       0      -3      -2       0      -2      -1       0      -4
+R      -1       5       0      -2      -3       1       0      -2       0      -3      -2       2      -1      -3      -2      -1      -1      -3      -2      -3      -1       0      -1      -4
+N      -2       0       6       1      -3       0       0       0       1      -3      -3       0      -2      -3      -2       1       0      -4      -2      -3       3       0      -1      -4
+D      -2      -2       1       6      -3       0       2      -1      -1      -3      -4      -1      -3      -3      -1       0      -1      -4      -3      -3       4       1      -1      -4
+C       0      3       -3      -3       9      -3      -4      -3      -3      -1      -1      -3      -1      -2      -3      -1      -1      -2      -2      -1      -3      -3      -2      -4
+Q      -1       1       0       0      -3       5       2      -2       0      -3      -2       1       0      -3      -1       0      -1      -2      -1      -2       0       3      -1      -4
+E      -1       0       0       2      -4       2       5      -2       0      -3      -3       1      -2      -3      -1       0      -1      -3      -2      -2       1       4      -1      -4
+G       0      -2       0      -1      -3      -2      -2       6      -2      -4      -4      -2      -3      -3      -2       0      -2      -2      -3      -3      -1      -2      -1      -4
+H      -2       0       1      -1      -3       0       0      -2       8      -3      -3      -1      -2      -1      -2      -1      -2      -2       2      -3       0       0      -1      -4
+I      -1      -3      -3      -3      -1      -3      -3      -4      -3       4       2      -3       1       0      -3      -2      -1      -3      -1       3      -3      -3      -1      -4
+L      -1      -2      -3      -4      -1      -2      -3      -4      -3       2       4      -2       2       0      -3      -2      -1      -2      -1       1      -4      -3      -1      -4
+K      -1       2       0      -1      -3       1       1      -2      -1      -3      -2       5      -1      -3      -1       0      -1      -3      -2      -2       0       1      -1      -4
+M      -1      -1      -2      -3      -1       0      -2      -3      -2       1       2      -1       5       0      -2      -1      -1      -1      -1       1      -3      -1      -1      -4
+F      -2      -3      -3      -3      -2      -3      -3      -3      -1       0       0      -3       0       6      -4      -2      -2       1       3      -1      -3      -3      -1      -4
+P      -1      -2      -2      -1      -3      -1      -1      -2      -2      -3      -3      -1      -2      -4       7      -1      -1      -4      -3      -2      -2      -1      -2      -4
+S       1      -1       1       0      -1       0       0       0      -1      -2      -2       0      -1      -2      -1       4       1      -3      -2      -2       0       0       0      -4
+T       0      -1       0      -1      -1      -1      -1      -2      -2      -1      -1      -1      -1      -2      -1       1       5      -2      -2       0      -1      -1       0      -4
+W      -3      -3      -4      -4      -2      -2      -3      -2      -2      -3      -2      -3      -1       1      -4      -3      -2      11       2      -3      -4      -3      -2      -4
+Y      -2      -2      -2      -3      -2      -1      -2      -3       2      -1      -1      -2      -1       3      -3      -2      -2       2       7      -1      -3      -2      -1      -4
+V       0      -3      -3      -3      -1      -2      -2      -3      -3       3       1      -2       1      -1      -2      -2       0      -3      -1       4      -3      -2      -1      -4
+B      -2      -1       3       4      -3       0       1      -1       0      -3      -4       0      -3      -3      -2       0      -1      -4      -3      -3       4       1      -1      -4
+Z      -1       0       0       1      -3       3       4      -2       0      -3      -3       1      -1      -3      -1       0      -1      -3      -2      -2       1       4      -1      -4
+X       0      -1      -1      -1      -2      -1      -1      -1      -1      -1      -1      -1      -1      -1      -2       0       0      -2      -1      -1      -1      -1      -1      -4
+*      -4      -4      -4      -4      -4      -4      -4      -4      -4      -4      -4      -4      -4      -4      -4      -4      -4      -4      -4      -4      -4      -4      -4       1 
index 7ffb160..14bb9ee 100755 (executable)
   <p>
     <strong>Principal Component Analysis</strong>
   </p>
-  <p>A principal component analysis can be performed via the 
-  <a href="calculations.html">calculations dialog</a> which is accessed by selecting <strong>Calculate&#8594;Calculate
-      Tree or PCA...</strong>.</p>
+  <p>
+    A principal component analysis can be performed via the <a
+      href="calculations.html">calculations dialog</a> which is accessed
+    by selecting <strong>Calculate&#8594;Calculate Tree or
+      PCA...</strong>.
+  </p>
   <p>This calculation creates a spatial representation of the
     similarities within a selected group, or all of the sequences in an
     alignment. After the calculation finishes, a 3D viewer displays the
     calculation are given in the <strong><em>Change
         Parameters</em></strong> menu.
   </p>
-  <p>
-    <em>PCA Calculation modes</em><br /> The default Jalview
-    calculation mode (indicated when <em><strong>Jalview
-        PCA Calculation</strong></em> is ticked in the <strong><em>Change
-        Parameters</em></strong> menu) is to perform a PCA on a matrix where elements
-    in the upper diagonal give the sum of scores for mutating in one
-    direction, and the lower diagonal is the sum of scores for mutating
-    in the other. For protein substitution models like BLOSUM62, this
-    gives an asymmetric matrix, and a different PCA to a matrix produced
-    with the method described in the paper by G. Casari, C. Sander and
-    A. Valencia. Structural Biology volume 2, no. 2, February 1995 (<a
-      href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=7749921">pubmed</a>)
-    and implemented at the SeqSpace server at the EBI. This method
-    preconditions the matrix by multiplying it with its transpose, and
-    can be employed in the PCA viewer by unchecking the <strong><em>Jalview
-        PCA Calculation</em></strong> option in the <strong><em>Change
-        Parameters</em></strong> menu.
-  </p>
   <img src="pcaviewer.gif">
   <p>
     <strong>The PCA Viewer</strong>
@@ -145,5 +130,28 @@ left-clicking and dragging the mouse over the display. -->
       added to the Jalview desktop in v2.7.</em> <em>The Reset button
       and Change Parameters menu were added in Jalview 2.8.</em> <em>Support
       for PAM250 based PCA was added in Jalview 2.8.1.</em>
+  </p>
+  <p>
+    <strong>Reproducing PCA calculations performed with older
+      Jalview releases</strong> Jalview 2.10.2 included a revised PCA
+    implementation which treated Gaps and non-standard residues in the
+    same way as a matrix produced with the method described in the paper
+    by G. Casari, C. Sander and A. Valencia. Structural Biology volume
+    2, no. 2, February 1995 (<a
+      href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=7749921">pubmed</a>)
+    and implemented at the SeqSpace server at the EBI. To reproduce
+    calculations performed with earlier Jalview releases it is necessary
+    to execute the following Groovy script:
+  
+  <pre>
+    jalview.analysis.scoremodels.ScoreMatrix.scoreGapAsAny=true
+    </pre>
+  Additionally, for PCAs performed with older versions of Jalview and
+  the Blosum62 matrix, it is also necessary to import the legacy
+  BLOSUM62 score matrix (which is asymmetric for mutations between C to
+  R) which can be downloaded at
+  http://www.jalview.org/examples/legacyBlosum62.scm
+  </p>
+
 </body>
 </html>
index 3482f71..d2d27db 100755 (executable)
@@ -315,8 +315,8 @@ li:before {
               redundant alignments
             </li>
             <li>
-              <!-- JAL-2365 -->Cannot configure feature colours with
-              lightGray or darkGray via features file
+              <!-- JAL-2365,JAL-2642 -->Cannot configure feature colours with
+              lightGray or darkGray via features file (but can specify lightgray)
             </li>
             <li>
               <!-- JAL-2421 -->Overview window visible region moves
index 941bf1a..0227e35 100644 (file)
  */
 package jalview.ws.dbsources;
 
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.DBRefEntry;
 import jalview.datamodel.DBRefSource;
-import jalview.io.DataSourceType;
-import jalview.io.FileFormat;
-import jalview.io.FormatAdapter;
 
 import com.stevesoft.pat.Regex;
 
@@ -111,37 +106,6 @@ abstract public class Pfam extends Xfam
   /*
    * (non-Javadoc)
    * 
-   * @see jalview.ws.DbSourceProxy#getSequenceRecords(java.lang.String[])
-   */
-  @Override
-  public AlignmentI getSequenceRecords(String queries) throws Exception
-  {
-    // TODO: this is not a perfect implementation. We need to be able to add
-    // individual references to each sequence in each family alignment that's
-    // retrieved.
-    startQuery();
-    AlignmentI rcds = new FormatAdapter().readFile(getXFAMURL()
-            + queries.trim().toUpperCase(), DataSourceType.URL,
-            FileFormat.Stockholm);
-    for (int s = 0, sNum = rcds.getHeight(); s < sNum; s++)
-    {
-      rcds.getSequenceAt(s).addDBRef(new DBRefEntry(DBRefSource.PFAM,
-      // getDbSource(),
-              getDbVersion(), queries.trim().toUpperCase()));
-      if (!getDbSource().equals(DBRefSource.PFAM))
-      { // add the specific ref too
-        rcds.getSequenceAt(s).addDBRef(
-                new DBRefEntry(getDbSource(), getDbVersion(), queries
-                        .trim().toUpperCase()));
-      }
-    }
-    stopQuery();
-    return rcds;
-  }
-
-  /*
-   * (non-Javadoc)
-   * 
    * @see jalview.ws.DbSourceProxy#isValidReference(java.lang.String)
    */
   @Override
index 3c5373d..12b193d 100644 (file)
@@ -39,9 +39,15 @@ public class PfamFull extends Pfam
   @Override
   protected String getXFAMURL()
   {
-    return "http://pfam.xfam.org/family/alignment/download/format?alnType=full&format=stockholm&order=t&case=l&gaps=default&entry=";
+    return "http://pfam.xfam.org/family/";
+
   }
 
+  @Override
+  public String getXFAMURLSUFFIX()
+  {
+    return "/alignment/full";
+  }
   /*
    * (non-Javadoc)
    * 
index ba9d1e0..9f07e5d 100644 (file)
@@ -41,9 +41,14 @@ public class PfamSeed extends Pfam
   @Override
   protected String getXFAMURL()
   {
-    return "http://pfam.xfam.org/family/alignment/download/format?alnType=seed&format=stockholm&order=t&case=l&gaps=default&entry=";
+    return "http://pfam.xfam.org/family/";
   }
 
+  @Override
+  public String getXFAMURLSUFFIX()
+  {
+    return "/alignment/seed";
+  }
   /*
    * (non-Javadoc)
    * 
index e6fc8ff..e263c4b 100644 (file)
@@ -41,10 +41,15 @@ public class RfamFull extends Rfam
   @Override
   protected String getXFAMURL()
   {
-    return "http://rfam.xfam.org/family/alignment/download/format?alnType=full&nseLabels=0&format=stockholm&acc=";
+    return "http://rfam.xfam.org/family/";
 
   }
 
+  @Override
+  public String getXFAMURLSUFFIX()
+  {
+    return "/alignment/full";
+  }
   /*
    * (non-Javadoc)
    * 
index 580ebe2..f714547 100644 (file)
@@ -42,14 +42,13 @@ public class RfamSeed extends Rfam
   protected String getXFAMURL()
   {
     return "http://rfam.xfam.org/family/";
-    // Janelia Farms url
-    // "http://rfam.janelia.org/cgi-bin/getalignment?type=seed&fmt=stockholm&acc=";
   }
 
   @Override
   public String getXFAMURLSUFFIX()
   {
-    return "/alignment";
+    // to download gzipped file add '?gzip=1'
+    return "/alignment/stockholm";
   }
 
   /*
index 3554f01..b0bea88 100644 (file)
@@ -20,6 +20,7 @@
  */
 package jalview.ws.dbsources;
 
+import jalview.bin.Cache;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.DBRefEntry;
 import jalview.io.DataSourceType;
@@ -56,9 +57,17 @@ public abstract class Xfam extends DbSourceProxyImpl
     // retrieved.
     startQuery();
     // TODO: trap HTTP 404 exceptions and return null
-    AlignmentI rcds = new FormatAdapter().readFile(getXFAMURL()
-            + queries.trim().toUpperCase() + getXFAMURLSUFFIX(),
+    String xfamUrl = getXFAMURL()
+            + queries.trim().toUpperCase() + getXFAMURLSUFFIX();
+
+    if (Cache.log != null)
+    {
+      Cache.log.debug("XFAM URL for retrieval is: " + xfamUrl);
+    }
+
+    AlignmentI rcds = new FormatAdapter().readFile(xfamUrl  ,
             DataSourceType.URL, FileFormat.Stockholm);
+
     for (int s = 0, sNum = rcds.getHeight(); s < sNum; s++)
     {
       rcds.getSequenceAt(s).addDBRef(new DBRefEntry(getXfamSource(),
index 8ede59c..96364e4 100644 (file)
@@ -84,3 +84,4 @@ USE_PROXY=false
 WRAP_ALIGNMENT=false
 #DAS_REGISTRY_URL=http\://www.dasregistry.org/das/ # retired 01/05/2015
 DAS_REGISTRY_URL=http\://www.ebi.ac.uk/das-srv/registry/das/
+logs.Jalview.level=DEBUG
index 2f28484..573022d 100644 (file)
@@ -49,6 +49,10 @@ public class XfamFetcherTest
     Assert.assertTrue(seedrf.getHeight() > 1,
             "Seed Alignment for " + rfs.getTestQuery()
                     + " didn't contain more than one sequence.");
+    Assert.assertTrue(seedrf.getProperties().size() > 0,
+            "Seed Alignment for " + rfs.getTestQuery()
+                    + " didn't have any properties.");
+
   }
 
   @Test(groups = { "External" })
@@ -66,9 +70,16 @@ public class XfamFetcherTest
     AlignmentI seedpf = pfseed.getSequenceRecords(pff.getTestQuery());
     Assert.assertNotNull(seedpf, "Seed Alignment for " + pff.getTestQuery()
             + " didn't retrieve.");
+    Assert.assertTrue(seedpf.getProperties().size() > 0,
+            "Seed Alignment for " + pfseed.getTestQuery()
+                    + " didn't have any properties.");
 
     Assert.assertTrue(seedpf.getHeight() < fullpf.getHeight(),
             "Expected Full alignment to have more sequences than seed for "
                     + pff.getTestQuery());
+    Assert.assertTrue(fullpf.getProperties().size() > 0,
+            "Full Alignment for " + pff.getTestQuery()
+                    + " didn't have any properties.");
+
   }
 }