Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seurat object for StemID score evaluation #3

Closed
Dragonmasterx87 opened this issue Oct 11, 2019 · 5 comments
Closed

Seurat object for StemID score evaluation #3

Dragonmasterx87 opened this issue Oct 11, 2019 · 5 comments

Comments

@Dragonmasterx87
Copy link

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!

@dgrun
Copy link
Owner

dgrun commented Oct 14, 2019 via email

@Dragonmasterx87
Copy link
Author

Cheers thanks alot Dominic!

@raveancic
Copy link

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

@Fatemeh99m
Copy link

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.

@dgrun
Copy link
Owner

dgrun commented May 31, 2024

Please send sample data with code to reproduce the error and I can try to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants