This function prepares the metabolic data to be used in the COSMOS optimization steps. It takes as input a vector with the metabolic data (e.g, limma t values) named with PUBCHEM IDs and expand it to the multi-compartment COSMOS format. It also messages the number of final inputs in the meta network.

prepare_metabolomics_data(metabolic_data, meta_network)

Arguments

metabolic_data

A named numeric vector, containing the values to be used for the metabolic layer in COSMOS. The names of the vector should be PUBCHEM IDs.

meta_network

Prior knowledge network created with data(meta_network).

Value

A new vector ready to be used as COSMOS input.

Examples

# generate random t-values: t_values <- rnorm(10) # assign to metabolites with pubchem names data(metabolite_to_pubchem) metabolite_to_pubchem <- metabolite_to_pubchem names(t_values) <- metabolite_to_pubchem$pubchem[1:10] data(meta_network) prepare_metabolomics_data(t_values, meta_network)
#> COSMOS: Adding `XMetab__` label to metabolic data names 10
#> COSMOS: Original number of metabolic inputs = 10
#> COSMOS: Resulting number of expanded metabolic inputs: 80
#> XMetab__122347___r____ XMetab__53477676___r____ XMetab__6166___r____ #> -1.86301149 -0.52201251 -0.05260191 #> XMetab__428___r____ XMetab__962___r____ XMetab__977___r____ #> 0.54299634 -0.91407483 0.46815442 #> XMetab__75___r____ XMetab__784___r____ XMetab__222___r____ #> 0.36295126 -1.30454355 0.73777632 #> XMetab__1038___r____ XMetab__122347___c____ XMetab__53477676___c____ #> 1.88850493 -1.86301149 -0.52201251 #> XMetab__6166___c____ XMetab__428___c____ XMetab__962___c____ #> -0.05260191 0.54299634 -0.91407483 #> XMetab__977___c____ XMetab__75___c____ XMetab__784___c____ #> 0.46815442 0.36295126 -1.30454355 #> XMetab__222___c____ XMetab__1038___c____ XMetab__122347___e____ #> 0.73777632 1.88850493 -1.86301149 #> XMetab__53477676___e____ XMetab__6166___e____ XMetab__428___e____ #> -0.52201251 -0.05260191 0.54299634 #> XMetab__962___e____ XMetab__977___e____ XMetab__75___e____ #> -0.91407483 0.46815442 0.36295126 #> XMetab__784___e____ XMetab__222___e____ XMetab__1038___e____ #> -1.30454355 0.73777632 1.88850493 #> XMetab__122347___l____ XMetab__53477676___l____ XMetab__6166___l____ #> -1.86301149 -0.52201251 -0.05260191 #> XMetab__428___l____ XMetab__962___l____ XMetab__977___l____ #> 0.54299634 -0.91407483 0.46815442 #> XMetab__75___l____ XMetab__784___l____ XMetab__222___l____ #> 0.36295126 -1.30454355 0.73777632 #> XMetab__1038___l____ XMetab__122347___x____ XMetab__53477676___x____ #> 1.88850493 -1.86301149 -0.52201251 #> XMetab__6166___x____ XMetab__428___x____ XMetab__962___x____ #> -0.05260191 0.54299634 -0.91407483 #> XMetab__977___x____ XMetab__75___x____ XMetab__784___x____ #> 0.46815442 0.36295126 -1.30454355 #> XMetab__222___x____ XMetab__1038___x____ XMetab__122347___m____ #> 0.73777632 1.88850493 -1.86301149 #> XMetab__53477676___m____ XMetab__6166___m____ XMetab__428___m____ #> -0.52201251 -0.05260191 0.54299634 #> XMetab__962___m____ XMetab__977___m____ XMetab__75___m____ #> -0.91407483 0.46815442 0.36295126 #> XMetab__784___m____ XMetab__222___m____ XMetab__1038___m____ #> -1.30454355 0.73777632 1.88850493 #> XMetab__122347___n____ XMetab__53477676___n____ XMetab__6166___n____ #> -1.86301149 -0.52201251 -0.05260191 #> XMetab__428___n____ XMetab__962___n____ XMetab__977___n____ #> 0.54299634 -0.91407483 0.46815442 #> XMetab__75___n____ XMetab__784___n____ XMetab__222___n____ #> 0.36295126 -1.30454355 0.73777632 #> XMetab__1038___n____ XMetab__122347___g____ XMetab__53477676___g____ #> 1.88850493 -1.86301149 -0.52201251 #> XMetab__6166___g____ XMetab__428___g____ XMetab__962___g____ #> -0.05260191 0.54299634 -0.91407483 #> XMetab__977___g____ XMetab__75___g____ XMetab__784___g____ #> 0.46815442 0.36295126 -1.30454355 #> XMetab__222___g____ XMetab__1038___g____ #> 0.73777632 1.88850493