regvelo.tools.inferred_grn

regvelo.tools.inferred_grn(vae, adata, label=None, group=None, cell_specific_grn=False, data_frame=False)[source]

Infer the gene regulatory network (GRN) using a trained RegVelo VAE model.

Parameters:
  • vae (REGVELOVI) – Trained REGVELOVI model with a v_encoder that supports GRN inference.

  • adata (AnnData) – Annotated data matrix containing cell-specific information and gene expression layers.

  • label (Optional[str]) – Column name in adata.obs specifying cell type or grouping labels.

  • group (Union[str, list[str], None]) –

    Groups of cells to analyze.

    • "all" or None: use all cells.

    • list of str: subset to these groups from adata.obs[label].

  • cell_specific_grn (bool) – If True, compute a cell-specific GRN using individual cell data.

  • data_frame (bool) – If True and cell_specific_grn is False, return the GRN as a pandas.DataFrame.

Return type:

ndarray | DataFrame

Returns:

: numpy.ndarray or pandas.DataFrame

The inferred GRN as an array or DataFrame. For cell-specific GRN, always returns an array.