addDBRefSourceImpl(jalview.ws.dbsources.Pdb.class);\r
addDBRefSourceImpl(jalview.ws.dbsources.Pfam.class);\r
};\r
-\r
+ /**\r
+ * simple run method to test dbsources.\r
+ * @param argv\r
+ */\r
public static void main(String[] argv)\r
{\r
AlignmentI ds = null;\r
Vector noProds = new Vector();\r
+ String usage = "SequenceFetcher.main [<DBNAME> <ACCNO>]\n"\r
+ +"With no arguments, all DbSources will be queried with their test Accession number.\n"\r
+ +"If given two arguments, SequenceFetcher will try to find the DbFetcher corresponding to <DBNAME> and retrieve <ACCNO> from it.";\r
if (argv != null && argv.length > 0)\r
{\r
+ DbSourceProxy sp = new SequenceFetcher().getSourceProxy(argv[0]);\r
+ if (sp!=null)\r
+ {\r
+ AlignmentI al = null;\r
+ try\r
+ {\r
+ al = sp.getSequenceRecords(argv[1]);\r
+ } catch (Exception e)\r
+ {\r
+ e.printStackTrace();\r
+ System.err.println("Error when retrieving "+argv[1]+" from "+argv[0]+"\nUsage: "+usage);\r
+ }\r
+ SequenceI[] prod = al.getSequencesArray();\r
+ if (al!=null)\r
+ {\r
+ for (int p = 0; p < prod.length; p++)\r
+ {\r
+ System.out.println("Prod " + p + ": "\r
+ + prod[p].getDisplayId(true) + " : "+prod[p].getDescription());\r
+ }\r
+ }\r
+ return;\r
+ } else {\r
+ System.err.println("Can't resolve "+argv[0]+" as a database name. Allowed values are :\n"+new SequenceFetcher().getSupportedDb());\r
+ }\r
System.out\r
- .println("Ignoring arguments. Future Usage = dbname:query1;query2;...");\r
+ .println(usage);\r
}\r
ASequenceFetcher sfetcher = new SequenceFetcher();\r
String[] dbSources = sfetcher.getSupportedDb();\r