| Title: | multiOmicDataSet object class for MOSuite |
|---|---|
| Description: | MOObject defines the multiOmicDataSet object class which is used in MOSuite for differential RNA-seq and multi-omics analyses. Separating the MOObject class definition from MOSuite allows for lightweight installations in downstream workflows. See the website for more information: <https://ccbr.github.io/MOObject/>. See the MOSuite website for the most comprehensive documentation: <https://ccbr.github.io/MOSuite/>. |
| Authors: | Kelly L Sovacool [aut, cre] (ORCID: <https://orcid.org/0000-0003-3283-829X>), Philip Homan [aut], Vishal Koparde [aut] (ORCID: <https://orcid.org/0000-0001-8978-8495>), CCR Collaborative Bioinformatics Resource [cph] |
| Maintainer: | Kelly L Sovacool <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.5.0.9000 |
| Built: | 2026-10-08 17:12:00 UTC |
| Source: | https://github.com/CCBR/MOObject |
Construct a multiOmicDataSet object from data frames
create_multiOmicDataSet_from_dataframes( sample_metadata, counts_dat, sample_id_colname = NULL, feature_id_colname = NULL, count_type = "raw" )create_multiOmicDataSet_from_dataframes( sample_metadata, counts_dat, sample_id_colname = NULL, feature_id_colname = NULL, count_type = "raw" )
sample_metadata |
sample metadata as a data frame or tibble. The first column is assumed to contain the sample IDs which must correspond to column names in the raw counts. |
counts_dat |
data frame of feature counts (e.g. expected feature counts from RSEM). |
sample_id_colname |
name of the column in |
feature_id_colname |
name of the column in |
count_type |
type to assign the values of |
A multiOmicDataSet object.
Other moo:
create_multiOmicDataSet_from_files(),
extract_counts(),
multiOmicDataSet(),
read_multiOmicDataSet(),
read_multiOmicDataSet_properties(),
write_multiOmicDataSet(),
write_multiOmicDataSet_properties()
sample_meta_dat <- data.frame(sample_id = c("s1", "s2"), group = c("A", "B")) feature_counts_dat <- data.frame( feature_id = c("gene1", "gene2"), s1 = c(10, 20), s2 = c(15, 25) ) moo <- create_multiOmicDataSet_from_dataframes( sample_metadata = sample_meta_dat, counts_dat = feature_counts_dat ) head(moo@sample_meta) head(moo@counts[['raw']])sample_meta_dat <- data.frame(sample_id = c("s1", "s2"), group = c("A", "B")) feature_counts_dat <- data.frame( feature_id = c("gene1", "gene2"), s1 = c(10, 20), s2 = c(15, 25) ) moo <- create_multiOmicDataSet_from_dataframes( sample_metadata = sample_meta_dat, counts_dat = feature_counts_dat ) head(moo@sample_meta) head(moo@counts[['raw']])
Construct a multiOmicDataSet object from text files (e.g. TSV, CSV).
create_multiOmicDataSet_from_files( sample_meta_filepath, feature_counts_filepath, count_type = "raw", sample_id_colname = NULL, feature_id_colname = NULL, delim = NULL, ... )create_multiOmicDataSet_from_files( sample_meta_filepath, feature_counts_filepath, count_type = "raw", sample_id_colname = NULL, feature_id_colname = NULL, delim = NULL, ... )
sample_meta_filepath |
path to text file with sample IDs and metadata for differential analysis. |
feature_counts_filepath |
path to text file of expected feature counts (e.g. gene counts from RSEM). |
count_type |
type to assign the values of |
sample_id_colname |
name of the column in |
feature_id_colname |
name of the column in |
delim |
Delimiter used in the input files. Any delimiter accepted by |
... |
additional arguments forwarded to |
A multiOmicDataSet object.
Other moo:
create_multiOmicDataSet_from_dataframes(),
extract_counts(),
multiOmicDataSet(),
read_multiOmicDataSet(),
read_multiOmicDataSet_properties(),
write_multiOmicDataSet(),
write_multiOmicDataSet_properties()
sample_meta_dat <- data.frame(sample_id = c("s1", "s2"), group = c("A", "B")) feature_counts_dat <- data.frame( feature_id = c("gene1", "gene2"), s1 = c(10, 20), s2 = c(15, 25) ) sample_meta_filepath <- tempfile(fileext = ".csv") feature_counts_filepath <- tempfile(fileext = ".csv") readr::write_csv(sample_meta_dat, sample_meta_filepath) readr::write_csv(feature_counts_dat, feature_counts_filepath) moo <- create_multiOmicDataSet_from_files( sample_meta_filepath = sample_meta_filepath, feature_counts_filepath = feature_counts_filepath, delim = "," ) head(moo@sample_meta) head(moo@counts[['raw']])sample_meta_dat <- data.frame(sample_id = c("s1", "s2"), group = c("A", "B")) feature_counts_dat <- data.frame( feature_id = c("gene1", "gene2"), s1 = c(10, 20), s2 = c(15, 25) ) sample_meta_filepath <- tempfile(fileext = ".csv") feature_counts_filepath <- tempfile(fileext = ".csv") readr::write_csv(sample_meta_dat, sample_meta_filepath) readr::write_csv(feature_counts_dat, feature_counts_filepath) moo <- create_multiOmicDataSet_from_files( sample_meta_filepath = sample_meta_filepath, feature_counts_filepath = feature_counts_filepath, delim = "," ) head(moo@sample_meta) head(moo@counts[['raw']])
Extract count data
extract_counts(moo, count_type, sub_count_type = NULL) ## S7 method for class <MOObject::multiOmicDataSet> extract_counts(moo, count_type, sub_count_type = NULL)extract_counts(moo, count_type, sub_count_type = NULL) ## S7 method for class <MOObject::multiOmicDataSet> extract_counts(moo, count_type, sub_count_type = NULL)
moo |
multiOmicDataSet containing |
count_type |
the type of counts to use – must be a name in the counts slot ( |
sub_count_type |
if |
A data frame of counts.
Other moo:
create_multiOmicDataSet_from_dataframes(),
create_multiOmicDataSet_from_files(),
multiOmicDataSet(),
read_multiOmicDataSet(),
read_multiOmicDataSet_properties(),
write_multiOmicDataSet(),
write_multiOmicDataSet_properties()
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")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")
multiOmicDataSet class
multiOmicDataSet(sample_metadata, anno_dat, counts_lst, analyses_lst = list())multiOmicDataSet(sample_metadata, anno_dat, counts_lst, analyses_lst = list())
sample_metadata |
sample metadata as a data frame or tibble. The first column is assumed to contain the sample IDs which must correspond to column names in the raw counts. |
anno_dat |
data frame of feature annotations, such as gene symbols or any other information about the features
in |
counts_lst |
named list of data frames containing counts, e.g. expected feature counts from RSEM. Each data
frame is expected to contain a |
analyses_lst |
named list of analysis results, e.g. DESeq results object |
A multiOmicDataSet S7 object.
@sample_metasample metadata as a data frame or tibble. The first column is assumed to contain the sample IDs which must correspond to column names in the raw counts.
@countsnamed list of counts data frames (e.g. raw, clean, cpm, filt, norm, batch). Each data
frame is expected to contain a feature ID column as the first column, and all remaining columns are sample IDs.
@annotationdata frame of feature annotations, such as gene symbols or any other information about the features in the counts list.
@analysesnamed list of analysis results (e.g. DESeq2 results, colors).
Other moo:
create_multiOmicDataSet_from_dataframes(),
create_multiOmicDataSet_from_files(),
extract_counts(),
read_multiOmicDataSet(),
read_multiOmicDataSet_properties(),
write_multiOmicDataSet(),
write_multiOmicDataSet_properties()
# sample metadata (sample names, labels, groups, batches, etc.) sample_metadata <- data.frame(sample_id = c("s1", "s2"), group = c("A", "B")) # counts data such as from bulk RNA-seq counts_dat <- data.frame( feature_id = c("gene1", "gene2"), s1 = c(10, 20), s2 = c(15, 25) ) # annotations for the counts data such as alternative gene names, gene IDs, etc. anno_dat <- data.frame(feature_id = c("gene1", "gene2"), ensembl_id = c('ENSG000001', 'ENSG000002')) # construct a multiOmicDataSet object moo <- multiOmicDataSet( sample_metadata = sample_metadata, counts_lst = list(raw = counts_dat), anno_dat = anno_dat ) moo S7::S7_class(moo) # validate the object S7::validate(moo) # Retrieve properties from the object head(moo@sample_meta) # Set properties in the object moo@sample_meta$batch <- c("C", "D")# sample metadata (sample names, labels, groups, batches, etc.) sample_metadata <- data.frame(sample_id = c("s1", "s2"), group = c("A", "B")) # counts data such as from bulk RNA-seq counts_dat <- data.frame( feature_id = c("gene1", "gene2"), s1 = c(10, 20), s2 = c(15, 25) ) # annotations for the counts data such as alternative gene names, gene IDs, etc. anno_dat <- data.frame(feature_id = c("gene1", "gene2"), ensembl_id = c('ENSG000001', 'ENSG000002')) # construct a multiOmicDataSet object moo <- multiOmicDataSet( sample_metadata = sample_metadata, counts_lst = list(raw = counts_dat), anno_dat = anno_dat ) moo S7::S7_class(moo) # validate the object S7::validate(moo) # Retrieve properties from the object head(moo@sample_meta) # Set properties in the object moo@sample_meta$batch <- c("C", "D")
Read a multiOmicDataSet from RDS
read_multiOmicDataSet(filepath)read_multiOmicDataSet(filepath)
filepath |
Path to an RDS file produced by |
A multiOmicDataSet object.
Other moo:
create_multiOmicDataSet_from_dataframes(),
create_multiOmicDataSet_from_files(),
extract_counts(),
multiOmicDataSet(),
read_multiOmicDataSet_properties(),
write_multiOmicDataSet(),
write_multiOmicDataSet_properties()
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) filepath <- tempfile(fileext = ".rds") write_multiOmicDataSet(moo, filepath) moo2 <- read_multiOmicDataSet(filepath)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) filepath <- tempfile(fileext = ".rds") write_multiOmicDataSet(moo, filepath) moo2 <- read_multiOmicDataSet(filepath)
Reads a directory created by write_multiOmicDataSet_properties() and
reconstructs the multiOmicDataSet object. The sample_meta and
annotation properties are read from CSV files, the counts property is
read from the counts/ subdirectory, and the analyses property is read
from the analyses/ subdirectory.
read_multiOmicDataSet_properties(input_dir)read_multiOmicDataSet_properties(input_dir)
input_dir |
Directory previously created by
|
A multiOmicDataSet object.
Other moo:
create_multiOmicDataSet_from_dataframes(),
create_multiOmicDataSet_from_files(),
extract_counts(),
multiOmicDataSet(),
read_multiOmicDataSet(),
write_multiOmicDataSet(),
write_multiOmicDataSet_properties()
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) output_dir <- tempfile() write_multiOmicDataSet_properties(moo, output_dir) moo2 <- read_multiOmicDataSet_properties(output_dir)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) output_dir <- tempfile() write_multiOmicDataSet_properties(moo, output_dir) moo2 <- read_multiOmicDataSet_properties(output_dir)
Write a multiOmicDataSet to RDS
write_multiOmicDataSet(moo, filepath = "moo.rds")write_multiOmicDataSet(moo, filepath = "moo.rds")
moo |
multiOmicDataSet object to serialize |
filepath |
Path to the RDS file to write (default: "moo.rds") |
Invisibly returns filepath.
Other moo:
create_multiOmicDataSet_from_dataframes(),
create_multiOmicDataSet_from_files(),
extract_counts(),
multiOmicDataSet(),
read_multiOmicDataSet(),
read_multiOmicDataSet_properties(),
write_multiOmicDataSet_properties()
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) filepath <- tempfile(fileext = ".rds") write_multiOmicDataSet(moo, filepath)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) filepath <- tempfile(fileext = ".rds") write_multiOmicDataSet(moo, filepath)
The sample_meta and annotation properties are written to CSV files, the
counts property is written to a subdirectory of CSV files, and the
analyses property is written to a subdirectory of CSV or RDS files
depending on the type of each analysis result.
write_multiOmicDataSet_properties(moo, output_dir = "moo") ## S7 method for class <MOObject::multiOmicDataSet> write_multiOmicDataSet_properties(moo, output_dir = "moo")write_multiOmicDataSet_properties(moo, output_dir = "moo") ## S7 method for class <MOObject::multiOmicDataSet> write_multiOmicDataSet_properties(moo, output_dir = "moo")
moo |
multiOmicDataSet object to write properties from |
output_dir |
Directory where the properties will be saved (default: "moo") |
Invisibly returns output_dir.
Other moo:
create_multiOmicDataSet_from_dataframes(),
create_multiOmicDataSet_from_files(),
extract_counts(),
multiOmicDataSet(),
read_multiOmicDataSet(),
read_multiOmicDataSet_properties(),
write_multiOmicDataSet()
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) output_dir <- tempfile() write_multiOmicDataSet_properties(moo, output_dir)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) output_dir <- tempfile() write_multiOmicDataSet_properties(moo, output_dir)