Closed Dragonmasterx87 closed 4 years ago
Hi,
please run the following code on your data in order to apply StemID on Seurat output:
per cell) -> sc object
part <- as.numeric(se@meta.data$seurat_clusters) d <- as.matrix( dist(se@reductions$pca@cell.embeddings) ) tsne <- as.data.frame(se@reductions$tsne@cell.embeddings) names(part) <- colnames(d)
n <- colnames(sc@ndata) part <- part[n]
sc@cpart <- sc@cluster$kpart <- part
sc@distances <- d[n,n]
sc@tsne <- tsne[n,]
sc@counts <- sc@counts * 0 + 1 sc@ndata <- ndata[,n]
sc@medoids <- compmedoids(sc, sc@cpart)
set.seed(12345) sc@fcol <- sample(rainbow(max(sc@cpart)))
parameters…
Good luck! Dominic
On Fri, Oct 11, 2019 at 7:44 PM Fahd Qadir notifications@github.com wrote:
Hello!
Thank you for the wonderful software. I have a question, is it possible to run STEMID calculations for a Seurat object? I would like to calculate STEMID scores of clusters of cells that have been already calculated and projected using UMAP.
Thank you!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dgrun/StemID/issues/3?email_source=notifications&email_token=ACVD55DGIFDY5D7M4R7JGYLQOC3O3A5CNFSM4I74RNVKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HRITKVA, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACVD55E34ANELDE2GYUMAS3QOC3O3ANCNFSM4I74RNVA .
Cheers thanks alot Dominic!
Dear all,
I am trying to run StemID on my Seurat object on which I have done both the QC needed and the clustering analysis. I am following both the answer here and the tutorial here: https://cran.r-project.org/web/packages/RaceID/vignettes/RaceID.html.
Unfortunately I meet the following error:
Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), :
'data' must be of a vector type, was 'NULL'
when I perform the comppvalue step.
Here is all the code I am running:
# Create the sc object
ndata <- seurat_integrated@assays$SCT@counts[,]
sc <- SCseq(ndata)
# Filter for this
sc <- filterdata(sc, mintotal = 2000)
# Re-initialize raceID
part <- as.numeric(seurat_integrated@meta.data$seurat_clusters)
d <- as.matrix(dist(seurat_integrated@reductions$pca@cell.embeddings))
umap <- as.data.frame(seurat_integrated@reductions$UMAP@cell.embeddings)
names(part) <- colnames(d)
n <- colnames(sc@ndata)
part <- part[n]
# partition
sc@cpart <- sc@cluster$kpart <- part
# distances
sc@distances <- d[n,n]
# umap
sc@umap <- umap[n,]
# expression data (optional)
sc@counts <- sc@counts * 0 + 1
sc@ndata <- ndata[,n]
# cluster medoids
sc@medoids <- compmedoids(sc, sc@cpart)
col_cluster <- colorRampPalette(brewer.pal(12,"Set3"))(length(unique(seurat_integrated@meta.data$seurat_clusters)))
names(col_cluster) <- as.character(unique(seurat_integrated@meta.data$seurat_clusters))
set.seed(12345)
sc@fcol <- col_cluster[order(as.numeric(names(col_cluster)))]
# Run StemID
ltr <- Ltree(sc)
ltr <- compentropy(ltr)
ltr <- projcells(ltr,cthr=5,nmode=TRUE,fr=TRUE, um=T, knn=3)
ltr <- lineagegraph(ltr)
ltr <- comppvalue(ltr,pthr=0.05)
# Here I get the error
plotgraph(ltr,showCells=FALSE,showMap=TRUE)
x <- compscore(ltr)
Can anyone help me on this? I really thank you in advance for this, Have a great day, Alessandro
Dear all, Hi. I want to use stemID for my seurat object and I followed the workflow the @dgrun mentioned. Thanks for your explanation. I faced an error while running :
ltr <- comppvalue(ltr,pthr=0.05) Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 't': 'n' must be a positive integer >= 'x'
My seurat object contain about 5200 cells.
Please send sample data with code to reproduce the error and I can try to help.
Hello!
Thank you for the wonderful software. I have a question, is it possible to run STEMID calculations for a Seurat object? I would like to calculate STEMID scores of clusters of cells that have been already calculated and projected using UMAP.
Thank you!