Closed shangguandong1996 closed 2 years ago
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
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.
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)
}
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).
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"……
Hi, dear developer
My cluster result is like below
I run the below code
and it did produce four lineage
But the weried thing is the
Curve2
. As you can see, the other 3 lineage pseudo time end is the end.clus, but thecurve 2
pseudo time end is not in the cluster 4, it is in the cluster 6 and 3. I am wondering whether you can give me some advice :)Best wishes
Guandong Shang