*/
public static String PFAM = "PFAM";
/**
+ * GeneDB ID
+ */
+ public static final String GENEDB = "GeneDB";
+
+ /**
* List of databases whose sequences might have coding regions annotated
*/
- public static final String[] DNACODINGDBS = { EMBL, EMBLCDS};
- public static final String[] CODINGDBS = { EMBLCDS};
+ public static final String[] DNACODINGDBS = { EMBL, EMBLCDS, GENEDB};
+ public static final String[] CODINGDBS = { EMBLCDS, GENEDB};
public static final String[] PROTEINDBS = { UNIPROT, PDB, UNIPROTKB};
public static final String[] PROTEINSEQ = { UNIPROT, UNIPROTKB};
public static final String[] PROTEINSTR = { PDB };
public static final Object DOMAINDB = "DOMAIN";
/**
* DB query can take multiple accession codes concatenated
- * by a separator.
+ * by a separator. Value of property indicates maximum number of accession codes to send at a time.
*/
public static final Object MULTIACC = "MULTIACC";
}
AlignFrame alignFrame;
StringBuffer result;
final String noDbSelected = "-- Select Database --";
+ Hashtable sources = new Hashtable();
public SequenceFetcher(AlignFrame af)
{
alignFrame = af;
* internal source to externally distinct names.
* UNIPROT and UP_NAME are identical DB sources,
* and should be collapsed.
- *
+ */
- String dbs[] = sfetch.getSupportedDb();
+ String dbs[] = sfetch.getSupportedDb();
for (int i=0; i<dbs.length;i++)
{
- if (DBRefSource.isPrimaryDb(dbs[i]))
+ if (!sources.containsValue(dbs[i]))
{
- database.addItem(dbs[i]);
- // should have some kind of human readable description of each database displayed when
- * that combo is selected.
- }
- }*/
- database.addItem("Uniprot");
- database.addItem("EMBL");
- database.addItem("EMBLCDS");
- database.addItem("PDB");
- database.addItem("PFAM");
+ String name = sfetch.getSourceProxy(dbs[i]).getDbName();
+ sources.put(name, dbs[i]);
+ database.addItem(name);
+ }
+ }
try
{
jbInit();
resetDialog();
return;
}
-
+ AlignmentI aresult=null;
+ try {
+ aresult = sfetch.getSourceProxy((String)sources.get(database.getSelectedItem()))
+ .getSequenceRecords(textArea.getText());
+ }
+ catch (Exception e)
+ {
+ showErrorMessage("Error retrieving " + textArea.getText()
+ + " from " + database.getSelectedItem());
+ //error +="Couldn't retrieve sequences from "+database.getSelectedItem();
+ System.err.println("Retrieval failed for source ='"+database.getSelectedItem()+"' and query\n'"+textArea.getText()+"'\n");
+ e.printStackTrace();
+ }
+ if (aresult!=null)
+ {
+ parseResult(aresult, null, null);
+ }
+ resetDialog();
+ }
+ /*
result = new StringBuffer();
if (database.getSelectedItem().equals("Uniprot"))
{
+ "=" + sq.getStart()
+ "-" + sq.getEnd());
sq.getDatasetSequence().addPDBId(entry);
- */
+ *
// Add PDB DB Refs
// We make a DBRefEtntry because we have obtained the PDB file from a verifiable source
// JBPNote - PDB DBRefEntry should also carry the chain and mapping information
results[i] = (SequenceI) result.elementAt(i);
result.setElementAt(null,i);
}
- return results;
- }
- Alignment parseResult(String result, String title)
+ return results;
+ }*/
+ AlignmentI parseResult(String result, String title)
{
String format = new IdentifyFile().Identify(result, "Paste");
Alignment sequences = null;
return null;
}
- Alignment parseResult(Alignment al, String title, String currentFileFormat)
+ AlignmentI parseResult(AlignmentI al, String title, String currentFileFormat)
{
if (al != null && al.getHeight() > 0)