if (!r.search(nextLine()))
{
throw new IOException(MessageManager
- .getString("exception.stockholm_invalid_format"));
+ .getString("exception.stockholm_invalid_format") +" ("+r+")");
}
else
{
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
{
- public static final String FULL="full",RP35="rp35",RP15="rp15",RP75="rp75",RP55="rp55",SEED="seed";
-
- 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;
- }
+ public static final String FULL = "full", RP35 = "rp35", RP15 = "rp15",
+ RP75 = "rp75", RP55 = "rp55", SEED = "seed";
+
+ 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";
static
super();
}
-
- String getURL(String queries)
+ @Override
+ String getURL(String queries)
{
- return getPfamDownloadURL(
- queries.trim().toUpperCase(Locale.ROOT), alignmentType);
+ return getPfamDownloadURL(queries.trim().toUpperCase(Locale.ROOT),
+ alignmentType);
}
/*
public PfamFull()
{
super();
- alignmentType=FULL;
+ alignmentType = FULL;
}
/*
public PfamSeed()
{
super();
- alignmentType=SEED;
+ 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 = "www.ebi.ac.uk/interpro/wwwapi/entry/pfam/ABC/?annotation=alignment:full&download";
+ 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://www.ebi.ac.uk/interpro/wwwapi/entry/pfam/$PFAMID$/?annotation=alignment:$ALTYPE$&download");
+ 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);
}