Skip to contents

Extract count data

Usage

extract_counts(moo, count_type, sub_count_type = NULL)

## S7 method for class <MOObject::multiOmicDataSet>
extract_counts(moo, count_type, sub_count_type = NULL)

Arguments

moo

multiOmicDataSet containing count_type & sub_count_type in the counts slot

count_type

the type of counts to use – must be a name in the counts slot (moo@counts[[count_type]])

sub_count_type

if count_type is a list, specify the sub count type within the list (moo@counts[[count_type]][[sub_count_type]]). (Default: NULL)

Value

A data frame of counts.

Examples

sample_metadata <- data.frame(sample_id = c("s1", "s2"), group = c("A", "B"))
counts_dat <- data.frame(
  feature_id = c("gene1", "gene2"),
  s1 = c(10, 20),
  s2 = c(15, 25)
)
moo <- create_multiOmicDataSet_from_dataframes(sample_metadata, counts_dat)
extract_counts(moo, "raw")
#>   feature_id s1 s2
#> 1      gene1 10 15
#> 2      gene2 20 25