run_edec_stage_2: This chunk of code from EDec paper Run EDec stage 2 algorithm

View source: R/edec_stage_2.R

run_edec_stage_2R Documentation

This chunk of code from EDec paper Run EDec stage 2 algorithm

Description

This function implements the second stage of the EDec method. It takes as input the gene expression profiles of complex tissue samples, and the proportions of constituent cell types in each sample. It then estimates average and standard errors of cell type specific gene expression profiles.

Usage

run_edec_stage_2(gene_exp_bulk_samples, cell_type_props)

Arguments

gene_exp_bulk_samples

Matrix of methylation profiles of bulk complex tissue samples. Columns correspond to different samples and rows correspond to different loci/probes.

cell_type_props

Matrix of proportions of constituent cell types. Columns correspond to different cell types and rows correspond to different bulk tissue samples.

Details

EDec assumes that the gene expression profiles of complex tissue samples correspond to the linear combination of cell type proportions and gene expression profiles of each cell type. Given the gene expression profiles of a set of complex tissue samples and the proportions of constituent cell types in each sample, this function estimates average gene expression profiles of constituent cell types by solving constrained least squares problems through quadratic programming. The constraint is that the gene expression profiles of constituent cell types are numbers greater than or equal to zero.

Value

A list with the following components:

means

A matrix with the estimated average gene expression profiles of constituent cell types. Rows correspond to different genes. Columns correspond to different cell types.

std.errors

A matrix with estimated standard errors for each cell type specific gene expression estimate. Rows correspond to different genes. Columns correspond to different cell types.

degrees.of.freedom

Number of degrees of freedom for estimates of cell type specific gene expression

explained.variances

Vector with the proportion of variance in input expression of each gene across samples explained by the final model.

residuals

Matrix with the difference between the original gene expression values and the linear combination between proportions of constituent cell types and gene expression profiles of constituent cell types.


bozdaglab/CTDPathSim2.0 documentation built on April 14, 2022, 12:39 a.m.