Git Product home page Git Product logo

Comments (4)

kstreet13 avatar kstreet13 commented on July 29, 2024

Hi @shangguandong1996,

It might be a little easier to diagnose this issue if you showed a plot with the curves produced by Slingshot. But just from looking at this, I would say that cluster 4 appears to be fairly centrally located and well connected, so I can see why it would be difficult. If you really believe that cluster 4 should be an endpoint, you may want to use a higher dimensional embedding (eg. 10 PCs or 3D UMAP), as it can be hard to fully characterize 4 lineages in just two dimensions.

Best,
Kelly

from slingshot.

shangguandong1996 avatar shangguandong1996 commented on July 29, 2024

Thanks for your help, Kelly :)

I try to choose less variable gene in fastMNN intergate, and I get a little better result for me. (I am sorry the cluster number is not same as above, which may confuse you). And I am very sorry I can not reproduce same result as above.

You can see cluster 2(which is same as cluster 4 above) is less linked to other clusters but it still mixed some clusters.

image
image
image
image
image

And I am confused by the

a higher dimensional embedding (eg. 10 PCs or 3D UMAP), as it can be hard to fully characterize 4 lineages in just two dimensions.

Here is my whole code, I use fastMNN in batchelor to intergate data, and the then use the corrected value to calcluate slingshot.

dec.sce <- modelGeneVar(mergeCell, block = mergeCell$batch)
mergeCell <- multiBatchNorm(mergeCell,batch = mergeCell$batch)

chosen.hvgs <- rownames(dec.sce)[dec.sce$bio > 0]
chosen.hvgs <- chosen.hvgs[!chosen.hvgs %in% protoplast_genes]

set.seed(20160806)
mnn.out <- fastMNN(mergeCell,
                   batch = mergeCell$batch,
                   merge.order = c("CIM0d", "CIM1d", "CIM3d", "CIM7d"),
                   subset.row = chosen.hvgs,
                   BSPARAM=BiocSingular::RandomParam())


set.seed(20160806)
mnn.out <- runUMAP(mnn.out, 
                   dimred="corrected", 
                   n_neighbors = 15)


clusters.mnn.50 <- clusterCells(mnn.out, 
                                use.dimred="corrected", 
                                BLUSPARAM=NNGraphParam(k = 50,
                                                       cluster.fun="louvain",
                                                       type="jaccard"))

colLabels(mnn.out) <- clusters.mnn.50
mnn_slingshot <- mnn.out
reducedDim(mnn_slingshot, "corrected") <- reducedDim(mnn_slingshot, "corrected")[, 1:49]
sce.sling <- slingshot(mnn_slingshot,
                       reducedDim='corrected',
                       cluster = colLabels(mnn.out),
                       start.clus = "1",
                       end.clus = c("7", "2", "8", "10"))



embedded <- slingCurves(embedCurves(sce.sling, "UMAP"))

gg <- plotUMAP(sce.sling,text_by = "label", 
               colour_by = "label", point_size = 0.5)
for (path in embedded) {
    embedded <- data.frame(path$s[path$ord,])
    gg <- gg + geom_path(data=embedded, aes(x=Dim.1, y=Dim.2), size=1.2)
}

from slingshot.

kstreet13 avatar kstreet13 commented on July 29, 2024

Oh ok, I think that's a very good pipeline, then (using MNN and running Slingshot on the corrected coordinates). I thought you might be running Slingshot on the UMAP coordinates, which wouldn't be as appropriate. But using UMAP for visualization is fine.

Also, just to make sure, you said that you used the "less variable gene[s]", but your code uses hvg, which is a common abbreviation for "highly variable genes". Generally speaking, you probably want the highly variable genes, not the less variable genes (which will be mostly zeros).

from slingshot.

shangguandong1996 avatar shangguandong1996 commented on July 29, 2024

Oh ok, I think that's a very good pipeline, then (using MNN and running Slingshot on the corrected coordinates). I thought you might be running Slingshot on the UMAP coordinates, which wouldn't be as appropriate. But using UMAP for visualization is fine.

Also, just to make sure, you said that you used the "less variable gene[s]", but your code uses hvg, which is a common abbreviation for "highly variable genes". Generally speaking, you probably want the highly variable genes, not the less variable genes (which will be mostly zeros).

sorry, it is my mistake. I should say I use "fewer hvg"……

from slingshot.

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.