PomaCreateObject: Create a 'SummarizedExperiment' Object

View source: R/PomaCreateObject.R

PomaCreateObjectR Documentation

Create a SummarizedExperiment Object

Description

PomaCreateObject creates a SummarizedExperiment object from data frames.

Usage

PomaCreateObject(metadata = NULL, features = NULL, factor_levels = 10)

Arguments

metadata

Data frame. Metadata variables structured in columns. Sample ID must be the first column.

features

Matrix of features. Each feature is a column.

factor_levels

Numeric. Integer variables with less levels than indicated by this parameter will be treated as factors.

Value

A SummarizedExperiment object.

Author(s)

Pol Castellano-Escuder

References

Morgan M, Obenchain V, Hester J, Pagès H (2021). SummarizedExperiment: SummarizedExperiment container. R package version 1.24.0, https://bioconductor.org/packages/SummarizedExperiment.

Examples

data(iris)

# Create metadata: Data frame with sample names and a group factor
metadata <- data.frame(sample_id = paste0("sample_", 1:150), group = iris$Species)

# Create features: `p` column data frame with features
features <- iris[, 1:4]

# Create a `SummarizedExperiment` object with `POMA`
object <- PomaCreateObject(metadata = metadata, 
                           features = features)

pcastellanoescuder/POMA documentation built on Nov. 28, 2024, 1:21 p.m.