NciCactusConn: biodbNci, a library for connecting to the National Cancer...

NciCactusConnR Documentation

biodbNci, a library for connecting to the National Cancer Institute (USA) CACTUS Database. connector class.

Description

biodbNci, a library for connecting to the National Cancer Institute (USA) CACTUS Database. connector class.

biodbNci, a library for connecting to the National Cancer Institute (USA) CACTUS Database. connector class.

Details

Connector class for biodbNci, a library for connecting to the National Cancer Institute (USA) CACTUS Database.

This class implements a connector for accessing the NCI database, using CACTUS services. See https://www.cancer.gov/ and https://cactus.nci.nih.gov/.

Super classes

biodb::BiodbConnBase -> biodb::BiodbConn -> NciCactusConn

Methods

Public methods

Inherited methods

Method new()

New instance initializer. Connector classes must not be instantiated directly. Instead, you must use the createConn() method of the factory class.

Usage
NciCactusConn$new(...)
Arguments
...

All parameters are passed to the super class initializer.

Returns

Nothing.


Method wsChemicalIdentifierResolver()

Calls Chemical Identifier Resolver web service. See https://cactus.nci.nih.gov/chemical/structure_documentation for details.

Usage
NciCactusConn$wsChemicalIdentifierResolver(
  structid,
  repr,
  xml = FALSE,
  retfmt = c("plain", "parsed", "ids", "request")
)
Arguments
structid

The submitted structure identifier.

repr

The wanted representation.

xml

A flag for choosing the format returned by the web service between plain text and XML.

retfmt

Use to set the format of the returned value. 'plain' will return the raw results from the server, as a character value. 'parsed' will return the parsed results, as an XML object. 'request' will return a BiodbRequest object representing the request as it would have been sent. 'ids' will return a character vector containing the IDs of the matching entries.

Returns

Depending on retfmt parameter.


Method conv()

Calls wsChemicalIdentifierResolver() to convert a list of IDs into another representation.

Usage
NciCactusConn$conv(ids, repr)
Arguments
ids

A character vector containing IDs.

repr

The targeted representation.

Returns

A character vector, the same length as ids, containing the converted IDs. NA values will be set when conversion is not possible.


Method convCasToInchi()

Converts a list of CAS IDs into a list of InChI.

Usage
NciCactusConn$convCasToInchi(cas)
Arguments
cas

A character vector containing CAS IDs.

Returns

A character vector, the same length as ids, containing InChI values or NA values where conversion was not possible.


Method convCasToInchikey()

Converts a list of CAS IDs into a list of InChI keys.

Usage
NciCactusConn$convCasToInchikey(cas)
Arguments
cas

A character vector containing CAS IDs.

Returns

A character vector, the same length as ids, containing InChI Key values or NA values where conversion was not possible.


Method clone()

The objects of this class are cloneable with this method.

Usage
NciCactusConn$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

BiodbConn.

Examples

# Create an instance with default settings:
mybiodb <- biodb::newInst()

# Get a connector:
conn <- mybiodb$getFactory()$createConn('nci.cactus')

# Use a database extract in order to avoid the downloading of the whole
# database.
dbExtract <- system.file("extdata", 'generated', "cactus_extract.txt.gz",
    package="biodbNci")
conn$setPropValSlot('urls', 'db.gz.url', dbExtract)

# Get an entry
e <- conn$getEntry('749674')

# Terminate instance.
mybiodb$terminate()


pkrog/biodbNci documentation built on March 27, 2022, 4:30 p.m.