*/
package jalview.ws.dbsources;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
-import jalview.io.DataSourceType;
-import jalview.io.FileFormat;
-import jalview.io.FormatAdapter;
import com.stevesoft.pat.Regex;
/*
* (non-Javadoc)
*
- * @see jalview.ws.DbSourceProxy#getSequenceRecords(java.lang.String[])
- */
- @Override
- public AlignmentI getSequenceRecords(String queries) throws Exception
- {
- // TODO: this is not a perfect implementation. We need to be able to add
- // individual references to each sequence in each family alignment that's
- // retrieved.
- startQuery();
- AlignmentI rcds = new FormatAdapter().readFile(getXFAMURL()
- + queries.trim().toUpperCase(), DataSourceType.URL,
- FileFormat.Stockholm);
- for (int s = 0, sNum = rcds.getHeight(); s < sNum; s++)
- {
- rcds.getSequenceAt(s).addDBRef(new DBRefEntry(DBRefSource.PFAM,
- // getDbSource(),
- getDbVersion(), queries.trim().toUpperCase()));
- if (!getDbSource().equals(DBRefSource.PFAM))
- { // add the specific ref too
- rcds.getSequenceAt(s).addDBRef(
- new DBRefEntry(getDbSource(), getDbVersion(), queries
- .trim().toUpperCase()));
- }
- }
- stopQuery();
- return rcds;
- }
-
- /*
- * (non-Javadoc)
- *
* @see jalview.ws.DbSourceProxy#isValidReference(java.lang.String)
*/
@Override