CV_ function

CV_

CV_

Define a Singleton class which can hold a CV dictionary (so we do not have to load the .obo files over and over again)

Details

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)

Examples

## 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)

Super class

R6P::Singleton -> CV_

Methods

Public methods

Method ensureHasData()

Make sure that the CV data is loaded

Usage

CV_$ensureHasData()

Method byID()

A function to retrieve a CV entry using its ID

Usage

CV_$byID(id)

Arguments

  • id: A CV accession, e.g. 'MS:1000560'

Returns

A CV term, or NULL if the ID is unknown

Method setData()

Set a user-defined object (= a list of 'CV', 'URI' and 'version'), as obtained from getCVDictionary

Usage

CV_$setData(cv_data)

Arguments

  • cv_data: The result of a call to getCVDictionary

Method getData()

Gets the underlying data (CV, URI and version)

Usage

CV_$getData()

Method getCV()

A shorthand for 'getData()$CV', i.e. the CV data.frame.

Usage

CV_$getCV()
  • Maintainer: Chris Bielow
  • License: MIT + file LICENSE
  • Last published: 2025-03-23