## New Features
## Issues Resolved
+- <!-- JAL-4073 --> Pfam Full and Seed alignment retrieval switched to the Interpro Server
+- <!-- 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
}
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();
if (!r.search(nextLine()))
{
throw new IOException(MessageManager
- .getString("exception.stockholm_invalid_format"));
+ .getString("exception.stockholm_invalid_format") +" ("+r+")");
}
else
{
*/
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
*/
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";
- static final String PFAM_BASEURL_KEY = "PFAM_BASEURL";
+ 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";
+
+ protected String alignmentType;
+
+ private static final String DEFAULT_PFAM_BASEURL = "https://www.ebi.ac.uk/interpro/wwwapi/entry/pfam/$PFAMID$/?annotation=alignment:$ALTYPE$&download";
- private static final String DEFAULT_PFAM_BASEURL = "https://pfam.xfam.org";
static
{
Platform.addJ2SDirectDatabaseCall(DEFAULT_PFAM_BASEURL);
super();
}
+ @Override
+ String getURL(String queries)
+ {
+ return getPfamDownloadURL(queries.trim().toUpperCase(Locale.ROOT),
+ alignmentType);
+ }
+
/*
* (non-Javadoc)
*
{
return DBRefSource.PFAM;
}
-
}
public PfamFull()
{
super();
- }
-
- @Override
- public String getURLSuffix()
- {
- return "/alignment/full" + GZIPPED;
+ alignmentType = FULL;
}
/*
public PfamSeed()
{
super();
- }
-
- @Override
- public String getURLSuffix()
- {
- return "/alignment/seed" + GZIPPED;
+ alignmentType = SEED;
}
/*
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)
@Test(groups = "Functional")
public void testGetURL()
{
- String path = "pfam.xfam.org/family/ABC/alignment/full/gzipped";
+ String path = "www.ebi.ac.uk/interpro/wwwapi/entry/pfam/ABC/?annotation=alignment:full&download";
// 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/wwwapi/entry/pfam/$PFAMID$/?annotation=alignment:$ALTYPE$&download");
url = new PfamFull().getURL(" abc ");
assertEquals(url, "http://" + path);
}
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)
@Test(groups = "Functional")
public void testGetURL()
{
- String path = "pfam.xfam.org/family/ABC/alignment/seed/gzipped";
+ String path = "www.ebi.ac.uk/interpro/wwwapi/entry/pfam/ABC/?annotation=alignment:seed&download";
// 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/wwwapi/entry/pfam/$PFAMID$/?annotation=alignment:$ALTYPE$&download");
url = new PfamSeed().getURL(" abc ");
assertEquals(url, "http://" + path);
}