Search in sources :

Example 1 with DbfException

use of uk.ac.ebi.jdbfetch.exceptions.DbfException in project vcell by virtualcell.

the class AnnotationMapping method getNameRef.

public static ArrayList<String> getNameRef(ArrayList<Xref> xRef, String entryName) {
    CachedDataBaseReferenceReader dbReader = CachedDataBaseReferenceReader.getCachedReader();
    ArrayList<String> names = new ArrayList<String>();
    for (Xref xref : xRef) {
        try {
            // System.out.println(xref.getDb() + "***" + xref.getId());
            if (xref.getDb().toLowerCase().equals("uniprot")) {
            // String name = dbReader.getMoleculeDataBaseReference(xref.getId());
            // if(name != null)names.add(name);
            // if(xref.getId() != null && xref.getDb().toLowerCase() != null) {
            // names.add(xref.getDb().toLowerCase()+ ":" + xref.getId());
            // }
            // System.out.println(xref.getId() + ">>>>>>>"+ name);
            } else if (xref.getDb().toLowerCase().equals("interpro")) {
            // String name = dbReader.getMoleculeDataBaseReference("interpro", xref.getId());
            // if(name != null)names.add(name);
            // if(xref.getId() != null && xref.getDb().toLowerCase() != null) {
            // names.add(xref.getDb().toLowerCase()+ ":" + xref.getId());
            // }
            // System.out.println(xref.getId() + ">>>>>>>"+ name);
            } else if (xref.getDb().toLowerCase().equals("obo.chebi")) {
                String id = xref.getId().substring(6);
                String name = dbReader.getChEBIName(id);
                if (name != null)
                    names.add(name);
            // System.out.println(xref.getId() + ">>>>>>>"+ name);
            } else if (xref.getDb().toLowerCase().equals("gene_ontology")) {
            // String name = dbReader.getGOTerm(xref.getId());
            // if(name != null) {
            // names.add(name);
            // } else
            // if(xref.getId() != null && xref.getDb().toLowerCase() != null) {
            // names.add(xref.getDb().toLowerCase()+ ":" + xref.getId());
            // }
            // System.out.println(xref.getId() + ">>>>>>>"+ name);
            } else // else if(xref.getDb().toLowerCase().equals("ec-code")){
            // WSDBFetchServerServiceLocator providerLocator = new WSDBFetchServerServiceLocator();
            // WSDBFetchServer server = providerLocator.getWSDbfetch();
            // String[] supported = server.getSupportedDBs();
            // for (int i = 0; i < supported.length; i++) {
            // System.out.println(supported[i]);
            // }
            // String fetchResultStr = server.fetchBatch("embl", xref.getId(),null,null);
            // System.out.println(xref.getId() + ">>>>>>> lookup"+fetchResultStr);
            // }
            {
            // System.out.println(xref.getDb());
            }
        } catch (DbfConnException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (DbfNoEntryFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (DbfParamsException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (DbfException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (InputException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (ServiceException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (DataAccessException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    if (names.size() == 0 && entryName != null)
        names.add(entryName);
    return names;
}
Also used : DbfNoEntryFoundException(uk.ac.ebi.jdbfetch.exceptions.DbfNoEntryFoundException) DbfException(uk.ac.ebi.jdbfetch.exceptions.DbfException) ArrayList(java.util.ArrayList) DbfParamsException(uk.ac.ebi.jdbfetch.exceptions.DbfParamsException) ServiceException(javax.xml.rpc.ServiceException) DbfNoEntryFoundException(uk.ac.ebi.jdbfetch.exceptions.DbfNoEntryFoundException) DbfParamsException(uk.ac.ebi.jdbfetch.exceptions.DbfParamsException) DataAccessException(org.vcell.util.DataAccessException) DbfException(uk.ac.ebi.jdbfetch.exceptions.DbfException) RemoteException(java.rmi.RemoteException) InputException(uk.ac.ebi.www.ws.services.WSDbfetch.InputException) DbfConnException(uk.ac.ebi.jdbfetch.exceptions.DbfConnException) Xref(org.vcell.pathway.Xref) UnificationXref(org.vcell.pathway.UnificationXref) RelationshipXref(org.vcell.pathway.RelationshipXref) PublicationXref(org.vcell.pathway.PublicationXref) ServiceException(javax.xml.rpc.ServiceException) InputException(uk.ac.ebi.www.ws.services.WSDbfetch.InputException) DbfConnException(uk.ac.ebi.jdbfetch.exceptions.DbfConnException) RemoteException(java.rmi.RemoteException) DataAccessException(org.vcell.util.DataAccessException)

Aggregations

RemoteException (java.rmi.RemoteException)1 ArrayList (java.util.ArrayList)1 ServiceException (javax.xml.rpc.ServiceException)1 PublicationXref (org.vcell.pathway.PublicationXref)1 RelationshipXref (org.vcell.pathway.RelationshipXref)1 UnificationXref (org.vcell.pathway.UnificationXref)1 Xref (org.vcell.pathway.Xref)1 DataAccessException (org.vcell.util.DataAccessException)1 DbfConnException (uk.ac.ebi.jdbfetch.exceptions.DbfConnException)1 DbfException (uk.ac.ebi.jdbfetch.exceptions.DbfException)1 DbfNoEntryFoundException (uk.ac.ebi.jdbfetch.exceptions.DbfNoEntryFoundException)1 DbfParamsException (uk.ac.ebi.jdbfetch.exceptions.DbfParamsException)1 InputException (uk.ac.ebi.www.ws.services.WSDbfetch.InputException)1