Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compare result from pyscenic and scenic #207

Open
RuiqinZheng opened this issue Sep 2, 2020 · 6 comments
Open

compare result from pyscenic and scenic #207

RuiqinZheng opened this issue Sep 2, 2020 · 6 comments
Labels
results Question about pySCENIC results

Comments

@RuiqinZheng
Copy link

Thanks for your software!

I found that the final result of pyscenic is not the same as the result of scenic. In the result of scenci, the activity of each transcription factor is either 1 or 0; in the result of pyscenic, the activity of each transcription factor is between 0 and 1,I check the official website of pyscenic , and I didn’t see how to use the threshold to make the result form consistent with scenic. So do you have some suggest?

waiting for your reply.

Ruiqin Zheng

@RuiqinZheng RuiqinZheng added the results Question about pySCENIC results label Sep 2, 2020
@RuiqinZheng RuiqinZheng changed the title [results] compare result from pyscenic and scenic Sep 2, 2020
@cflerin
Copy link
Contributor

cflerin commented Sep 2, 2020

I'm not totally clear on what you mean, can you show the outputs of some regulons to show what is different?

@RuiqinZheng
Copy link
Author

RuiqinZheng commented Sep 2, 2020 via email

@RuiqinZheng
Copy link
Author

regulonAUC_from_pyscenic
AUC for 382 regulons (rows) and 5000 cells (columns).

Top-left corner of the AUC matrix:
cells
regulons Patient3_PB_3W_UCBT_AAAGATGAGTAGTGCG-1
ALX3(12g) 0.00000000
ARID5B(64g) 0.02108838
ARNT(9g) 0.04152348
ASAP3(12g) 0.00000000
ASCL1(15g) 0.00000000
ASCL2(67g) 0.04375032
cells
regulons Patient3_PB_3W_UCBT_AAAGTAGCACCACGTG-1
ALX3(12g) 0.00000000
ARID5B(64g) 0.01220200
ARNT(9g) 0.04686903
ASAP3(12g) 0.01260023
ASCL1(15g) 0.00000000
ASCL2(67g) 0.01024517

Regulon_from_R

                   AGGGATGAGGGTTTCT-1-D20171109_A

ARNT2_extended (18g) 0
ARNTL (11g) 0
ATF2 (88g) 0
ATF2_extended (237g) 0

                   BC02_LYMPHNODE3_130607234345371

ARNT2_extended (18g) 0
ARNTL (11g) 0
ATF2 (88g) 1
ATF2_extended (237g) 0

@cnrooter
Copy link

cnrooter commented Sep 7, 2020

The results from R pipeline were binarized, so the values of regulon activity matrix were 0 or 1. The regulon activity results, which were not binarized, stored in the 3.4_regulonAUC.Rds object in the scenic intermediate directory(int).

@saeedfc
Copy link

saeedfc commented Sep 21, 2020

Hi,

indeed, you have to binarize your auc matrix for automatic thresholding.
You may try

from pyscenic.binarization import binarize
binarized = binarize(auc_mtx, num_workers = 22)
binarized.to_csv("binarized_mtx.csv")

@RuiqinZheng
Copy link
Author

RuiqinZheng commented Sep 21, 2020

Thanks for your reply!
According to COMMAND LINE result, I found another way to binarize auc matrix in R:
Command Line:

pyscenic pyscenic aucell \
      myeloid10k_filtered_scenic.loom  \
       regulons.csv \
       -o pyscenic_output.csv \
       --num_workers 6\
      --seed 1

udocker run -u $USER -w $PWD -v /public/home:/public/home -v $PWD:$PWD pyscenic pyscenic aucell \
      myeloid10k_filtered_scenic.loom  \
       regulons.csv \
       -o pyscenic_output.loom\
       --num_workers 6\
      --seed 1

R:

regulonsAuc<-read.csv("pyscenic_output_genecount.csv",sep=",", header=T,check.names=F)
regulonsAuc_2<-regulonsAuc[,-1]
rownames(regulonsAuc_2)<-regulonsAuc[,1]
regulonsAuc_t<-t(as.matrix(regulonsAuc_2))

library(SCENIC)
library(SCopeLoomR)
pyScenicLoomFile <- file.path(pyScenicDir, "pyscenic_output.loom")
loom <- open_loom(pyScenicLoomFile, mode="r")
regulonsAucThresholds <- get_regulonThresholds(loom)
regulons_binaryAUC<-ifelse(regulonsAuc_t>regulonsAucThresholds ,1,0)
saveRDS(regulons_binaryAUC, "regulons_binaryAUC.rds")

Does it correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
results Question about pySCENIC results
Projects
None yet
Development

No branches or pull requests

4 participants