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

Do you have a tutorial for analysing the results of pySCENIC CLI in R? #180

Closed lucygarner closed 2 years ago

lucygarner commented 4 years ago

Hi,

Do you have a tutorial for analysing the results of pySCENIC CLI in R. I have generated a loom file and I am trying to follow the tutorial here (https://rawcdn.githack.com/aertslab/SCENIC/0a4c96ed8d930edd8868f07428090f9dae264705/inst/doc/importing_pySCENIC.html) but I think the results are in a slightly different format?

Best, Lucy

cflerin commented 4 years ago

Yes that's the right tutorial, for both loom and individual regulon/aucell files. What's the problem you're having?

KabitaBaral1 commented 4 years ago

Hi @cflerin I am having the same issue. I was able to import loom file to R using the following tutorial: (1) https://rawcdn.githack.com/aertslab/SCENIC/0a4c96ed8d930edd8868f07428090f9dae264705/inst/doc/importing_pySCENIC.html

But, when I try to analyze the data/ visualize the results, I found only one tutorial: (2) https://rawcdn.githack.com/aertslab/SCENIC/0a4c96ed8d930edd8868f07428090f9dae264705/inst/doc/SCENIC_Running.html#export_to_loomscope

However, I think the main issue is that when we import result from CLI/pySCENIC using the above link (1), we don't have any object called "scenicOptions". I think thats the main hindrance to using the workflow (2). So, the question is, how do we handle this situation and analyze the results solely from loom file and tsv, csv files for motif, AUC?

I have been stuck at this stage and struggling with it for so long. Any help is appreciated greatly. Many thanks

lucygarner commented 4 years ago

I wasn't able to generate the nice motif enrichment analysis table with the results from the CLI?

cflerin commented 4 years ago

@KabitaBaral1 , @lc822 , thanks for letting us know about the issues you're having, I'll take a look and see if there's anything that needs to be updated for the R tutorial

s-aibar commented 4 years ago

Indeed, the tutorial and the SCopeLoomR packages needed to be updated to match the new version of pySCENIC.

Please, update SCopeLoomR and then these commands should work (we are still updating the tutorial):

library(SCopeLoomR)
loom <- open_loom(pyScenicLoomFile, mode="r")

# Regulons:
regulons_incidMat <- get_regulons(loom) # as incid matrix
regulons_motif <- regulonsToGeneLists(regulons_incidMat) # convert to list

regulons_ChIP <- regulonsToGeneLists(get_regulons(loom, attrName = "TrackRegulons"))

# Regulon AUC and thresholds
regulonsAUC <- get_regulonsAuc(loom)
regulonsAucThresholds <- get_regulonThresholds(loom)

# Embeddings (tsne/umap)
embeddings <- get_embeddings(loom)
close_loom(loom)

Once you have those, you don't need to create the "scenicOptions" object. You can just directly use RcisTarget/AUCell (or perform any further analysis you need...).

The motif table/information is stored as a separate table, it is not in the loom file.

morganee261 commented 4 years ago

Hello,

After running the CLI, is there a tutorial to convert it in a loom file? here is what I have tried : sudo docker run -it --rm -v /home/Morgane/mapping/int/wsscenic -w /home/Morgane/mapping/int/wsscenic aertslab/pyscenic:0.10.3 python add_visualization.py --loom_input auc_mtx.loom --loom_output scenic_visualize.loom --num_workers 8

and it is not working. is there a tutorial for handling the output of the CLI? I have 3 files auc_mtx.csv regulons.csv expr_mat.adjacencies.tsv

Could you please indicate how to import that into R to run the rest of the SCENIC analysis?

thank you,

Morgane

Edit:

I successfully exported the results in a loom file but when importing in R I am missing some files to runSCENIC1/2/3. @s-aibar and @cflerin would you be able to help with that? thanks again

Morgane

JingleW commented 3 years ago

Hello, I have the same request of using the output of pySCENIC to do further analyses in R. For example, how can I get a UMAP of cells clustered by Seurat in R for the AUC of the estimated regulon activities obtained by pySCENIC? Thanks.

Ashone1992 commented 2 years ago

I have a similar problem. I performed this analysis by pyscenic with a loom file. The loom file was converted from an rds file in Seurat. I got the output loom file, however, this file did not contain any embeddings information. So I could not do any analysis which need the reduction information.

SeppeDeWinter commented 2 years ago

@Ashone1992

As this is a question related to downstream analysis and not an issue with the code could you please post your question in our discussion forum: https://github.com/aertslab/SCENIC/discussions.

Thanks,

Seppe