Title: | biodbChebi, a library for connecting to the ChEBI Database |
---|---|
Description: | The biodbChebi library provides access to the ChEBI Database, using biodb package framework. It allows to retrieve entries by their accession number. Web services can be accessed for searching the database by name, mass or other fields. |
Authors: | Pierrick Roger [aut, cre] |
Maintainer: | Pierrick Roger <[email protected]> |
License: | AGPL-3 |
Version: | 1.13.0 |
Built: | 2024-10-30 04:22:59 UTC |
Source: | https://github.com/bioc/biodbChebi |
ChEBI connector class.
ChEBI connector class.
This is the connector class for connecting to the ChEBI database through its web services.
biodb::BiodbConnBase
-> biodb::BiodbConn
-> ChebiConn
new()
New instance initializer. Connector classes must not be instantiated directly. Instead, you must use the createConn() method of the factory class.
ChebiConn$new(...)
...
All parameters are passed to the super class initializer.
Nothing.
wsWsdl()
Retrieves the complete WSDL from the web server.
ChebiConn$wsWsdl(retfmt = c("plain", "parsed", "request"))
retfmt
The return format to use. 'plain' will return the value as it is returned by the server. 'parsed' will return an XML object. 'request' will return a BiodbRequest object representing the request that would have been sent.
Depending on 'retfmt' value.
wsGetLiteEntity()
Calls getLiteEntity web service and returns the XML result. Be careful when searching by mass (search.category='MASS' or 'MONOISOTOPIC MASS'), since the search is made in text mode, thus the number must be exactly written as it is stored in database, eventually padded with 0 in order to have exactly 5 digits after the decimal. An easy solution is to use wildcards to search a mass '410;.718*'. See http //www.ebi.ac.uk/chebi/webServices.do for more details.
ChebiConn$wsGetLiteEntity( search = NULL, search.category = "ALL", stars = "ALL", max.results = 10, retfmt = c("plain", "parsed", "request", "ids") )
search
The text or pattern to search.
search.category
The search category. Call 'getSearchCategories()' to get a full list of search categories.
stars
How many starts the returned entities should have. Call 'getStarsCategories() to get a full list of starts categories.'
max.results
The maximum of results to return.
retfmt
The return format to use. 'plain' will return the results as given by the server, in a string. 'parsed' will return an XML object. 'request' will return a BiodbRequest object representing the request as would have been sent. 'ids' will return a list of matched entity IDs.
Depending on 'retfmt' value.
convIdsToChebiIds()
Converts a list of IDs (InChI, InChI Keys, CAS, ...) into a list of ChEBI IDs. Several ChEBI IDs may be returned for a single ID.
ChebiConn$convIdsToChebiIds(ids, search.category, simplify = TRUE)
ids
The identifiers to convert.
search.category
The search category. Call 'getSearchCategories()' to get a full list of search categories.
simplify
If set to TRUE and only one ChEBI ID has been found for each ID, then a character vector is returned. Otherwise a list of character vectors is returned.
Depending on the value of simplify.
convInchiToChebi()
Converts a list of InChI or InChI KEYs into a list of ChEBI IDs. Several ChEBI IDs may be returned for a single InChI or InChI KEY.
ChebiConn$convInchiToChebi(inchi, simplify = TRUE)
inchi
The InChI values to convert.
simplify
If set to TRUE and only one ChEBI ID has been found for each ID, then a character vector is returned. Otherwise a list of character vectors is returned.
Depending on the value of simplify.
convCasToChebi()
Converts a list of CAS IDs into a list of ChEBI IDs. Several ChEBI IDs may be returned for a single InChI or InChI KEY.
ChebiConn$convCasToChebi(cas, simplify = TRUE)
cas
The CAS IDs to convert.
simplify
If set to TRUE and only one ChEBI ID has been found for each ID, then a character vector is returned. Otherwise a list of character vectors is returned.
Depending on the value of simplify.
getWsdl()
Gets the WSDL as an XML object.
ChebiConn$getWsdl()
The ChEBI WSDL as an XML object.
getWsdlEnumeration()
Extracts a list of values from an enumeration in the WSDL.
ChebiConn$getWsdlEnumeration(name)
name
The name of the enumeration for which to retrieve the values.
A character vector listing the enumerated values.
getStarsCategories()
Gets the list of allowed stars categories for the getLiteEntity web service.
ChebiConn$getStarsCategories()
Returns all the possible stars categories as a character vector.
getSearchCategories()
Gets the list of allowed search categories for the getLiteEntity web service.
ChebiConn$getSearchCategories()
Returns all the possible search categories as a character vector.
clone()
The objects of this class are cloneable with this method.
ChebiConn$clone(deep = FALSE)
deep
Whether to make a deep clone.
# Create an instance with default settings: mybiodb <- biodb::newInst() # Create a connector conn <- mybiodb$getFactory()$createConn('chebi') # Get an entry e <- conn$getEntry('15440') # Convert an InChI KEY to a ChEBI identifier conn$convInchiToChebi('YYGNTYWPHWGJRM-AAJYLUCBSA-N') # Terminate instance. mybiodb$terminate()
# Create an instance with default settings: mybiodb <- biodb::newInst() # Create a connector conn <- mybiodb$getFactory()$createConn('chebi') # Get an entry e <- conn$getEntry('15440') # Convert an InChI KEY to a ChEBI identifier conn$convInchiToChebi('YYGNTYWPHWGJRM-AAJYLUCBSA-N') # Terminate instance. mybiodb$terminate()
This is the entry class for ChEBI database.
biodb::BiodbEntry
-> biodb::BiodbXmlEntry
-> ChebiEntry
clone()
The objects of this class are cloneable with this method.
ChebiEntry$clone(deep = FALSE)
deep
Whether to make a deep clone.
# Create an instance with default settings: mybiodb <- biodb::newInst() # Create a connector to ChEBI conn <- mybiodb$getFactory()$createConn('chebi') # Get an entry e <- conn$getEntry('15440') # Terminate instance. mybiodb$terminate()
# Create an instance with default settings: mybiodb <- biodb::newInst() # Create a connector to ChEBI conn <- mybiodb$getFactory()$createConn('chebi') # Get an entry e <- conn$getEntry('15440') # Terminate instance. mybiodb$terminate()