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

Importing regulons.csv into scanpy pipeline #135

Closed ltosti closed 4 years ago

ltosti commented 4 years ago

Hi @cflerin @bramvds @ghuls,

I generated a regulons.csv file as output of the CLI pyscenic ctx. What would be the easiest way to import this file into the scanpy pipeline as to use the regulons object into the function add_scenic_metadata(adata, auc_mtx, regulons)?

Thank you for your help!

cflerin commented 4 years ago

Hi @ltosti

You could use something like the following to add the regulon data to an anndata object:

from pyscenic.export import add_scenic_metadata
from pyscenic.cli.utils import load_signatures

sig = load_signatures('regulons.csv')
add_scenic_metadata(adata, auc_mtx, sig)