getPcCand.ExactMass: Retrieve CID Count or CID list by Exact Mass from PubChem

Description Usage Arguments Value Author(s) References Examples

View source: R/ChemicalCuration.R

Description

Retrieves a count of CIDs or CID list from PubChem using entrez/eUtils . Default behaviour is to retrieve CID count only, or a short CID list in ascending order. RMassBank is used to calculate the ppm range. Thanks to Paul Thiessen and Evan Bolton from PubChem team for assistance.

Usage

1
getPcCand.ExactMass(ExactMass, ppm=5, CountOnly=TRUE, RetMax=20, sortAsc=TRUE, timeout=10)

Arguments

ExactMass

Exact mass to search

ppm

Mass error (ppm, not Da) to search. Default 5, adds to both sides of ExactMass.

CountOnly

Default TRUE returns a count of the CIDs, FALSE returns a list of CIDs of length RetMax.

RetMax

Number of CIDs to return. Default 20 is the eUtils default. For large queries this needs to be set much larger; timeout may need adjusting.

sortAsc

Default TRUE returns CID lists sorted in ascending order (lowest CID first), FALSE reverts to the eUtils default of highest CID first.

timeout

The timeout, in seconds.

Value

Either a count of CIDs or a vector of CIDs (NA if error).

Author(s)

Emma Schymanski <emma.schymanski@uni.lu>

References

PubChem search: http://pubchem.ncbi.nlm.nih.gov/

Entrez eUtils: https://www.ncbi.nlm.nih.gov/books/NBK25500/ and https://www.ncbi.nlm.nih.gov/books/NBK25499/

Examples

1
2
3
4
5
6
getPcCand.ExactMass(298.095947)
getPcCand.ExactMass(298.095947,5,CountOnly=F)
getPcCand.ExactMass(298.095947,5,CountOnly=F,sortAsc=F)
getPcCand.ExactMass(298.095947,5,CountOnly=F,sortAsc=T,RetMax=10)
# invalid mass entries will return an error in the mass calc
getPcCand.ExactMass("298.095947")

schymane/RChemMass documentation built on Jan. 25, 2021, 5:45 a.m.