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.

Description

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

Usage

chemicalClassSurvey(
  db = RaMP(),
  mets,
  background = "database",
  background_type = "database",
  includeRaMPids = FALSE,
  inferIdMapping = TRUE
)

Arguments

mets

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

background

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").

background_type

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

includeRaMPids

include internal RaMP identifiers (default is "FALSE")

inferIdMapping

if FALSE, the survey only reports on class annotations made directly on the input ids. If inferIdMapping is set to TRUE, the ids are cross-referenced or mapped to related ids that contain metabolite class annotations. The default is TRUE.

Value

Returns chemical 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

fract_of_pop

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

fract_within_pop

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

fract_within_mets

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.

Examples

## Not run: 
# metabolite list of interest
metList = c('hmdb:HMDB0000056',
            'hmdb:HMDB0000439',
            'hmdb:HMDB0000479',
            'hmdb:HMDB0000532',
            'hmdb:HMDB0001015',
            'hmdb:HMDB0001138',
            'hmdb:HMDB0029159',
            'hmdb:HMDB0029412',
            'hmdb:HMDB0034365',
            'hmdb:HMDB0035227',
            'hmdb:HMDB0007973',
            'hmdb:HMDB0008057',
            'hmdb:HMDB0011211')

# 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
utils::str(metClassResult)

# show a count summary, metabolite class mappings and query report
metClassResult$count_summary$class
metClassResult$met_classes
metClassResult$query_report

## End(Not run)

ncats/RaMP-DB documentation built on June 1, 2024, 9:34 p.m.