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) – network

  • peak_mat (Union[AnnData, AnnDataSet, None]) – AnnData or AnnDataSet object storing the cell by peak count matrix, where the .var_names contains peaks.

  • gene_mat (Union[AnnData, AnnDataSet, None]) – AnnData or AnnDataSet object storing the cell by gene count matrix, where the .var_names contains genes.

  • select (Optional[list[str]]) – 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, with 0 <= l1_ratio <= 1. For l1_ratio = 0 the penalty is an L2 penalty. For l1_ratio = 1 it is an L1 penalty. For 0 < l1_ratio < 1, the penalty is a combination of L1 and L2.

  • use_gpu (bool) – Whether to use gpu

  • overwrite (bool) – Whether to overwrite existing records.