Comments (5)
Hey @kasumaz ,
It looks like something you're running is trying to convert the data into counts (hence round
). Guessing from the name nsc_sce
, that's the SingleCellExperiment
object? The round
function doesn't know how to handle that type of object, which I think is what's causing this error.
At this point in your analysis, is it important to keep a version of the data as counts? It might be easier to pull out the matrix of PCA/tSNE results and vector of cluster labels and run slingshot
(or getLineages
) directly on those. Otherwise, you could try rounding each element of the list in the assays
slot, via something like:
assays(nsc_sce) <- lapply(assays(nsc_sce), round)
Hope that helps! Let me know if it doesn't work.
from slingshot.
Hi,
Thanks for replying back to me.
I could get back to slingshot. Would it be easier if I send you a subset matrix csv file of genes in rows and cells in columns as unnormalised data? Maybe in this way when you open slingshot in future in R, you can load it in and send me the start script and I can take it from there. It is always the input format i find tricky and thereafter I am usually okay. Just to maybe save us time going back and forth. I will do as you suggested and look around in the pdf/vignette files and I will let you know if I did achieve to run it so you dont loose time.
Thanks, Kaz
from slingshot.
Hey @kasumaz ,
If you are having trouble reading the data into R or making a SingleCellExperiment
object, you may find this issue helpful: #33 . Otherwise, if you have a counts matrix in csv format already, you can read it in to R as a matrix and set up a SingleCellExperiment
object via:
counts <- read.csv("counts.csv")
sce <- SingleCellExperiment(assays=list(counts=counts))
from slingshot.
Hi,
I wanted to try to do this myself and solve it. Some I could get going. But I think I have to resort back to help and make you loose time. Sorry.
It would be great if I could have the beginning of the script you used to test it out and I should be okay firing away with it.
That start of the script is:
sce <- SingleCellExperiment(assays=list(counts=counts))
sce <- SingleCellExperiment(assay=list(counts=as.matrix(counts))) #i think this way worked better
estimate simulation parameters
params <- splatEstimate(sce)
set path-related parameters
params <- setParams(params, update = list(batchCells = 200,
path.nonlinearProb = .5,
de.prob = .6, de.facLoc = 1,
de.facScale = 2))
library(splatter, quietly = TRUE)
data("splatterParameters")
library(slingshot, quietly = FALSE)
data("slingshotExample")
dim(rd) # data representing cells in a reduced dimensional space
length(cl) # vector of cluster labels
----genefilt--------------------------------------------------------------
filter genes down to potential cell-type markers
at least M (15) reads in at least N (15) cells
geneFilter <- apply(assays(sce)$counts,1,function(x){
sum(x >= 15) >= 15
})
sim <- sce[geneFilter, ]
FQnorm <- function(counts){
rk <- apply(counts,2,rank,ties.method='min')
counts.sort <- apply(counts,2,sort)
refdist <- apply(counts.sort,1,median)
norm <- apply(rk,2,function(r){ refdist[r] })
rownames(norm) <- rownames(counts)
return(norm)
}
assays(sim)$norm <- FQnorm(assays(sim)$counts)
----pca, cache=TRUE-------------------------------------------------------
pca <- prcomp(t(log1p(assays(sim)$norm)), scale. = FALSE)
rd1 <- pca$x[,1:2]
plot(rd1, col = topo.colors(100)[sim$Step], pch=16, asp = 1)
----dm, cache=TRUE--------------------------------------------------------
library(destiny, quietly = TRUE)
dm <- DiffusionMap(t(log1p(assays(sim)$norm)))
rd2 <- cbind(DC1 = dm$DC1, DC2 = dm$DC2)
plot(rd2, col = topo.colors(100)[sim$Step], pch=16, asp = 1)
This last bit for diffusion map doesnt work. Some of the other parts in the original tutorial script seem to work but probably would work better if the data is set up correctly.
I have 7 different cell types
OLqNSCI
OLqNSCII
OLpNSC
OLaNSC
OLTAP
OPC
MOL (final cell type)
I have them as for example MOL_1, MOL_2, MOL_3, MOL_4, etc for all of them. I think this has to be specified somewhere. Maybe the set up of the sce object.
I attach the csv here.
I will figure it out and having it up and running.
Thank you so very much!
from slingshot.
Hey @kasumaz ,
I'm sorry, but I don't understand what you're trying to do here. Originally you said you were having issues getting your data into a SingleCellExperiment
object, but now you seem to be trying to create a simulated dataset?
If you want to include cell type labels (or any other sample-level data), you can format it as a data.frame
and include it as colData
:
sce <- SingleCellExperiment(assays=list(counts=counts), colData=cell_type)
I'm closing this issue, since this does not seem to be related to any slingshot
functionality.
from slingshot.
Related Issues (20)
- Warning messages useNames = NA is deprecated when running the slingshot HOT 13
- Error in h(simpleError(msg, call)) HOT 2
- Predicting cells belonging to two lineages constructed using two subsetted objects HOT 5
- Error in brewer_pal("qual", "Set2") HOT 2
- is it possible to set multiple start clusters in slingshot HOT 1
- How to use times parameter to inform about real time while not using clusterLabels HOT 2
- unexpected behaviour when specifying the start cluster HOT 2
- How Slingshot work on 90000 number of nuclei? HOT 6
- Is there any way that I could fit the NB-GAM for all the gene in my large dataset? HOT 1
- getCurves() Missing values HOT 8
- Curves and lineages HOT 3
- Error in igraph::shortest_paths(tree, from = l, to = ends, mode = "out", : At core/paths/dijkstra.c:360 : Weight vector must not contain NaN values, Invalid value HOT 3
- Average curve weights and Pseudotime HOT 1
- slingshot analysis on PCA but visualization on UMAP HOT 3
- how to analyze with 3 different treatments HOT 4
- how to calclate the POS to compare other algorithm? HOT 2
- Pulling and plotting Differential pseudotime data across different conditions/metadata slots HOT 1
- `embedCurves` should also map MST into new space HOT 1
- Slingshot followed by CellRank HOT 1
- is slingshot using only the variable genes? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slingshot.