snapatac2.tl.add_cor_scores#

snapatac2.tl.add_cor_scores(network, *, gene_mat=None, peak_mat=None, select=None, overwrite=False)[source]#

Compute correlation scores for any two connected nodes in the network.

This function can be used to compute correlation scores for any type of associations. There are typically three types of edges in the network:

  1. Region -> gene: CREs regulate target genes.

  2. Gene -> gene: genes regulate other genes.

  3. Gene -> region: TFs bind to CREs.

Parameters:
  • network (PyDiGraph) – network

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

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

  • select (Optional[list[str]]) – Run this for selected genes only.

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