|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.ac.ebi.ep.mm.MegaJdbcMapper
public class MegaJdbcMapper
Plain JDBC implementation of MegaMapper.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface uk.ac.ebi.ep.mm.MegaMapper |
|---|
MegaMapper.Constraint |
| Field Summary | |
|---|---|
static String[] |
ILLEGAL_COMPOUND
|
| Constructor Summary | |
|---|---|
MegaJdbcMapper(Connection con)
|
|
| Method Summary | |
|---|---|
void |
closeMap()
Closes the mega-map. |
void |
commit()
Commits any pending changes to the underlying mega-map. |
void |
deleteEntry(Entry entry)
Deletes one entry and all the associated accessions and xrefs. |
List<String> |
getAllUniProtAccessions(MmDatabase database)
to retrieve all accessions for the given database |
List<XRef> |
getChMBLXrefs(MmDatabase db,
String accession,
MmDatabase... xDbs)
retrieves a List of XRef with database name as ChEMBL. |
Map<String,String> |
getCompounds(MmDatabase db,
String accessions,
MmDatabase... xDbs)
|
Map<String,String> |
getCompoundsNew(MmDatabase db,
String accession,
MmDatabase... xDbs)
|
Map<String,String> |
getDisease(MmDatabase db,
String accessions,
MmDatabase... xDbs)
|
Map<String,String> |
getDiseaseNew(MmDatabase db,
String accession,
MmDatabase... xDbs)
|
Entry |
getEntryForAccession(MmDatabase db,
String accession)
Retrieves an entry for a given accession. |
Collection<XRef> |
getXrefs(Collection<Entry> entries,
MmDatabase... dbs)
Retrieves cross references from the mega-map for several entries. |
Collection<XRef> |
getXrefs(Entry entry)
Retrieves cross references from the mega-map regardless of the referencing/referenced database. |
Collection<XRef> |
getXrefs(Entry entry,
MmDatabase... dbs)
Retrieves cross references from the mega-map. |
Collection<XRef> |
getXrefs(MmDatabase db,
String accession)
Retrieves cross references from the mega-map for a given accession (not ID) regardless of the referencing/referenced database.. |
Collection<XRef> |
getXrefs(MmDatabase db,
String idFragment,
MegaMapper.Constraint constraint,
MmDatabase... xDbs)
Retrieves cross references from the mega-map for a given text which matches an entry ID, who is related to the given databases. This method is provided in order to search for UniProt ID prefixes (ex. |
Collection<XRef> |
getXrefs(MmDatabase db,
String idFragment,
MegaMapper.Constraint constraint,
Relationship rel)
Retrieves cross references from the mega-map for a given text which matches an entry ID, who has a given relationship (if any). This method is provided in order to search for UniProt ID prefixes (ex. |
Collection<XRef> |
getXrefs(MmDatabase db,
String accession,
MmDatabase... xDbs)
Retrieves cross references from the mega-map for a given accession (not ID) to/from the given database(s). |
Collection<XRef> |
getXrefs(MmDatabase db,
String accession,
Relationship relationship)
Retrieves cross references from the mega-map for a given accession (not ID) given a concrete relationship. |
int |
getXrefsSize(MmDatabase db,
String accession,
MmDatabase... xDbs)
retrieves the total number of Xrefs found for a given accession. |
void |
handleError()
Handles any errors which might affect the mega-map. |
void |
openMap()
Opens the mega-map for writing. |
void |
rollback()
Rolls back any pending changes to the underlying mega-map. |
void |
write(Collection<Entry> entries,
Collection<XRef> xrefs)
Writes entries and relationships to the mega-map. |
void |
writeEntries(Collection<Entry> entries)
|
void |
writeEntry(Entry entry)
Writes one entry to the mega-map. |
void |
writeXref(XRef xref)
Writes one cross-reference to the mega-map. |
void |
writeXrefs(Collection<XRef> xrefs)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String[] ILLEGAL_COMPOUND
| Constructor Detail |
|---|
public MegaJdbcMapper(Connection con)
throws IOException
IOException| Method Detail |
|---|
public final void openMap()
throws IOException
openMap in interface MegaMapperIOException
public void writeEntry(Entry entry)
throws IOException
MegaMapper
writeEntry in interface MegaMapperIOException
public void writeEntries(Collection<Entry> entries)
throws IOException
writeEntries in interface MegaMapperIOException
public void writeXref(XRef xref)
throws IOException
writeXref in interface MegaMapperIOException
public void writeXrefs(Collection<XRef> xrefs)
throws IOException
writeXrefs in interface MegaMapperIOException
public void write(Collection<Entry> entries,
Collection<XRef> xrefs)
throws IOException
MegaMapper
write in interface MegaMapperIOExceptionpublic void deleteEntry(Entry entry)
entry -
public Entry getEntryForAccession(MmDatabase db,
String accession)
getEntryForAccession in interface MegaMapperEntry, or null if not found.public Collection<XRef> getXrefs(Entry entry)
MegaMapper
getXrefs in interface MegaMapperentry - The entry we want relationships for.
public Collection<XRef> getXrefs(Entry entry,
MmDatabase... dbs)
MegaMapper
getXrefs in interface MegaMapperentry - The entry we want relationships for.dbs - The database(s) to which the entry is related.
public Collection<XRef> getXrefs(Collection<Entry> entries,
MmDatabase... dbs)
MegaMapper
getXrefs in interface MegaMapperentries - The entries we want relationships for.dbs - The database(s) to which the entries are related.
public Collection<XRef> getXrefs(MmDatabase db,
String accession)
MegaMapper
getXrefs in interface MegaMapperdb - the database where the accession is from.accession - the accession number.
public Collection<XRef> getXrefs(MmDatabase db,
String accession,
MmDatabase... xDbs)
MegaMapper
getXrefs in interface MegaMapperdb - the database where the accession is from.accession - the accession number.xDbs - the referencing/referenced database(s).
null if none
found. Note that the accession used in the query may be either the
origin or the target of an xref.
public Collection<XRef> getXrefs(MmDatabase db,
String accession,
Relationship relationship)
MegaMapper
getXrefs in interface MegaMapperdb - the database where the accession is from.accession - the accession number.relationship - the relationship between the given accession and its
cross references.
null if none
found. Note that the accession used in the query may be either the
origin or the target of an xref.
public Collection<XRef> getXrefs(MmDatabase db,
String idFragment,
MegaMapper.Constraint constraint,
Relationship rel)
MegaMapper
getXrefs in interface MegaMapperdb - the Database providing IDs matching idFragment. If
null, all databases will be considered.idFragment - A text which matches entry IDs. Please note that when
searching for UniProt ID prefixes it is advisable to include the
underscore (_) character, so that "DHSA" won't return xrefs for
"DHSA1".constraint - the constraint to use with the given
idFragment.rel - The relationship searched, if any (can be
null).
null if none
found. Note that the entries corresponding to the query may be
either the origin or the target of an xref.
public Collection<XRef> getXrefs(MmDatabase db,
String idFragment,
MegaMapper.Constraint constraint,
MmDatabase... xDbs)
MegaMapper
getXrefs in interface MegaMapperdb - the Database providing IDs matching idFragment. If
null, all databases will be considered.idFragment - A text which matches entry IDs. Please note that when
searching for UniProt ID prefixes it is advisable to include the
underscore (_) character, so that "DHSA" won't return xrefs for
"DHSA1".constraint - the constraint to use with the given
idFragment.xDbs - the databases for which we want cross-references to be
retrieved.
null if none
found. Note that the entries corresponding to the query may be
either the origin or the target of an xref.
public List<XRef> getChMBLXrefs(MmDatabase db,
String accession,
MmDatabase... xDbs)
getChMBLXrefs in interface MegaMapperdb - database where the accession is foundaccession - the accession numberxDbs - chEMBL database
public int getXrefsSize(MmDatabase db,
String accession,
MmDatabase... xDbs)
getXrefsSize in interface MegaMapperdb - the database where the accession is foundaccession - the accession numberxDb - the referencing/referenced database(s).
public void handleError()
throws IOException
MegaMapper
handleError in interface MegaMapperIOException
public void closeMap()
throws IOException
closeMap in interface MegaMapperIOException
public void commit()
throws IOException
MegaMapper
commit in interface MegaMapperIOException
public void rollback()
throws IOException
MegaMapper
rollback in interface MegaMapperIOExceptionpublic List<String> getAllUniProtAccessions(MmDatabase database)
getAllUniProtAccessions in interface MegaMapperdatabase - the database with accessions
public Map<String,String> getDiseaseNew(MmDatabase db,
String accession,
MmDatabase... xDbs)
public Map<String,String> getCompoundsNew(MmDatabase db,
String accession,
MmDatabase... xDbs)
public Map<String,String> getDisease(MmDatabase db,
String accessions,
MmDatabase... xDbs)
getDisease in interface MegaMapper
public Map<String,String> getCompounds(MmDatabase db,
String accessions,
MmDatabase... xDbs)
getCompounds in interface MegaMapper
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||