convert_wide_to_tidy_omic | R Documentation |
Convert a wide dataset of species' abundances (gene product, metabolites, lipids, ...) into a triple_omic dataset (one observation per row)
convert_wide_to_tidy_omic(
wide_df,
feature_pk,
feature_vars = NULL,
sample_var = "sample",
measurement_var = "abundance",
omic_type_tag = "general",
verbose = TRUE
)
wide_df |
a data.frame (or tibble) containing 1+ columns of feature attributes and many columns of samples |
feature_pk |
A unique identifier for features |
feature_vars |
a character vector of additional feature-level variables (or NULL if there are no additional variables) |
sample_var |
variable name to use for samples |
measurement_var |
variable name to use for measurements |
omic_type_tag |
an optional subtype of omic data: metabolomics, lipidomics, proteomics, genomics, general |
verbose |
extra reporting messages |
A tidy_omic
object as produced by create_tidy_omic
.
library(dplyr)
wide_measurements <- brauer_2008_triple[["measurements"]] %>%
tidyr::spread(sample, expression)
wide_df <- brauer_2008_triple[["features"]] %>%
left_join(wide_measurements, by = "name")
convert_wide_to_tidy_omic(wide_df,
feature_pk = "name",
feature_vars = c("BP", "MF", "systematic_name")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.