wRPC: Estimation of cell-type fractions using a DNAm reference...

View source: R/wRPC.R

wRPCR Documentation

Estimation of cell-type fractions using a DNAm reference matrix

Description

This function takes as input a number of genome-wide DNAm profiles from purified or complex bulk tissue samples and estimates the proportions of the main cell-types in the samples.

Usage

wRPC(data, ref.m, useW = TRUE, wth=0.4, maxit = 100)

Arguments

data

A DNAm data matrix with columns labeling samples and rows labeling genes (using Entrez gene identifier). This assumes that DNAm has been summarized at the gene level, for instance by averaging DNAm values over CpGs or probes that map to 200bp upstream of the gene's TSS. data can also be a vector if there is only one sample.

ref.m

The DNAm reference matrix to be used with rows labeling genes (using Entrez gene identifier) and columns labeling the main cell-types, with last column labeling the weight. Weights need to be between 0 and 1.

useW

A logical. If 'TRUE' weights are used in the regression, otherwise not.

wth

A threshold on the weights to select most informative genes. Only used if useW is TRUE.

maxit

The maximum number of iterations in the robust linear regression.

Value

A list containing the following elements:

estF

A matrix of estimated cell-type fractions, with rows labeling samples and columns labeling the cell-types in the reference matrix.

ref

The reference matrix used, i.e for the genes overlapping with those in the data matrix.

References

Teschendorff AE, Zhu T, Breeze CE, Beck S. Cell-type deconvolution of bulk tissue DNA methylomes from single-cell RNA-Seq data Genome Biol.2020

Teschendorff AE, Breeze CE, Zheng SC, Beck S. A comparison of reference-based algorithms for correcting cell-type heterogeneity in Epigenome-Wide Association Studies. BMC Bioinformatics (2017) 18: 105. doi: 10.1186/s12859-017-1511-5.

Examples

data(lungSS2mca1)
out.l <- ConstExpRef(lungSS2mca1.m,celltypeSS2.idx,celltypeSS2.v,markspecTH.v=rep(3,4));
refDNAm1.m <- ImputeDNAmRef(out.l$ref$med,db="SCM2",geneID="SYMBOL");
refDNAm2.m <- ImputeDNAmRef(out.l$ref$med,db="RMAP",geneID="SYMBOL");
refDNAm.m <- ConstMergedDNAmRef(refDNAm1.m,refDNAm2.m);
data(testDNAm);
avDNAm.m <- constAvBetaTSS(testDNAm.m,type="450k");
wRPC.o <- wRPC(avDNAm.m,refDNAm.m,useW=TRUE,wth=0.4,maxit=200);
print(head(wRPC.o$est));



aet21/EpiSCORE documentation built on June 26, 2022, 5:50 p.m.