Code Monkey home page Code Monkey logo

Comments (6)

SUN-Changyu avatar SUN-Changyu commented on September 21, 2024 2

Hi, @CodeInTheSkies ,
I managed to use my own UMAP projection in SeuratWrapper by using the function CreateDimReducObject(). You would need to set a matrix to store your projection and then assign it to the seurat object in use.
Here is what I did to project the UMAP coordinates and this should be done before you run velocity.
load("SAMPLE_UMAP.Robj")
numap <- as.matrix(umap.data[,1:2])
rownames(numap) <- rownames(bm@reductions[["umap"]]@cell.embeddings[,1:2])
colnames(numap) <- paste0("UMAP_", 1:2)
bm@reductions[["numap"]] <- CreateDimReducObject(embeddings = numap, key = "UMAP_", assay = DefaultAssay(bm))

from seurat-wrappers.

CodeInTheSkies avatar CodeInTheSkies commented on September 21, 2024 1

Thank you very much, @SUN-Changyu , for your response, and the code. Appreciate it!

Just for your information, and also for any others who may be having the same question, I found this thread #9 and ended up using the suggestion therein, to manually add the "spliced", "unspliced", and the "ambiguous" assays one by one to my existing Seurat object containing my pre-calculated tSNE embeddings. After that, simply following the rest of the steps did the trick in my case to draw velocity arrows on my existing tSNE.

Particular reference to @mojaveazure 's and @CoderMatthias 's suggestions in #9.

Special kudos to the SeuratWrappers team (@mojaveazure , @satijalab )!!! Thanks to their efforts integrating RNA velocity into the Seurat framework, it has become much easier to run RNA velocity. Before that, it was a struggle, at least for me!

from seurat-wrappers.

mojaveazure avatar mojaveazure commented on September 21, 2024

Hi Changyu,

I'm confused about what you're trying to accomplish. For RunVelocity, you can specify a reduction to use with the reduction parameter for calculating the embedding distance matrix (see the docs for RunVelocity). We do not provide a wrapper for visualization. Instead, we use velocyto.R's show.velocity.on.embedding.cor function, for which you can simply pass the embeddings matrix of a dimensional reduction to use for visualization (see our vignette for more details).

from seurat-wrappers.

SUN-Changyu avatar SUN-Changyu commented on September 21, 2024

Hi, Paul,
I've already figured out how to do it! Thanks so much for the quick response.
What I wanted to do is to add a UMAP projections I generated earlier using Seurat to the Seurat object converted by SeuratWrappers from loom file. And to do so, I need to rename the column and row names of the embedding matrix and use CreateDimReducObject() to create a new reduction for the Seurat object. Problem solved. Thanks!

from seurat-wrappers.

CodeInTheSkies avatar CodeInTheSkies commented on September 21, 2024

Hi @SUN-Changyu ,

This is the exact problem I am facing now, and would appreciate some more clarification as to how you went about finding a solution!

So, if I do this first from the loom file,
ldat <- ReadVelocity(file="a.loom")
bm <- as.Seurat(x = ldat)

then my bm object would have three assays, namely, "spliced" "unspliced" and "ambiguous".

Now, if I have another Seurat V2 object, which has the TSNE embeddings from earlier, then I first do

new_pbmc=UpdateSeuratObject(object = pbmc)

I also then do some steps to make sure the cell names for both bm and new_pbmc exactly match.

Can you please let me know what exactly is needed after this step to plot velocity projections onto the old TSNE embeddings?

Thanks a lot for your response!

from seurat-wrappers.

sikh09 avatar sikh09 commented on September 21, 2024

Hi, I run the velocyto using Seurat successfully on my dropest martices. Now, I found there are many doublets in my single-cell data. I want to filter these cells and again run the velocyto to avoid the noise.
Initially I have dropest matrices with 4000 cells and I want to filter 2000 cells.

from seurat-wrappers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.