Remove technical replicates from data and design
Source:R/calculateStatistics.R
reduceTechnicalReplicates.RdCollapses sample values into their average. If only one value is present due to NA-values in other technical replicates, then that value is used.
Details
Takes a SummarizedExperiment where the data is present as the assay and the colData contains the design conditions. In the design conditions there should be one column with the technical replicate groups and one column containing the sample names
Examples
testData <- as.matrix(data.frame(
c(1,1,1),
c(1,2,1),
c(7,7,7),
c(7,9,7)))
colnames(testData) <- c("a1", "a2", "b1", "b2")
designDf <- data.frame(
sample=c("a1", "a2", "b1", "b2"),
techrep=c("a", "a", "b", "b"))
se <- SummarizedExperiment::SummarizedExperiment(
assay=testData,
colData=designDf
)
statObj <- reduceTechnicalReplicates(se, "techrep", "sample")