aertslab / SCopeLoomR

R package (compatible with SCope) to create generic .loom files and extend them with other data e.g.: SCENIC regulons, Seurat clusters and markers, ...
MIT License
38 stars 15 forks source link

add_embeddings error #36

Open Jay-Leung opened 2 years ago

Jay-Leung commented 2 years ago

Hi,

I am using Seurat for my single cell analysis and so exported the loom file with Seurat UMAP embeddings using loom <- build_loom("Data/loom/RHB251019P_RG_RL_ScopeRembed.loom", dgem=exprMat, default.embedding=umap_embeddings, default.embedding.name = "umap_embeddings") to run pyscenic CLI.

However, after I added the SCENIC tSNE and UMAP using add_visualization.py and imported the loom into R for downstream visualization (http://htmlpreview.github.io/?https://github.com/aertslab/SCENIC/blob/master/Tutorials_JupyterNotebooks/SCENIC_tutorial_2-ExploringOutput.html), I realized the Seurat UMAP embeddings (umap embeddings) got replaced by SCENIC UMAP embedding values:

embeddings

I then tried to add the Seurat UMAP embeddings back manually: add_embedding(loom = loom, embedding = seurat_embed, name = "Seurat_UMAP"), where the embedding was acquired through seurat_embed <- as.data.frame(Seurat::Embeddings(seuratobj, reduction = 'umap')) , but I got the following error:

[1] "Adding embedding Seurat_UMAP..." Error in if (ca_extra_embeddings_dims[1] != ca_extra_embeddings_dims[2]) { : missing value where TRUE/FALSE needed In addition: Warning messages: 1: In FUN(X[[i]], ...) : NAs introduced by coercion 2: In FUN(X[[i]], ...) : NAs introduced by coercion

I have checked that the dims of X and Y embeddings are equal. Could you help with this problem?

Thanks!

Regards, Jay