CV_ | R Documentation |
Define a Singleton class which can hold a CV dictionary (so we do not have to load the .obo files over and over again)
Get the full data by calling the 'getData()' function (which returns a list containing a 'CV', 'URI' and 'version'),
or 'getCV()' which is a shorthand for 'getData()$CV'.
You can set your own custom CV by calling 'setData()'. By default, the latest release of the PSI-MS-CV (see getCVDictionary
).
Wherever you need this data, simply re-grab the singleton using 'CV_$new()' (or use the convenience function getCVSingleton() from outside the package)
R6P::Singleton
-> CV_
ensureHasData()
Make sure that the CV data is loaded
CV_$ensureHasData()
byID()
A function to retrieve a CV entry using its ID
CV_$byID(id)
id
A CV accession, e.g. 'MS:1000560'
setData()
Set a user-defined object (= a list of 'CV', 'URI' and 'version'), as obtained from getCVDictionary
CV_$setData(cv_data)
cv_data
The result of a call to getCVDictionary
getData()
Gets the underlying data (CV, URI and version)
CV_$getData()
getCV()
A shorthand for 'getData()$CV', i.e. the CV data.frame.
CV_$getCV()
clone()
The objects of this class are cloneable with this method.
CV_$clone(deep = FALSE)
deep
Whether to make a deep clone.
## Not run:
cv_dict = CV_$new() ## uses 'getCVDictionary()' to populate the singleton
cv_2 = CV_$new() ## uses the same data without parsing again
cv_2$setData(getCVDictionary("custom", "https://my.com/custom.obo"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.