add_tech_rep: Add technical replicates

View source: R/add_tech_rep.R

add_tech_repR Documentation

Add technical replicates

Description

Add counts across columns of a count matrix corresponding to technical replicates.

Usage

add_tech_rep(se, group)

Arguments

se

SummarizedExperiment object

group

Character string vector, or factor, that indicates the grouping of technical replicates.

Value

A SummarizedExperiment object, where technical replicates have been added in the count matrix.

Author(s)

Robert Castelo

Examples

library(SummarizedExperiment)

cnt <- matrix(1, nrow=3, ncol=9,
                dimnames=list(paste0("g", 1:3), paste0("s", 1:9)))
cdata <- data.frame(group=rep(LETTERS[1:3], each=3), row.names=colnames(cnt))
se <- SummarizedExperiment(assays=list(counts=cnt), colData=cdata)
dim(se)
assays(se)$counts

se <- add_tech_rep(se, se$group)
dim(se)
assays(se)$counts


ieomscbinfupf/IEOproject documentation built on April 17, 2025, 2:05 p.m.