Compute regression-based gene scores
Source:R/17_gene_and_cell_score.R
computeRegressionGeneScores.RdFor each gene, regresses its expression on the cell score and uses the
regression coefficient (beta) as the gene weight. This evaluates each gene
independently and avoids collinearity issues present in the PCA
back-projection approach used by computeGeneAndCellScores.
Usage
computeRegressionGeneScores(object, sigma = NULL, verbose = TRUE)
# S4 method for class 'CoPro'
computeRegressionGeneScores(object, sigma = NULL, verbose = TRUE)
# S4 method for class 'CoProMulti'
computeRegressionGeneScores(object, sigma = NULL, verbose = TRUE)Arguments
- object
A CoPro object with cell scores already computed via
computeGeneAndCellScores.- sigma
Optional numeric vector of sigma values to process. If
NULL(default), all sigma values inobject@sigmaValuesare used.- verbose
Logical; print progress messages. Default
TRUE.
Value
The input object with the @geneScoresRegression slot
populated with regression-based gene weights (beta coefficients).
The format mirrors @geneScores: a flat list keyed by
"geneScores|sigma<value>|<cellType>", each entry a
genes x nCC matrix.
Details
Results are stored in the @geneScoresRegression slot, leaving the
original PCA-based @geneScores slot untouched.
For each cell type, sigma value, and canonical component (CC):
Retrieves the cell score vector from
@cellScores.Subsets
@normalizedDataSubto cells of that type.Computes
beta_g = cov(gene_g, cellScore) / var(cellScore)for every gene g (equivalent to simple linear regression).Stores the beta vector in
@geneScoresRegression.
See also
computeGeneAndCellScores for the PCA-based gene
scores, testGeneGLM for statistical testing with covariates.