| BiodbConn | R Documentation |
The mother abstract class of all database connectors.
The mother abstract class of all database connectors.
This is the super class of all connector classes. All methods defined here are thus common to all connector classes. All connector classes inherit from this abstract class.
See section Fields for a list of the constructor's parameters. Concrete classes may have direct web services methods or other specific methods implemented, in which case they will be described inside the documentation of the concrete class. Please refer to the documentation of each concrete class for more information. The database direct web services methods will be named "ws.*".
The constructor has the following arguments:
id: The identifier of the connector.
cache.id: The identifier used in the disk cache.
biodb::BiodbConnBase -> BiodbConn
biodb::BiodbConnBase$getBaseUrl()biodb::BiodbConnBase$getConnClass()biodb::BiodbConnBase$getConnClassName()biodb::BiodbConnBase$getDbClass()biodb::BiodbConnBase$getEntryClass()biodb::BiodbConnBase$getEntryClassName()biodb::BiodbConnBase$getEntryContentType()biodb::BiodbConnBase$getEntryFileExt()biodb::BiodbConnBase$getEntryIdField()biodb::BiodbConnBase$getName()biodb::BiodbConnBase$getPropSlots()biodb::BiodbConnBase$getPropValSlot()biodb::BiodbConnBase$getPropertyValue()biodb::BiodbConnBase$getSchedulerNParam()biodb::BiodbConnBase$getSchedulerTParam()biodb::BiodbConnBase$getToken()biodb::BiodbConnBase$getUrl()biodb::BiodbConnBase$getUrls()biodb::BiodbConnBase$getWsUrl()biodb::BiodbConnBase$getXmlNs()biodb::BiodbConnBase$hasProp()biodb::BiodbConnBase$hasPropSlot()biodb::BiodbConnBase$isSlotProp()biodb::BiodbConnBase$propExists()biodb::BiodbConnBase$setBaseUrl()biodb::BiodbConnBase$setPropValSlot()biodb::BiodbConnBase$setPropertyValue()biodb::BiodbConnBase$setSchedulerNParam()biodb::BiodbConnBase$setSchedulerTParam()biodb::BiodbConnBase$setToken()biodb::BiodbConnBase$setUrl()biodb::BiodbConnBase$setWsUrl()biodb::BiodbConnBase$updatePropertiesDefinition()new()New instance initializer. Connector objects must not be created directly. Instead, you create new connector instances through the BiodbFactory instance.
BiodbConn$new(id = NA_character_, cache.id = NA_character_, bdb, ...)
idThe ID of the connector instance.
cache.idThe Cache ID of the connector instance.
bdbThe BiodbMain instance.
...Remaining arguments will be passed to the constructor of the super class.
Nothing.
getBiodb()Returns the biodb main class instance to which this object is attached.
BiodbConn$getBiodb()
The main biodb instance.
getId()Get the identifier of this connector.
BiodbConn$getId()
The identifier of this connector.
print()Prints a description of this connector.
BiodbConn$print()
Nothing.
correctIds()Correct a vector of IDs by formatting them to the database official format, if required and possible.
BiodbConn$correctIds(ids)
idsA character vector of IDs.
The vector of IDs corrected.
getEntry()Return the entry corresponding to this ID. You can pass a vector of IDs, and you will get a list of entries.
BiodbConn$getEntry(id, drop = TRUE, nulls = TRUE)
idA character vector containing entry identifiers.
dropIf set to TRUE and only one entry is requrested, then the returned value will be a single BiodbEntry object, otherwise it will be a list of BiodbEntry objects.
nullsIf set to TRUE, NULL entries are preserved. This ensures
that the output list has the same length than the input vector id.
Otherwise they are removed from the final list.
A list of BiodbEntry objects, the same size of the vector of IDs. The list will contain NULL values for invalid IDs. If drop is set to TRUE and only one etrny was requested then a single BiodbEntry is returned instead of a list.
getCacheFile()Get the path to the persistent cache file.
BiodbConn$getCacheFile(entry.id)
entry.idThe identifiers (e.g.: accession numbers) as a character vector of the database entries.
A character vector, the same length as the vector of IDs, containing the paths to the cache files corresponding to the requested entry IDs.
getEntryContent()Get the contents of database entries from IDs (accession numbers).
BiodbConn$getEntryContent(id)
idA character vector of entry IDs.
A character vector containing the contents of the requested IDs. If no content is available for an entry ID, then NA will be used.
getEntryContentFromDb()Get the contents of entries directly from the database. A direct request or an access to the database will be made in order to retrieve the contents. No access to the biodb cache system will be made.
BiodbConn$getEntryContentFromDb(entry.id)
entry.idA character vector with the IDs of entries to retrieve.
A character vector, the same size of entry.id, with contents of the requested entries. An NA value will be set for the content of each entry for which the retrieval failed.
getEntryContentRequest()Gets the URL to use in order to get the contents of the specified entries.
BiodbConn$getEntryContentRequest(entry.id, concatenate = TRUE, max.length = 0)
entry.idA character vector with the IDs of entries to retrieve.
concatenateIf set to TRUE, then try to build as few URLs as possible, sending requests with several identifiers at once.
max.lengthThe maximum length of the URLs to return, in number of characters.
A vector of URL strings.
getEntryIds()Get entry identifiers from the database. More arguments can be given, depending on implementation in specific databases. For mass databases the ms.level argument can also be set.
BiodbConn$getEntryIds(max.results = 0, ...)
max.resultsThe maximum of elements to return from the method.
...Arguments specific to connectors.
A character vector containing entry IDs from the database. An empty vector for a remote database may mean that the database does not support requesting for entry accessions.
getNbEntries()Get the number of entries contained in this database.
BiodbConn$getNbEntries(count = FALSE)
countIf set to TRUE and no straightforward way exists to get number of entries, count the output of getEntryIds().
The number of entries in the database, as an integer.
isEditable()Tests if this connector is able to edit the database (i.e.: the connector class implements the interface BiodbEditable). If this connector is editable, then you can call allowEditing() to enable editing.
BiodbConn$isEditable()
Returns TRUE if the database is editable.
editingIsAllowed()Tests if editing is allowed.
BiodbConn$editingIsAllowed()
TRUE if editing is allowed for this database, FALSE otherwise.
allowEditing()Allows editing for this database.
BiodbConn$allowEditing()
Nothing.
disallowEditing()Disallows editing for this database.
BiodbConn$disallowEditing()
Nothing.
setEditingAllowed()Allow or disallow editing for this database.
BiodbConn$setEditingAllowed(allow)
allowA logical value.
Nothing.
addNewEntry()Adds a new entry to the database. The passed entry must have been previously created from scratch using BiodbFactory :createNewEntry() or cloned from an existing entry using BiodbEntry :clone().
BiodbConn$addNewEntry(entry)
entryThe new entry to add. It must be a valid BiodbEntry object.
Nothing.
isWritable()Tests if this connector is able to write into the database. If this connector is writable, then you can call allowWriting() to enable writing.
BiodbConn$isWritable()
Returns TRUE if the database is writable.
allowWriting()Allows the connector to write into this database.
BiodbConn$allowWriting()
Nothing.
disallowWriting()Disallows the connector to write into this database.
BiodbConn$disallowWriting()
Nothing.
setWritingAllowed()Allows or disallows writing for this database.
BiodbConn$setWritingAllowed(allow)
allowIf set to TRUE, allows writing.
Nothing.
writingIsAllowed()Tests if the connector has access right to the database.
BiodbConn$writingIsAllowed()
TRUE if writing is allowed for this database, FALSE otherwise.
write()Writes into the database. All modifications made to the database since the last time write() was called will be saved.
BiodbConn$write()
Nothing.
isSearchableByField()Tests if a field can be used to search entries when using method searchForEntries().
BiodbConn$isSearchableByField(field = NULL, field.type = NULL)
fieldThe name of the field.
field.typeThe field type.
Returns TRUE if the database is searchable using the specified field or searchable by any field of the specified type, FALSE otherwise.
getSearchableFields()Get the list of all searchable fields.
BiodbConn$getSearchableFields()
A character vector containing all searchable fields for this connector.
searchForEntries()Searches the database for entries whose name matches the specified name. Returns a character vector of entry IDs.
BiodbConn$searchForEntries(fields = NULL, max.results = 0)
fieldsA list of fields on which to filter entries. To get a match,
all fields must be matched (i.e. logical AND). The keys of the list are the
entry field names on which to filter, and the values are the filtering
parameters. For character fields, the filter parameter is a character vector
in which all strings must be found inside the field's value. For numeric
fields, the filter parameter is either a list specifying a min-max range
(list(min=1.0, max=2.5)) or a value with a tolerance in delta
(list(value=2.0, delta=0.1)) or ppm (list(value=2.0, ppm=1.0)).
max.resultsIf set, the number of returned IDs is limited to this number.
A character vector of entry IDs whose name matches the requested name.
searchByName()DEPRECATED. Use searchForEntries() instead.
BiodbConn$searchByName(name, max.results = 0)
nameA character value to search inside name fields.
max.resultsIf set, the number of returned IDs is limited to this number.
A character vector of entry IDs whose name matches the requested name.
isDownloadable()Tests if the connector can download the database.
BiodbConn$isDownloadable()
Returns TRUE if the database is downloadable.
isDownloaded()Tests if the database has been downloaded.
BiodbConn$isDownloaded()
TRUE if the database content has already been downloaded.
requiresDownload()Tests if the connector requires the download of the database.
BiodbConn$requiresDownload()
TRUE if the connector requires download of the database.
getDownloadPath()Gets the path where the downloaded content is written.
BiodbConn$getDownloadPath()
The path where the downloaded database is written.
setDownloadedFile()Set the downloaded file into the cache.
BiodbConn$setDownloadedFile(src, action = c("copy", "move"))srcPath to the downloaded file.
actionSpecifies if files have to be moved or copied into the cache.
Nothing.
isExtracted()Tests if the downloaded database has been extracted (in case the database needs extraction).
BiodbConn$isExtracted()
TRUE if the downloaded database content has been extracted, FALSE otherwise.
download()Downloads the database content locally.
BiodbConn$download()
Nothing.
isRemotedb()Tests if the connector is connected to a remote database.
BiodbConn$isRemotedb()
Returns TRUE if the database is a remote database."
isCompounddb()Tests if the connector's database is a compound database.
BiodbConn$isCompounddb()
Returns TRUE if the database is a compound database.
searchCompound()This method is deprecated. Use searchForEntries() instead. Searches for compounds by name and/or by mass. At least one of name or mass must be set.
BiodbConn$searchCompound( name = NULL, mass = NULL, mass.field = NULL, mass.tol = 0.01, mass.tol.unit = "plain", max.results = 0 )
nameThe name of a compound to search for.
massThe searched mass.
mass.fieldFor searching by mass, you must indicate a mass field to use ('monoisotopic.mass', 'molecular.mass', 'average.mass' or 'nominal.mass').
mass.tolThe tolerance value on the molecular mass.
mass.tol.unitThe type of mass tolerance. Either 'plain' or 'ppm'.
max.resultsThe maximum number of matches to return.
descriptionA character vector of words or expressions to search for inside description field. The words will be searched in order. A match will be made only if all words are inside the description field.
A character vector of entry IDs."
annotateMzValues()Annotates a mass spectrum with the database. For each matching entry the entry field values will be set inside columns appended to the data frame. Names of these columns will use a common prefix in order to distinguish them from other data from the input data frame.
BiodbConn$annotateMzValues(
x,
mz.tol,
ms.mode,
mz.tol.unit = c("plain", "ppm"),
mass.field = "monoisotopic.mass",
max.results = 3,
mz.col = "mz",
fields = NULL,
prefix = NULL,
insert.input.values = TRUE,
fieldsLimit = 0
)xEither a data frame or a numeric vector containing the M/Z values.
mz.tolThe tolerance on the M/Z values.
ms.modeThe MS mode. Set it to either 'neg' or 'pos'.
mz.tol.unitThe type of the M/Z tolerance. Set it to either to 'ppm' or 'plain'.
mass.fieldThe mass field to use for matching M/Z values. One of: 'monoisotopic.mass', 'molecular.mass', 'average.mass', 'nominal.mass'.
max.resultsIf set, it is used to limit the number of matches found for each M/Z value. To get all the matches, set this parameter to NA_integer_. Default value is 3.
mz.colThe name of the column where to find M/Z values in case x is a data frame.
fieldsA character vector containing the additional entry fields you would like to get for each matched entry. Each field will be output in a different column.
prefixA prefix that will be inserted before the name of each added column in the output. By default it will be set to the name of the database followed by a dot.
insert.input.valuesInsert input values at the beginning of the result data frame.
fieldsLimitThe maximum of values to output for fields with multiple values. Set it to 0 to get all values.
A data frame containing the input values, and annotation columns
appended at the end. The first annotation column contains the IDs of the
matched entries. The following columns contain the fields you have requested
through the fields parameter.
isMassdb()Tests if the connector's database is a mass spectra database.
BiodbConn$isMassdb()
Returns TRUE if the database is a mass database.
checkDb()Checks that the database is correct by trying to retrieve all its entries.
BiodbConn$checkDb()
Nothing.
getAllVolatileCacheEntries()Get all entries stored in the memory cache (volatile cache).
BiodbConn$getAllVolatileCacheEntries()
A list of BiodbEntry instances.
getAllCacheEntries()This method is deprecated. Use getAllVolatileCacheEntries() instead.
BiodbConn$getAllCacheEntries()
All entries cached in memory.
deleteAllEntriesFromVolatileCache()Delete all entries from the volatile cache (memory cache).
BiodbConn$deleteAllEntriesFromVolatileCache()
Nothing.
deleteAllEntriesFromPersistentCache()Delete all entries from the persistent cache (disk cache).
BiodbConn$deleteAllEntriesFromPersistentCache(deleteVolatile = TRUE)
deleteVolatileIf TRUE deletes also all entries from the volatile cache (memory cache).
Nothing.
deleteWholePersistentCache()Delete all files associated with this connector from the persistent cache (disk cache).
BiodbConn$deleteWholePersistentCache(deleteVolatile = TRUE)
deleteVolatileIf TRUE deletes also all entries from the volatile cache (memory cache).
Nothing.
deleteAllCacheEntries()Delete all entries from the memory cache. This method is deprecated, please use deleteAllEntriesFromVolatileCache() instead.
BiodbConn$deleteAllCacheEntries()
Nothing.
getCacheId()Gets the ID used by this connector in the disk cache.
BiodbConn$getCacheId()
The cache ID of this connector.
makesRefToEntry()Tests if some entry of this database makes reference to another entry of another database.
BiodbConn$makesRefToEntry(id, db, oid, any = FALSE, recurse = FALSE)
idA character vector of entry IDs from the connector's database.
dbAnother database connector.
oidA entry ID from database db.
anyIf set to TRUE, returns a single logical value: TRUE if any entry contains a reference to oid, FALSE otherwise.
recurseIf set to TRUE, the algorithm will follow all references to
entries from other databases, to see if it can establish an indirect link to
oid.
A logical vector, the same size as id, with TRUE for each entry
making reference to oid, and FALSE otherwise.
makeRequest()Makes a BiodbRequest instance using the passed parameters, and set ifself as the associated connector.
BiodbConn$makeRequest(...)
...Those parameters are passed to the initializer of BiodbRequest.
The BiodbRequest instance.
getEntryImageUrl()Gets the URL to a picture of the entry (e.g.: a picture of the molecule in case of a compound entry).
BiodbConn$getEntryImageUrl(entry.id)
entry.idA character vector containing entry IDs.
A character vector, the same length as entry.id,
containing for each entry ID either a URL or NA if no URL exists.
getEntryPageUrl()Gets the URL to the page of the entry on the database web site.
BiodbConn$getEntryPageUrl(entry.id)
entry.idA character vector with the IDs of entries to retrieve.
A list of BiodbUrl objects, the same length as entry.id.
getChromCol()Gets a list of chromatographic columns contained in this database.
BiodbConn$getChromCol(ids = NULL)
idsA character vector of entry identifiers (i.e.: accession numbers). Used to restrict the set of entries on which to run the algorithm.
A data.frame with two columns, one for the ID 'id' and another one for the title 'title'.
getMatchingMzField()Gets the field to use for M/Z matching.
BiodbConn$getMatchingMzField()
The name of the field (one of peak.mztheo or peak.mzexp).
setMatchingMzField()Sets the field to use for M/Z matching.
BiodbConn$setMatchingMzField(field = c("peak.mztheo", "peak.mzexp"))fieldThe field to use for matching.
Nothing.
getMzValues()Gets a list of M/Z values contained inside the database.
BiodbConn$getMzValues( ms.mode = NULL, max.results = 0, precursor = FALSE, ms.level = 0 )
ms.modeThe MS mode. Set it to either 'neg' or 'pos' to limit the output to one mode.
max.resultsIf set, it is used to limit the size of the output.
precursorIf set to TRUE, then restrict the search to precursor peaks.
ms.levelThe MS level to which you want to restrict your search. 0 means that you want to search in all levels.
A numeric vector containing M/Z values.
getNbPeaks()Gets the number of peaks contained in the database.
BiodbConn$getNbPeaks(mode = NULL, ids = NULL)
modeThe MS mode. Set it to either 'neg' or 'pos' to limit the counting to one mode.
idsA character vector of entry identifiers (i.e.: accession numbers). Used to restrict the set of entries on which to run the algorithm.
The number of peaks, as an integer.
filterEntriesOnRt()Filters a list of entries on retention time values.
BiodbConn$filterEntriesOnRt( entry.ids, rt, rt.unit, rt.tol, rt.tol.exp, chrom.col.ids, match.rt )
entry.idsA character vector of entry IDs.
rtA vector of retention times to match. Used if input.df is not set. Unit is specified by rt.unit parameter.
rt.unitThe unit for submitted retention times. Either 's' or 'min'.
rt.tolThe plain tolerance (in seconds) for retention times: input.rt
rt.tol <= database.rt <= input.rt + rt.tol.
rt.tol.expA special exponent tolerance for retention times: input.rt
input.rt ** rt.tol.exp <= database.rt <= input.rt + input.rt ** rt.tol.exp. This exponent is applied on the RT value in seconds. If both rt.tol and rt.tol.exp are set, the inequality expression becomes input.rt - rt.tol - input.rt ** rt.tol.exp <= database.rt <= input.rt + rt.tol + input.rt ** rt.tol.exp.
chrom.col.idsIDs of chromatographic columns on which to match the retention time.
match.rtIf set to TRUE, filters on RT values, otherwise does not do any filtering.
A character vector containing entry IDs after filtering.
searchForMassSpectra()Searches for entries (i.e.: spectra) that contain a peak around the given M/Z value. Entries can also be filtered on RT values. You can input either a list of M/Z values through mz argument and set a tolerance with mz.tol argument, or two lists of minimum and maximum M/Z values through mz.min and mz.max arguments.
BiodbConn$searchForMassSpectra(
mz.min = NULL,
mz.max = NULL,
mz = NULL,
mz.tol = NULL,
mz.tol.unit = c("plain", "ppm"),
rt = NULL,
rt.unit = c("s", "min"),
rt.tol = NULL,
rt.tol.exp = NULL,
chrom.col.ids = NULL,
precursor = FALSE,
min.rel.int = 0,
ms.mode = NULL,
max.results = 0,
ms.level = 0,
include.ids = NULL
)mz.minA vector of minimum M/Z values.
mz.maxA vector of maximum M/Z values. Its length must be the same as
mz.min.
mzA vector of M/Z values.
mz.tolThe M/Z tolerance, whose unit is defined by mz.tol.unit.
mz.tol.unitThe type of the M/Z tolerance. Set it to either to 'ppm' or 'plain'.
rtA vector of retention times to match. Used if input.df is not set. Unit is specified by rt.unit parameter.
rt.unitThe unit for submitted retention times. Either 's' or 'min'.
rt.tolThe plain tolerance (in seconds) for retention times: input.rt
rt.tol <= database.rt <= input.rt + rt.tol.
rt.tol.expA special exponent tolerance for retention times: input.rt
input.rt ** rt.tol.exp <= database.rt <= input.rt + input.rt ** rt.tol.exp. This exponent is applied on the RT value in seconds. If both rt.tol and rt.tol.exp are set, the inequality expression becomes input.rt - rt.tol - input.rt ** rt.tol.exp <= database.rt <= input.rt + rt.tol + input.rt ** rt.tol.exp.
chrom.col.idsIDs of chromatographic columns on which to match the retention time.
precursorIf set to TRUE, then restrict the search to precursor peaks.
min.rel.intThe minimum relative intensity, in percentage (i.e.: float number between 0 and 100).
ms.modeThe MS mode. Set it to either 'neg' or 'pos'.
max.resultsIf set, it is used to limit the number of matches found for each M/Z value.
ms.levelThe MS level to which you want to restrict your search. 0 means that you want to search in all levels.
include.idsA list of IDs to which to restrict the final results. All IDs that are not in this list will be excluded.
A character vector of spectra IDs.
searchMsEntries()DEPRECATED. Use searchForMassSpectra() instead.
BiodbConn$searchMsEntries(
mz.min = NULL,
mz.max = NULL,
mz = NULL,
mz.tol = NULL,
mz.tol.unit = c("plain", "ppm"),
rt = NULL,
rt.unit = c("s", "min"),
rt.tol = NULL,
rt.tol.exp = NULL,
chrom.col.ids = NULL,
precursor = FALSE,
min.rel.int = 0,
ms.mode = NULL,
max.results = 0,
ms.level = 0
)mz.minA vector of minimum M/Z values.
mz.maxA vector of maximum M/Z values. Its length must be the same as
mz.min.
mzA vector of M/Z values.
mz.tolThe M/Z tolerance, whose unit is defined by mz.tol.unit.
mz.tol.unitThe type of the M/Z tolerance. Set it to either to 'ppm' or 'plain'.
rtA vector of retention times to match. Used if input.df is not set. Unit is specified by rt.unit parameter.
rt.unitThe unit for submitted retention times. Either 's' or 'min'.
rt.tolThe plain tolerance (in seconds) for retention times: input.rt
rt.tol <= database.rt <= input.rt + rt.tol.
rt.tol.expA special exponent tolerance for retention times: input.rt
input.rt ** rt.tol.exp <= database.rt <= input.rt + input.rt ** rt.tol.exp. This exponent is applied on the RT value in seconds. If both rt.tol and rt.tol.exp are set, the inequality expression becomes input.rt - rt.tol - input.rt ** rt.tol.exp <= database.rt <= input.rt + rt.tol + input.rt ** rt.tol.exp.
chrom.col.idsIDs of chromatographic columns on which to match the retention time.
precursorIf set to TRUE, then restrict the search to precursor peaks.
min.rel.intThe minimum relative intensity, in percentage (i.e.: float number between 0 and 100).
ms.modeThe MS mode. Set it to either 'neg' or 'pos'.
max.resultsIf set, it is used to limit the number of matches found for each M/Z value.
ms.levelThe MS level to which you want to restrict your search. 0 means that you want to search in all levels.
A character vector of spectra IDs.
searchMsPeaks()For each M/Z value, searches for matching MS spectra and returns the matching peaks.
BiodbConn$searchMsPeaks(
input.df = NULL,
mz = NULL,
mz.tol = NULL,
mz.tol.unit = c("plain", "ppm"),
min.rel.int = 0,
ms.mode = NULL,
ms.level = 0,
max.results = 0,
chrom.col.ids = NULL,
rt = NULL,
rt.unit = c("s", "min"),
rt.tol = NULL,
rt.tol.exp = NULL,
precursor = FALSE,
precursor.rt.tol = NULL,
insert.input.values = TRUE,
prefix = NULL,
compute = TRUE,
fields = NULL,
fieldsLimit = 0,
input.df.colnames = c(mz = "mz", rt = "rt"),
match.rt = FALSE
)input.dfA data frame taken as input for searchMsPeaks(). It must contain a columns 'mz', and optionaly an 'rt' column.
mzA vector of M/Z values to match. Used if input.df is not set.
mz.tolThe M/Z tolerance, whose unit is defined by mz.tol.unit.
mz.tol.unitThe type of the M/Z tolerance. Set it to either to 'ppm' or 'plain'.
min.rel.intThe minimum relative intensity, in percentage (i.e.: float number between 0 and 100).
ms.modeThe MS mode. Set it to either 'neg' or 'pos'.
ms.levelThe MS level to which you want to restrict your search. 0 means that you want to search in all levels.
max.resultsIf set, it is used to limit the number of matches found for each M/Z value.
chrom.col.idsIDs of chromatographic columns on which to match the retention time.
rtA vector of retention times to match. Used if input.df is not set. Unit is specified by rt.unit parameter.
rt.unitThe unit for submitted retention times. Either 's' or 'min'.
rt.tolThe plain tolerance (in seconds) for retention times: input.rt
rt.tol <= database.rt <= input.rt + rt.tol.
rt.tol.expA special exponent tolerance for retention times: input.rt
input.rt ** rt.tol.exp <= database.rt <= input.rt + input.rt ** rt.tol.exp. This exponent is applied on the RT value in seconds. If both rt.tol and rt.tol.exp are set, the inequality expression becomes input.rt - rt.tol - input.rt ** rt.tol.exp <= database.rt <= input.rt + rt.tol + input.rt ** rt.tol.exp.
precursorIf set to TRUE, then restrict the search to precursor peaks.
precursor.rt.tolThe RT tolerance used when matching the precursor.
insert.input.valuesInsert input values at the beginning of the result data frame.
prefixAdd prefix on column names of result data frame.
computeIf set to TRUE, use the computed values when converting found entries to data frame.
fieldsA character vector of field names to output. The data frame output will be restricted to this list of fields.
fieldsLimitThe maximum of values to output for fields with multiple values. Set it to 0 to get all values.
input.df.colnamesNames of the columns in the input data frame.
match.rtIf set to TRUE, match also RT values.
A data frame with at least input MZ and RT columns, and annotation
columns prefixed with prefix if set. For each matching found a row is
output. Thus if n matchings are found for M/Z value x, then there will be n
rows for x, each for a different match. The number of matching found for
each M/Z value is limited to max.results.
msmsSearch()Searches MSMS spectra matching a template spectrum. The mz.tol parameter is applied on the precursor search.
BiodbConn$msmsSearch(
spectrum,
precursor.mz,
mz.tol,
mz.tol.unit = c("plain", "ppm"),
ms.mode,
npmin = 2,
dist.fun = c("wcosine", "cosine", "pkernel", "pbachtttarya"),
msms.mz.tol = 3,
msms.mz.tol.min = 0.005,
max.results = 0
)spectrumA template spectrum to match inside the database.
precursor.mzThe M/Z value of the precursor peak of the mass spectrum.
mz.tolThe M/Z tolerance, whose unit is defined by mz.tol.unit.
mz.tol.unitThe type of the M/Z tolerance. Set it to either to 'ppm' or 'plain'.
ms.modeThe MS mode. Set it to either 'neg' or 'pos'.
npminThe minimum number of peak to detect a match (2 is recommended).
dist.funThe distance function used to compute the distance betweem two mass spectra.
msms.mz.tolM/Z tolerance to apply while matching MSMS spectra. In PPM.
msms.mz.tol.minMinimum of the M/Z tolerance (plain unit). If
the M/Z tolerance computed with msms.mz.tol is lower than
msms.mz.tol.min, then msms.mz.tol.min will be used.
max.resultsIf set, it is used to limit the number of matches found for each M/Z value.
A data frame with columns id, score and peak.*. Each
peak.* column corresponds to a peak in the input spectrum, in the
same order and gives the number of the peak that was matched with it
inside the matched spectrum whose ID is inside the id column.
collapseResultsDataFrame()Collapse rows of a results data frame, by outputing a data frame with only one row for each MZ/RT value.
BiodbConn$collapseResultsDataFrame( results.df, mz.col = "mz", rt.col = "rt", sep = "|" )
results.dfResults data frame.
mz.colThe name of the M/Z column in the results data frame.
rt.colThe name of the RT column in the results data frame.
sepThe separator used to concatenate values, when collapsing results data frame.
A data frame with rows collapsed."
searchMzRange()Find spectra in the given M/Z range. Returns a list of spectra IDs.
BiodbConn$searchMzRange( mz.min, mz.max, min.rel.int = 0, ms.mode = NULL, max.results = 0, precursor = FALSE, ms.level = 0 )
mz.minA vector of minimum M/Z values.
mz.maxA vector of maximum M/Z values. Its length must be the
same as mz.min.
min.rel.intThe minimum relative intensity, in percentage (i.e.: float number between 0 and 100).
ms.modeThe MS mode. Set it to either 'neg' or 'pos'.
max.resultsIf set, it is used to limit the number of matches found for each M/Z value.
precursorIf set to TRUE, then restrict the search to precursor peaks.
ms.levelThe MS level to which you want to restrict your search. 0 means that you want to search in all levels.
A character vector of spectra IDs.
searchMzTol()Find spectra containg a peak around the given M/Z value. Returns a character vector of spectra IDs.
BiodbConn$searchMzTol( mz, mz.tol, mz.tol.unit = "plain", min.rel.int = 0, ms.mode = NULL, max.results = 0, precursor = FALSE, ms.level = 0 )
mzA vector of M/Z values.
mz.tolThe M/Z tolerance, whose unit is defined by mz.tol.unit.
mz.tol.unitThe type of the M/Z tolerance. Set it to either to 'ppm' or 'plain'.
min.rel.intThe minimum relative intensity, in percentage (i.e.: float number between 0 and 100).
ms.modeThe MS mode. Set it to either 'neg' or 'pos'.
max.resultsIf set, it is used to limit the number of matches found for each M/Z value.
precursorIf set to TRUE, then restrict the search to precursor peaks.
ms.levelThe MS level to which you want to restrict your search. 0 means that you want to search in all levels.
A character vector of spectra IDs.
clone()The objects of this class are cloneable with this method.
BiodbConn$clone(deep = FALSE)
deepWhether to make a deep clone.
Super class BiodbConnBase, and
BiodbFactory class.
# Create an instance with default settings:
mybiodb <- biodb::newInst()
# Get a compound CSV file database
chebi.tsv <- system.file("extdata", "chebi_extract.tsv", package='biodb')
# Create a connector
conn <- mybiodb$getFactory()$createConn('comp.csv.file', url=chebi.tsv)
# Get 10 identifiers from the database:
ids <- conn$getEntryIds(10)
# Get number of entries contained in the database:
n <- conn$getNbEntries()
# Terminate instance.
mybiodb$terminate()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.