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

Adding SCENIC AUC matrix is not working #39

Open
saeedfc opened this issue Jan 5, 2023 · 0 comments
Open

Adding SCENIC AUC matrix is not working #39

saeedfc opened this issue Jan 5, 2023 · 0 comments

Comments

@saeedfc
Copy link

saeedfc commented Jan 5, 2023

Hi,
Thanks you for Scope and ScopeLoomR.
I tried the following code to add the AUC_Matrix. The loom file works, but I cannot visualize any regulon activity in scope.

library(Seurat)
library(SCopeLoomR)
exp_mtx <- GetAssayData(obj, assay = "RNA", slot = "data")
exp_mtx <- as.matrix(exp_mtx)
## Read in the auc matrix obtained ferom pySCENIC pipeline
scenic_mtx <- read.csv(paste0("../REGA_Lungs/output/", auc_files[1]), row.names = 1)
## Remove the appended '...' character at the end of regulon names
colnames(scenic_mtx) <- gsub(pattern = "\\.\\.\\.$", replacement = "", colnames(scenic_mtx))
## Prepend "TF_" to regulon names
colnames(scenic_mtx)  <- paste0("TF_", colnames(scenic_mtx) )


build_loom(
  file.name=file.name,
  dgem=exp_mtx,
  title=obj_name[i], # A namr for your data
  genome="Mouse", # Just for user information, not used internally
  default.embedding=umap_mtx,
  default.embedding.name="Seurat_UMAP"
)


loom <- open_loom(file.name, mode = 'r+')

add_regulons_AUC(
    loom,
    t(scenic_mtx),
    column.attr.name="MotifRegulonsAUC") 

close_loom(loom= loom)

instead add_regulon_AUC, I also tried the function add_scenic_regulons_auc_matrix(loom=loom, regulons.AUC = t(scenic_mtx))

t(scenic_mtx) is a matrix with same cells as columns and regulons(TFs) as rows.
Code runs without any error. I can open the file in Scope. I can see the gene expression. But when I type transcription factor names, I cannot see anything other than genes ( I mean cannot see regulons). As you might notice, the regulons all start with "TF_", so in theory when i try to type "TF.." in the field in scope, it should pop down with regulon names. Also, I cannot see anything if I go to the 'regulon' tab on scope.

I also tried without adding "TF_" in auc matrix regulon names. In such cases, If I type a transcription factor name, I should in theory see the gene in 'gene' category and 'regulon' category.

I cannot figure out, what could be going wrong.

Is there an alternative to add AUC matrix as an additional assay (I tried with add_matrix function. But didn't work)?

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

No branches or pull requests

1 participant