*/
package jalview.ws.dbsources;
-import jalview.datamodel.DBRefSource;
+import java.util.Locale;
import com.stevesoft.pat.Regex;
+import jalview.bin.Cache;
+import jalview.datamodel.DBRefSource;
+import jalview.util.Platform;
+
/**
* 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", 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";
+
+ protected String alignmentType;
+
+ /**
+ * docs are http://www.ebi.ac.uk/interpro/api/
+ */
+ private static final String DEFAULT_PFAM_BASEURL = "www.ebi.ac.uk/interpro/api/entry/pfam/$PFAMID$/?annotation=alignment:$ALTYPE";
+
+ static
+ {
+ Platform.addJ2SDirectDatabaseCall(DEFAULT_PFAM_BASEURL);
+ }
public Pfam()
{
super();
}
+ @Override
+ String getURL(String queries)
+ {
+ return getPfamDownloadURL(queries.trim().toUpperCase(Locale.ROOT),
+ alignmentType);
+ }
+
/*
* (non-Javadoc)
*
@Override
public String getAccessionSeparator()
{
- // TODO Auto-generated method stub
return null;
}
@Override
public Regex getAccessionValidator()
{
- // TODO Auto-generated method stub
return null;
}
@Override
public String getDbVersion()
{
- // TODO Auto-generated method stub
return null;
}
- /**
- * Returns base URL for selected Pfam alignment type
- *
- * @return PFAM URL stub for this DbSource
- */
@Override
- protected abstract String getXFAMURL();
+ protected String getURLPrefix()
+ {
+ return Cache.getDefault(PFAM_BASEURL_KEY, DEFAULT_PFAM_BASEURL);
+ }
/*
* (non-Javadoc)
{
return DBRefSource.PFAM;
}
-
}