dgrun / stemid Goto Github PK
View Code? Open in Web Editor NEWAlgorithm for the inference of cell types and lineage trees from single-cell RNA-seq data.
Algorithm for the inference of cell types and lineage trees from single-cell RNA-seq data.
I can't run Ltree if I don't run the function filterdata. Is there any way to sort this issue? All I wish to do is calculate the cell entropy. Thanks.
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!
Hi,
I am trying to apply the RaceID/StemID pipeline to my scRNA seq dataset, however, even though I am setting the number of clusters to a specific number with this line sc <- clustexp(sc,cln=10,sat=FALSE), I systematically end up with a higher number of clusters at the end.
How can I manage this ?
Also, I am initially working with a Seurat object, ultimately, I would like to extract the barcodes that show the highest score in StemID and see to which cluster it matches in my Seurat Object.
With "combined" beeing my Seurat object, here is the script used :
`combined_counts <- as.matrix(GetAssayData(combined, slot = "counts"))
combined_meta <- [email protected]
n<-colnames(combined_counts)
b<-list(n[grep("^CON89",n)],n[grep("^CON90",n)])
sc <- SCseq(combined_counts)
sc <- filterdata(sc, LBatch=b, bmode="RaceID",mintotal = 1000) # Adjust 'mintotal' based on your data
sc <- compdist(sc, metric = "pearson")
sc <- clustexp(sc)
sc <- clustexp(sc,cln=10,sat=FALSE)
sc <- findoutliers(sc)
plotbackground(sc)
plotsensitivity(sc)
plotoutlierprobs(sc)
clustheatmap(sc)
sc <- comptsne(sc)
sc <- compumap(sc)
saveRDS(sc, file="sc_object_final_before_StemID.rds")
stem <- Ltree(sc)
stem <- compentropy(stem)
stem <- projcells(stem, cthr = 5, nmode = FALSE)
stem <- projback(stem, pdishuf = 100)
stem <- lineagegraph(stem)
stem <- comppvalue(stem, pthr = 0.05)
stemID_scores<- compscore(stem)
There are two instances where sc is used instead of object@sc in projcells
line 889: pdil <- sc@tsne[f,]
line 894: cn <- as.data.frame(pdi[compmedoids(sc@fdata[,names(lp)],lp),])
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.
Unfortunately I meet the following error when I perform the comppvalue step.
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'
Here is all the code I am running:
# Create the sc object
seurat_integrated <- readRDS("file.rds")
ndata <- seurat_integrated@assays$RNA@counts[,]
sc <- SCseq(ndata)
# Filter for this
sc <- filterdata(sc, mintotal = 2000)
# Re-initialize raceID
part <- as.numeric([email protected]$seurat_clusters)
d <- as.matrix(dist(seurat_integrated@[email protected]))
umap <- as.data.frame(seurat_integrated@[email protected])
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([email protected]$seurat_clusters)))
names(col_cluster) <- as.character(unique([email protected]$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
Hi, thank you for developing StemID! I tried to run StemID on my seurat object following the closed issues. However, it errors when I run the code:
ltr <- projcells(
object = ltr,
cthr=5
)
Error in `.rowNamesDF<-`(x, value = value) : invalid 'row.names' length
I will appreciate a lot if you help me! Thank you very much!
Hi, apologies if this might be a naive mistake I'm running into, however, when I run the command projcells(ltr)
I get the error
Error in .local(x, ...) : arguments must have same length
This occurs with the sample data, as well as my own dataset.
Traceback shows:
6.
stop("arguments must have same length")
5.
.local(x, ...)
4.
aggregate(pdil, by = list(lp), median)
3.
aggregate(pdil, by = list(lp), median) at RaceID2_StemID_class.R#890
2.
projcells(ltr) at RaceID2_StemID_class.R#868
1.
projcells(ltr)
Traceback highlights:
nrx <- NROW(x)
if (any(lengths(by) != nrx))
**stop("arguments must have same length")**
y <- as.data.frame(by, stringsAsFactors = FALSE)
keep <- complete.cases(by)
y <- y[keep, , drop = FALSE]
x <- x[keep, , drop = FALSE]
To be completely honest, I have no idea what this means, being a novice at R and programming in general. Please let me know if I can provide any additional information.
My software versions:
RStudio Version 1.0.136
R version 3.3.2 (2016-10-31)
64bit Win10
Any insight into why this is failing at the beginning of StemID would be much appreciated.
Thanks!
Hi I'm new to RaceID2/StemID
and have a question if I can add additional cell identifier to SCseq object.
such as sample IDs and replicate IDs. are there anyways to store meta.data of the object?
Thank you in advance!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.