Skip to contents

Accessor methods for the Consensus and Construction S4 classes.

Usage

mf(x)

# S4 method for Consensus
mf(x)

adductRules(x)

# S4 method for Consensus
adductRules(x)

organism(x)

# S4 method for Consensus
organism(x)

database(x)

# S4 method for Consensus
database(x)

hits(x)

# S4 method for Consensus
hits(x)

PIPs(x)

# S4 method for Consensus
PIPs(x)

classifications(x)

# S4 method for Consensus
classifications(x)

consensusClassifications(x)

# S4 method for Consensus
consensusClassifications(x)

consensus(x, adduct, threshold = 66)

# S4 method for Consensus
consensus(x, adduct, threshold = 66)

# S4 method for Construction
classifications(x)

summariseClassifications(x)

# S4 method for Construction
summariseClassifications(x)

Arguments

x

object of S4 class Consensus or Construction

adduct

the ionisation adduct for which a consensus should be calculated

threshold

the percentage majority threshold for consensus classification

Value

A character, a numeric, a tibble or an object of S4 class MetaboliteDatabase, depending on the method used.

Details

  • mf - Return the searched molecular formula

  • adductRules - Return a tibble of adduct formation rules.

  • organism - Return the KEGG organism ID.

  • database - Return the searched database.

  • threshold - Return the percentage consensus threshold for structural classification selection.

  • hits - Return a MetaboliteDatabase ionisation database of matched database hits.

  • PIPs - Return the putative ionisation products of database hits

  • classifications -Return the structural chemical classifications of database hits.

  • consensusClassifications - Return the consensus classification or classifications.

  • summariseClassifications - Return a tibble of summarised consensus structural classifications.

Examples

consensus <- construct(
  'C4H6O5',
  organism = 'hsa')
#> C4H6O5
#> Searching KEGG...
#> 1 hits returned
#> Retrieving classifications for 1 InChIKeys...
#> ✔ BJEPYKJPYRNKOW-REOHCLBHSA-N
#> 1 classifications returned

## Return the molecular formula
mf(consensus)
#> [1] "C4H6O5"

## Return the adduct formation rules
adductRules(consensus)
#> # A tibble: 58 × 12
#>    Name  Charge    xM   Add Nelec AddAt RemAt AddEx RemEx Rule  Default Isotopic
#>    <chr>  <int> <int> <dbl> <int> <chr> <chr> <chr> <chr> <chr>   <int>    <dbl>
#>  1 [M+3…      3     1 23.0     -3 NA    NA    Na3   NA    HBA2…       0        0
#>  2 [M+H…      3     1 15.7     -3 NA    NA    Na2H  NA    HBA2…       0        0
#>  3 [M+2…      3     1  8.33    -3 NA    NA    NaH2  NA    HBA2…       0        0
#>  4 [M+3…      3     1  1.01    -3 NA    NA    H3    NA    HBA2…       0        0
#>  5 [2M+…      2     2 28.0     -2 NA    NA    H8O3  NA    HBA2…       0        0
#>  6 [M+3…      2     1 62.5     -2 NA    NA    C6H1… NA    HBA2…       0        0
#>  7 [M+2…      2     1 42.0     -2 NA    NA    C4H8… NA    HBA2…       0        0
#>  8 [M+2…      2     1 23.0     -2 NA    NA    Na2   NA    HBA2…       1        0
#>  9 [M+A…      2     1 21.5     -2 NA    NA    C2H5N NA    HBA2…       0        0
#> 10 [M+H…      2     1 20.0     -2 NA    NA    KH    NA    HBA2…       1        0
#> # ℹ 48 more rows

## Return the KEGG organism ID
organism(consensus)
#> [1] "hsa"

## Return the searched database
database(consensus)
#> [1] "kegg"

## Return the `MetaboliteDatabase` ionisation database of searched database  hits
hits(consensus)
#> 
#> MetaboliteDatabase object containing 1 entries
#> 

## Return the putative ionisation products
PIPs(consensus)
#> # A tibble: 54 × 2
#>    Adduct         ID    
#>    <chr>          <chr> 
#>  1 [M+3Na]3+      C00149
#>  2 [M+H+2Na]3+    C00149
#>  3 [M+2H+Na]3+    C00149
#>  4 [M+3H]3+       C00149
#>  5 [2M+3H2O+2H]2+ C00149
#>  6 [M+3ACN+2H]2+  C00149
#>  7 [M+2ACN+2H]2+  C00149
#>  8 [M+2Na]2+      C00149
#>  9 [M+ACN+2H]2+   C00149
#> 10 [M+H+K]2+      C00149
#> # ℹ 44 more rows

## Return the structural classifications
classifications(consensus)
#> # A tibble: 1 × 6
#>   ID     INCHIKEY                    kingdom           superclass class subclass
#>   <chr>  <chr>                       <chr>             <chr>      <chr> <chr>   
#> 1 C00149 BJEPYKJPYRNKOW-REOHCLBHSA-N Organic compounds Organic a… Hydr… Beta hy…

## Return the consensus structural classification
consensusClassifications(consensus)
#> # A tibble: 220 × 6
#>    adduct         level      class                   total     n `consensus (%)`
#>    <chr>          <fct>      <chr>                   <int> <int>           <dbl>
#>  1 M              class      Hydroxy acids and deri…     1     1             100
#>  2 M              kingdom    Organic compounds           1     1             100
#>  3 M              subclass   Beta hydroxy acids and…     1     1             100
#>  4 M              superclass Organic acids and deri…     1     1             100
#>  5 [2M+3H2O+2H]2+ class      Hydroxy acids and deri…     1     1             100
#>  6 [2M+3H2O+2H]2+ kingdom    Organic compounds           1     1             100
#>  7 [2M+3H2O+2H]2+ subclass   Beta hydroxy acids and…     1     1             100
#>  8 [2M+3H2O+2H]2+ superclass Organic acids and deri…     1     1             100
#>  9 [2M+ACN+H]1+   class      Hydroxy acids and deri…     1     1             100
#> 10 [2M+ACN+H]1+   kingdom    Organic compounds           1     1             100
#> # ℹ 210 more rows