Merge branch 'develop' into bug/JAL-1988_JAL-3772_improved_quit_handling
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 27 Oct 2022 15:20:14 +0000 (16:20 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 27 Oct 2022 15:20:14 +0000 (16:20 +0100)
15 files changed:
RELEASE
help/help/helpTOC.xml
help/help/html/colourSchemes/index.html
help/help/html/features/seqfetch.html
help/markdown/releases/release-2_11_2_5.md
help/markdown/whatsnew/whatsnew-2_11_2_5.md [new file with mode: 0644]
src/jalview/bin/Jalview.java
src/jalview/io/FileParse.java
src/jalview/io/StockholmFile.java
src/jalview/ws/dbsources/Pfam.java
src/jalview/ws/dbsources/PfamFull.java
src/jalview/ws/dbsources/PfamSeed.java
test/jalview/bin/CommandLineOperations.java
test/jalview/ws/dbsources/PfamFullTest.java
test/jalview/ws/dbsources/PfamSeedTest.java

diff --git a/RELEASE b/RELEASE
index c63eaef..5bcf6d0 100644 (file)
--- a/RELEASE
+++ b/RELEASE
@@ -1,2 +1,2 @@
 jalview.release=releases/Release_2_11_2_Branch
-jalview.version=2.11.2.4
+jalview.version=2.11.2.5
index 1b4156e..3308456 100755 (executable)
                        <tocitem text="ClustalX" target="colours.clustal" />
                        <tocitem text="Zappo" target="colours.zappo" />
                        <tocitem text="Taylor" target="colours.taylor" />
-                       <tocitem text="gecos:flower" target="colours.gecos-flower" />
-                       <tocitem text="gecos:blossom" target="colours.gecos-blossom" />
-                       <tocitem text="gecos:sunset" target="colours.gecos-sunset" />
-                       <tocitem text="gecos:ocean" target="colours.gecos-ocean" />
+                       <tocitem text="gecos Flower" target="colours.gecos-flower" />
+                       <tocitem text="gecos Blossom" target="colours.gecos-blossom" />
+                       <tocitem text="gecos Sunset" target="colours.gecos-sunset" />
+                       <tocitem text="gecos Ocean" target="colours.gecos-ocean" />
                        <tocitem text="Hydrophobicity" target="colours.hydro" />
                        <tocitem text="Helix propensity" target="colours.helix" />
                        <tocitem text="Strand propensity" target="colours.strand" />
index 672910e..e006618 100755 (executable)
@@ -198,7 +198,7 @@ td {
                                                        <td></td>
                                                </tr>
                                                <tr>
-                                                       <td>gecos:flower</td>
+                                                       <td>gecos Flower</td>
 
                                                        <td bgcolor="#b18a51"></td>
                                                        <td bgcolor="#83bff1"></td>
@@ -225,7 +225,7 @@ td {
                                                        <td></td>
                                                </tr>
                                                <tr>
-                                                       <td>gecos:blossom</td>
+                                                       <td>gecos Blossom</td>
                                                        <td bgcolor="#8bc4b4"></td>
                                                        <td bgcolor="#fc9502"></td>
                                                        <td bgcolor="#b5c206"></td>
@@ -251,7 +251,7 @@ td {
                                                        <td></td>
                                                </tr>
                                                <tr>
-                                                       <td>gecos:sunset</td>
+                                                       <td>gecos Sunset</td>
                                                        <td bgcolor="#fea0fd"></td>
                                                        <td bgcolor="#85746a"></td>
                                                        <td bgcolor="#abc8f5"></td>
@@ -277,7 +277,7 @@ td {
                                                        <td></td>
                                                </tr>
                                                <tr>
-                                                       <td>gecos:ocean</td>
+                                                       <td>gecos Ocean</td>
                                                        <td bgcolor="#c6ca9b"></td>
                                                        <td bgcolor="#0ca0a8"></td>
                                                        <td bgcolor="#0adfc3"></td>
index 7d4a389..8c4e462 100755 (executable)
       Bioinformatics Institute.<br> Nucleic Acids Res.
       33(1):W25-W28 (2005) <br> <br>
     </li>
+    <li>
+      <a href="https://docs.rfam.org/en/latest/citing-rfam.html#rfam-references">RFAM - a database of RNA families</a>
+    </li>
+    <li>
+      <a href="https://pfam-docs.readthedocs.io/en/latest/citing-pfam.html">PFAM - a database of protein families</a><br/>
+      <a href="https://academic.oup.com/nar/article/49/D1/D344/5958491">Data is provided by the Interpro Web API</a>
+    </li>
   </ul>
 </body>
 </html>
index 4266bad..a9ea9e4 100644 (file)
@@ -1,12 +1,12 @@
 ---
 version: 2.11.2.5
-date: 2022-10-01
+date: 2022-10-11
 channel: "release"
 ---
 
-## New Features
-
 ## Issues Resolved
+- <!-- JAL-4073 --> Pfam Full and Seed alignment retrieval switched to use http://www.ebi.ac.uk/interpro/api/
+- <!-- JAL-4074 --> URLs reporting Content-Type as application/gzip not being recognized as a gzipped stream
 - <!-- JAL-4063 --> Clustalx colour scheme renamed (back) to Clustal in the GUI
 - <!-- JAL-4014 --> Spanish translations added for gecos colour schemes introduced in 2.11.2.4
 - <!-- JAL-3612 --> Overview doesn't colour nested features the same as in the alignment view 
diff --git a/help/markdown/whatsnew/whatsnew-2_11_2_5.md b/help/markdown/whatsnew/whatsnew-2_11_2_5.md
new file mode 100644 (file)
index 0000000..d5c4b66
--- /dev/null
@@ -0,0 +1,2 @@
+Jalview 2.11.2.5 is the fifth patch release in the 2.11.2 series. It includes several minor revisions, including a revised Pfam alignment retrieval client based on the Interpro web API, and a fix for a bug where overlapping features of the same type assigned different colours were not shown as coloured differently in the overview window. 
+
index f0477b9..546e931 100755 (executable)
@@ -1180,12 +1180,16 @@ public class Jalview
     System.setProperty("com.apple.mrj.application.apple.menu.about.name",
             ChannelProperties.getProperty("app_name"));
     System.setProperty("apple.laf.useScreenMenuBar", "true");
+    /*
+     * broken native LAFs on (ARM?) macbooks
     set = setQuaquaLookAndFeel();
     if ((!set) || !UIManager.getLookAndFeel().getClass().toString()
             .toLowerCase(Locale.ROOT).contains("quaqua"))
     {
       set = setVaquaLookAndFeel();
     }
+     */
+    set = setFlatLookAndFeel();
     return set;
   }
 
index 2dec559..d3a6ba9 100755 (executable)
@@ -343,7 +343,7 @@ public class FileParse
     }
     String encoding = _conn.getContentEncoding();
     String contentType = _conn.getContentType();
-    boolean isgzipped = "application/x-gzip".equalsIgnoreCase(contentType)
+    boolean isgzipped = "application/x-gzip".equalsIgnoreCase(contentType) || contentType.endsWith("gzip")
             || "gzip".equals(encoding);
     Exception e = null;
     InputStream inputStream = _conn.getInputStream();
index 5d645ca..a3f7531 100644 (file)
@@ -219,7 +219,7 @@ public class StockholmFile extends AlignFile
     if (!r.search(nextLine()))
     {
       throw new IOException(MessageManager
-              .getString("exception.stockholm_invalid_format"));
+                           .getString("exception.stockholm_invalid_format") +" ("+r+")");
     }
     else
     {
index 2587bac..316c1aa 100644 (file)
  */
 package jalview.ws.dbsources;
 
+import java.util.Locale;
+
+import com.stevesoft.pat.Regex;
+
 import jalview.bin.Cache;
 import jalview.datamodel.DBRefSource;
 import jalview.util.Platform;
 
-import com.stevesoft.pat.Regex;
-
 /**
  * TODO: later PFAM is a complex datasource - it could return a tree in addition
  * to an alignment TODO: create interface to pass alignment properties and tree
@@ -36,14 +38,26 @@ import com.stevesoft.pat.Regex;
  */
 abstract public class Pfam extends Xfam
 {
-  /*
-   * append to URLs to retrieve as a gzipped file
-   */
-  protected static final String GZIPPED = "/gzipped";
+  public static final String FULL = "full", RP35 = "rp35", RP15 = "rp15",
+          RP75 = "rp75", RP55 = "rp55", SEED = "seed", UNIPROT = "uniprot";
+
+  public String getPfamDownloadURL(String id, String alType)
+  {
+    String url = Cache.getDefault(PFAM_BASEURL_KEY, DEFAULT_PFAM_BASEURL);
+    url = url.replace("$PFAMID$", id);
+    url = url.replace("$ALTYPE$", alType);
+    return url;
+  }
+
+  static final String PFAM_BASEURL_KEY = "PFAM_INTERPRO_URL_TEMPLATE";
 
-  static final String PFAM_BASEURL_KEY = "PFAM_BASEURL";
+  protected String alignmentType;
+
+  /**
+   * docs are http://www.ebi.ac.uk/interpro/api/
+   */
+  private static final String DEFAULT_PFAM_BASEURL = "https://www.ebi.ac.uk/interpro/api/entry/pfam/$PFAMID$/?annotation=alignment:$ALTYPE$";
 
-  private static final String DEFAULT_PFAM_BASEURL = "https://pfam.xfam.org";
   static
   {
     Platform.addJ2SDirectDatabaseCall(DEFAULT_PFAM_BASEURL);
@@ -54,6 +68,13 @@ abstract public class Pfam extends Xfam
     super();
   }
 
+  @Override
+  String getURL(String queries)
+  {
+    return getPfamDownloadURL(queries.trim().toUpperCase(Locale.ROOT),
+            alignmentType);
+  }
+
   /*
    * (non-Javadoc)
    * 
@@ -132,5 +153,4 @@ abstract public class Pfam extends Xfam
   {
     return DBRefSource.PFAM;
   }
-
 }
index d71892b..6cf5fda 100644 (file)
@@ -29,12 +29,7 @@ public class PfamFull extends Pfam
   public PfamFull()
   {
     super();
-  }
-
-  @Override
-  public String getURLSuffix()
-  {
-    return "/alignment/full" + GZIPPED;
+    alignmentType = FULL;
   }
 
   /*
index f64d07f..45a1840 100644 (file)
@@ -31,12 +31,7 @@ public class PfamSeed extends Pfam
   public PfamSeed()
   {
     super();
-  }
-
-  @Override
-  public String getURLSuffix()
-  {
-    return "/alignment/seed" + GZIPPED;
+    alignmentType = SEED;
   }
 
   /*
index 3bfd4f3..7e775d8 100644 (file)
@@ -250,7 +250,7 @@ public class CommandLineOperations
 
     // number of lines expected on STDERR when Jalview starts up normally
     // may need to adjust this if Jalview is excessively noisy ?
-    final int STDERR_SETUPLINES = 30;
+    final int STDERR_SETUPLINES = 50;
 
     // thread monitors stderr - bails after SETUP_TIMEOUT or when
     // STDERR_SETUPLINES have been read
index 23cceb2..d03057d 100644 (file)
@@ -22,11 +22,11 @@ package jalview.ws.dbsources;
 
 import static org.testng.Assert.assertEquals;
 
-import jalview.bin.Cache;
-
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
+import jalview.bin.Cache;
+
 public class PfamFullTest
 {
   @BeforeClass(alwaysRun = true)
@@ -38,14 +38,15 @@ public class PfamFullTest
   @Test(groups = "Functional")
   public void testGetURL()
   {
-    String path = "pfam.xfam.org/family/ABC/alignment/full/gzipped";
+    String path = "www.ebi.ac.uk/interpro/api/entry/pfam/ABC/?annotation=alignment:full";
 
     // with default value for domain
     String url = new PfamFull().getURL(" abc ");
     assertEquals(url, "https://" + path);
 
     // with override in properties
-    Cache.setProperty(Pfam.PFAM_BASEURL_KEY, "http://pfam.xfam.org");
+    Cache.setProperty(Pfam.PFAM_BASEURL_KEY,
+            "http://www.ebi.ac.uk/interpro/api/entry/pfam/$PFAMID$/?annotation=alignment:$ALTYPE$");
     url = new PfamFull().getURL(" abc ");
     assertEquals(url, "http://" + path);
   }
index 451810b..3c30086 100644 (file)
@@ -22,11 +22,11 @@ package jalview.ws.dbsources;
 
 import static org.testng.Assert.assertEquals;
 
-import jalview.bin.Cache;
-
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
+import jalview.bin.Cache;
+
 public class PfamSeedTest
 {
   @BeforeClass(alwaysRun = true)
@@ -38,14 +38,15 @@ public class PfamSeedTest
   @Test(groups = "Functional")
   public void testGetURL()
   {
-    String path = "pfam.xfam.org/family/ABC/alignment/seed/gzipped";
+    String path = "www.ebi.ac.uk/interpro/api/entry/pfam/ABC/?annotation=alignment:seed";
 
     // with default value for domain
     String url = new PfamSeed().getURL(" abc ");
     assertEquals(url, "https://" + path);
 
     // with override in properties
-    Cache.setProperty(Pfam.PFAM_BASEURL_KEY, "http://pfam.xfam.org");
+    Cache.setProperty(Pfam.PFAM_BASEURL_KEY,
+            "http://www.ebi.ac.uk/interpro/api/entry/pfam/$PFAMID$/?annotation=alignment:$ALTYPE$");
     url = new PfamSeed().getURL(" abc ");
     assertEquals(url, "http://" + path);
   }