*/
package jalview.ws.dbsources;
+import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
+import jalview.io.DataSourceType;
+import jalview.io.FileFormat;
import jalview.io.FormatAdapter;
import jalview.ws.seqfetcher.DbSourceProxyImpl;
// retrieved.
startQuery();
// TODO: trap HTTP 404 exceptions and return null
- AlignmentI rcds = new FormatAdapter().readFile(getXFAMURL()
- + queries.trim().toUpperCase() + getXFAMURLSUFFIX(),
- jalview.io.FormatAdapter.URL,
- "STH");
+ 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(),
- // getDbSource(),
+ // getDbSource(),
getDbVersion(), queries.trim().toUpperCase()));
if (!getDbSource().equals(getXfamSource()))
{ // add the specific ref too
- rcds.getSequenceAt(s).addDBRef(
- new DBRefEntry(getDbSource(), getDbVersion(), queries
- .trim().toUpperCase()));
+ rcds.getSequenceAt(s).addDBRef(new DBRefEntry(getDbSource(),
+ getDbVersion(), queries.trim().toUpperCase()));
}
}
stopQuery();
return true;
}
+ /**
* default suffix to append the retrieval URL for this source.
*
* @return "" for most Xfam sources