snapatac2.tl.add_regr_scores#
- snapatac2.tl.add_regr_scores(network, *, peak_mat=None, gene_mat=None, select=None, method='elastic_net', scale_X=False, scale_Y=False, alpha=1.0, l1_ratio=0.5, use_gpu=False, overwrite=False)[source]#
Perform regression analysis for nodes and their parents in the network.
- Parameters:
network (
PyDiGraph) – networkpeak_mat (
AnnData|AnnDataSet|None) – AnnData or AnnDataSet object storing the cell by peak count matrix, where the.var_namescontains peaks.gene_mat (
AnnData|AnnDataSet|None) – AnnData or AnnDataSet object storing the cell by gene count matrix, where the.var_namescontains genes.select (
list[str] |None) – Run this for selected genes only.method (
Literal['gb_tree','elastic_net']) – Regresson model.scale_X (
bool) – Whether to scale the features.scale_Y (
bool) – Whether to scale the response variable.alpha (
float) – Constant that multiplies the penalty terms in ‘elastic_net’.l1_ratio (
float) – Used in ‘elastic_net’. The ElasticNet mixing parameter, with0 <= l1_ratio <= 1. Forl1_ratio = 0the penalty is an L2 penalty. Forl1_ratio = 1it is an L1 penalty. For0 < l1_ratio < 1, the penalty is a combination of L1 and L2.use_gpu (
bool) – Whether to use gpuoverwrite (
bool) – Whether to overwrite existing records.