gretapy.mt.lit_grn#
- gretapy.mt.lit_grn(mdata, grn='CollecTRI', organism='hg38', min_targets=5, verbose=False)#
Generate a GRN from literature-based prior knowledge filtered by available peaks and genes.
This method accepts a reference GRN (CollecTRI, DoRothEA, or a custom DataFrame) and promoter annotations, then prunes the network based on the peaks and genes available in the input MuData object.
- Parameters:
mdata (
MuData) – MuData object with “rna” and “atac” modalities.grn (
str|DataFrame(default:'CollecTRI')) – Which GRN to use. Can be “CollecTRI”, “DoRothEA”, or a pandas DataFrame with columns: source, target, weight. Default is “CollecTRI”.organism (
str(default:'hg38')) – Which organism to use. Default is “hg38”.min_targets (
int(default:5)) – Minimum number of targets required for a TF to be included. Default is 5.verbose (
bool(default:False)) – Whether to print progress messages. Default is False.
- Return type:
- Returns:
pd.DataFrame GRN DataFrame with columns: source, cre, target, score. - source: Transcription factor name. - cre: Cis-regulatory element (peak) in format chrX-start-end. - target: Target gene name. - score: Edge weight from the reference GRN.
Examples
>>> import mudata as mu >>> import gretapy as gt >>> mdata = mu.read("my_multiome.h5mu") >>> grn = gt.mt.lit_grn(mdata, grn="CollecTRI", organism="hg38") >>> grn.head()