A triple omics class contains three data.frames, one for features, one for samples, and one for abundances. This is a good format when there is a large amount of meta data associated with features or samples.

create_triple_omic(
  measurement_df,
  feature_df = NULL,
  sample_df = NULL,
  feature_pk,
  sample_pk,
  omic_type_tag = "general"
)

Arguments

measurement_df

A data.frame (or tibble) of measurements - one row for each combination of feature and sample

feature_df

A data.frame (or tibble) of features - one row per feature

sample_df

A data.frame (or tibble) of samples - one row per sample

feature_pk

A unique identifier for features

sample_pk

A unique identifier for samples

omic_type_tag

an optional subtype of omic data: metabolomics, lipidomics, proteomics, genomics, general

Value

An S3 triple_omic/tomic object built on a list:

features

A tibble of feature meta-data (one row per feature)

samples

A tibble of sample meta-data (one row per sample)

measurements

A tibble with one row per measurement (i.e., features x samples)

design

A list which organized the dataset's meta-data:

feature_pk

variable specifying a unique feature

sample_pk

variable specifying a unique sample

features

tibble of feature attributes

samples

tibble of sample attributes

measurements

tibble of measurement attributes

Details

for now primary keys are unique (rather than allowing for a multi-index)

Examples


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"
)