createBulkProfiles: Generate bulk tissue profiles from purified cell types

View source: R/createBulkProfiles.R

createBulkProfilesR Documentation

Generate bulk tissue profiles from purified cell types

Description

Given some reference DNA methylation profiles, this function combines them in a weighted sum using the user-provided proportions to construct bulk tissue profiles in known ratios. There is also the option to specifiy the addition of a proportion of noise. If this is required a random vector of DNA methylation levels is generated from a uniform distribution.

Usage

createBulkProfiles(purifiedBetas, matrixSimProp)

Arguments

purifiedBetas

A matrix with DNA methylation levels for reference cell types. Format is one column per cell type.

matrixSimProp

A matrix of proportions to weight reference cell types. Each row represents a different combination of cell types. Number of columns must match the number of columns in purifiedBetas, unless the last column is the proportion of noise, and must be labelled as such. Columns must be named.

Value

A matrix of DNA methylation levels, with the same number of rows as rows in purifiedBetas and the same number of columns as rows in matrixSimProp.

Examples

# 3 cell type example
cellProps <- matrix(c(0.1, 0.4, 0.5, 0.2, 0.2, 0.6), ncol = 3)
colnames(cellProps) <- c("A", "B", "C")
refBetas <- matrix(runif(10 * 3, min = 0, max = 1), ncol = 3)
createBulkProfiles(refBetas, cellProps)

# add noise to example
cellProps <- cbind(cellProps, c(0.1, 0.2))
colnames(cellProps)[4] <- "Noise"
createBulkProfiles(refBetas, cellProps)

ds420/CETYGO documentation built on Oct. 22, 2024, 8:49 p.m.