aertslab / pySCENIC

pySCENIC is a lightning-fast python implementation of the SCENIC pipeline (Single-Cell rEgulatory Network Inference and Clustering) which enables biologists to infer transcription factors, gene regulatory networks and cell types from single-cell RNA-seq data.
http://scenic.aertslab.org
GNU General Public License v3.0
420 stars 179 forks source link

regulon dict #257

Closed rojinsafavi closed 3 years ago

rojinsafavi commented 3 years ago

creating a dictionary of regulons:

regulons = {} for i,r in pd.DataFrame(lf.ra.Regulons,index=lf.ra.Gene).iteritems(): regulons[i] = list(r[r==1].index.values)

Could you please specify how this regulons dict should look like? I am trying to build it from the regulon file produced by pyscenic.

Screen Shot 2021-02-10 at 8 09 29 AM

I assume that it's a dict with TFs as keys, and targets as a list, but wanted to make sure :-)

cflerin commented 3 years ago

The particular table from the screenshot you attached was generated by:

from pyscenic.utils import load_motifs

df_motifs = load_motifs('reg.csv')

The regulons dictionary from your code snippet is indeed in the format of TF: [target gene 1, target gene 2, ...]