Skip to contents

Generate a consensus structural classification for a molecular formula.

Usage

construct(
  MF,
  db = c("kegg", "pubchem"),
  organism = character(),
  adduct_rules_table = adduct_rules(),
  classyfireR_cache = NULL
)

Arguments

MF

the molecular formula to search

db

databases to search. Can be either kegg or pubchem.

organism

the KEGG organism ID to search. Ignored if argument db includes pubchem.

adduct_rules_table

a dataframe containing adduct formation rules. The defaults is mzAnnotation::adduct_rules().

classyfireR_cache

file path for a classyfireR cache. See the documentation of classyfireR::get_classification for more details.

Value

An S4 object of class Consensus.

Examples

construct('C4H6O5')
#> C4H6O5
#> Searching KEGG...
#> 8 hits returned
#> Retrieving classifications for 7 InChIKeys...
#> ✔ BJEPYKJPYRNKOW-REOHCLBHSA-N
#> ✔ BJEPYKJPYRNKOW-UWTATZPHSA-N
#> ✔ BJEPYKJPYRNKOW-UHFFFAOYSA-N
#> ✔ SCSGVVIUUUPOOJ-GSVOUGTGSA-N
#> ✔ SCSGVVIUUUPOOJ-VKHMYHEASA-N
#> ✔ CODPBKJMVNZFKR-REOHCLBHSA-N
#> ✔ CODPBKJMVNZFKR-UWTATZPHSA-N
#> 7 classifications returned
#> Consensus structural classifications
#> 
#> MF:			 C4H6O5 
#> Adducts:		 58 
#> Organism:		  
#> Database:		 kegg 
#> Hits:			 8 
#> Classifications:	 8 
#> Average PIPs:		 8 
#> 
#> kingdom: Organic compounds
#> └─superclass: Organic acids and derivatives