create_tidy_omic | R Documentation |
A tidy omics object contains a formatted dataset and a summary of the experimental design.
create_tidy_omic(
df,
feature_pk,
feature_vars = NULL,
sample_pk,
sample_vars = NULL,
omic_type_tag = "general",
verbose = TRUE
)
df |
a data.frame (or tibble) containing some combination of feature, sample and observation-level variables |
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_pk |
A unique identifier for samples |
sample_vars |
a character vector of additional sample-level variables (or NULL if there are no additional variables) |
omic_type_tag |
an optional subtype of omic data: metabolomics, lipidomics, proteomics, genomics, general |
verbose |
extra reporting messages |
An S3 tidy_omic
/tomic
object built on a list
:
A tibble with one row per measurement (i.e., features x samples)
A list which organized the dataset's meta-data:
variable specifying a unique feature
variable specifying a unique sample
tibble of feature attributes
tibble of sample attributes
tibble of measurement attributes
library(dplyr)
measurement_df <- tidyr::expand_grid(
feature_id = 1:10,
sample_id = LETTERS[1:5]
) %>%
dplyr::mutate(value = rnorm(n()))
feature_df <- tibble(
feature_id = 1:10,
feature_group = rep(c("a", "b"), each = 5)
)
sample_df <- tibble(
sample_id = LETTERS[1:5],
sample_group = c("a", "a", "b", "b", "b")
)
triple_omic <- create_triple_omic(
measurement_df, feature_df, sample_df,
"feature_id", "sample_id"
)
raw_tidy_omic <- triple_to_tidy(triple_omic)$data
create_tidy_omic(raw_tidy_omic,
feature_pk = "feature_id",
feature_vars = "feature_group", sample_pk = "sample_id",
sample_vars = "sample_group"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.