*/
package jalview.ws.seqfetcher;
+import jalview.api.FeatureSettingsModelI;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
Stack<String> queriesLeft = new Stack<String>();
queriesLeft.addAll(query);
- for (DbSourceProxy fetcher : getSourceProxy(db))
+ List<DbSourceProxy> proxies = getSourceProxy(db);
+ for (DbSourceProxy fetcher : proxies)
{
List<String> queriesMade = new ArrayList<String>();
HashSet<String> queriesFound = new HashSet<String>();
{
continue; // wrong sort of data
}
- boolean doMultiple = fetcher.getAccessionSeparator() != null;
- // No separator - no Multiple Queries
+ boolean doMultiple = fetcher.getMaximumQueryCount() > 1;
while (!queriesLeft.isEmpty())
{
StringBuffer qsb = new StringBuffer();
try
{
// create a fetcher and go to it
- seqset = fetcher.getSequenceRecords(qsb.toString()); // ,
- // queriesFailed);
+ seqset = fetcher.getSequenceRecords(qsb.toString());
} catch (Exception ex)
{
System.err.println("Failed to retrieve the following from "
{
rseqs.addElement(seqs[is]);
DBRefEntry[] frefs = DBRefUtils.searchRefs(seqs[is]
- .getDBRef(), new DBRefEntry(db, null, null));
+ .getDBRefs(), new DBRefEntry(db, null, null));
if (frefs != null)
{
for (DBRefEntry dbr : frefs)
{
System.out.println("# Adding " + queriesMade.size()
+ " ids back to queries list for searching again (" + db
- + ".");
+ + ")");
queriesLeft.addAll(queriesMade);
}
}
return prlist.toArray(new DbSourceProxy[0]);
}
+ /**
+ * Returns a preferred feature colouring scheme for the given source, or null
+ * if none is defined.
+ *
+ * @param source
+ * @return
+ */
+ public FeatureSettingsModelI getFeatureColourScheme(String source)
+ {
+ /*
+ * return the first non-null colour scheme for any proxy for
+ * this database source
+ */
+ for (DbSourceProxy proxy : getSourceProxy(source))
+ {
+ FeatureSettingsModelI preferredColours = proxy
+ .getFeatureColourScheme();
+ if (preferredColours != null)
+ {
+ return preferredColours;
+ }
+ }
+ return null;
+ }
}