chemicalClassSurvey: Returns chemical class information comparing a metabolite...

View source: R/rampChemClassQueries.R

chemicalClassSurveyR Documentation

Returns chemical class information comparing a metabolite subset to a larger metabolite population.


Returns chemical class information comparing a metabolite subset to a larger metabolite population.


  background = "database",
  background_type = "database",
  includeRaMPids = FALSE



a list object of source prepended metaboite ids, representing a metabolite set of interest


an optional list of source prepended metaboite ids to be used as the background reference of metabolites for enrichment. The background can be either a list of ids, a file name containing the id list, one id per column (no file header row) or a specificed biospecimen type (available biospecimen types: "Blood", "Adipose tissue", "Heart", "Urine", "Brain", "Liver", "Kidney","Saliva", or "Feces").


one of 'database' (all analytes in the RaMP Database), 'list' (a list of input ids), or 'file' in which case the background parameter will be a file path, or 'biospecimen' where the specified background parameter is a RaMP HMDB metabolite ontology term (see background parameter, above, for the most common biospecimen background values).


include internal RaMP identifiers (default is "FALSE")


Returns chemcial class information data including class count tallies and comparisons between metabolites of interest and the metabolite population, metabolite mappings to classes, and query summary report indicating the number of input metabolites that were resolved and listing those metabolite ids that are not found in the database.

The returned object (return_obj below) contains three or four main result areas. Use str(return_obj) to see the structure described here.

return_obj$count_summary contains a dataframe for each category of class annotations (e.g. class, sub_class) This count summary contains:

category or level name

The chemical class category, e.g. class, sub_class, super_class

class name

The chemical class name, e.g. Organooxygen compounds

pop_counts and met_counts

Population and metabolite list counts for each class


The fraction of the met list's metabolites compared to the population class hits


The fraction of population metabolites within the class describing how common the class is within the population.


The fraction of met list metabolites witin the class describing how common the class is within the metabolite list.

return_obj$met_classes metabolite classes for each input metabolite list id

return_obj$pop_classes metabolite classes for each input population metabolite if a population is provided.

return_obj$query_report this reports on the query list size, the number of input ids that were found in the database and a list of metabolite ids that were not found in the database. There are two sections, one for the metabolite list and a second when an optional population list is provided.


## Not run: 
# metabolite list of interest
metList = c('hmdb:HMDB0000056',

# The background population can be a separate ID list (preferred) or all database entries
# (skip pop parameter).
pkg.globals <- setConnectionToRaMP(dbname="ramp2",username="root",conpass="",host = "localhost")
metClassResult <- chemicalClassSurvey(mets = metList)

# show structure

# show a count summary, metabolite class mappings and query report

## End(Not run)

ncats/RaMP-DB documentation built on Sept. 26, 2022, 4:37 a.m.