Open phoebee-h opened 5 years ago
Thanks!
Deployed it. Download the files here, install all the required libraries and run the app (shiny::runApp('~/SingleRbrowseR-standalone'), or where ever you put the directory).
library(shiny) library(SingleR) library(dendextend) library(Matrix) library(canvasXpress) library(corrplot) library(ggplot2) library(matrixStats) library(plyr) library(reshape) library(dplyr) library(htmlwidgets) library(pheatmap) library(Seurat)
Hey Dvir, It goes well on my computer (Left plot)! Thanks a lot! By the way, I would like to ask you if I understand SingleR correctly:
Thank you again, for such a quick reply and supporting solution.
Great!
Yes.
Yes, all 4 are included (2 for mouse, 2 for human). You can change singler$singler[[1]] to 2 and you will see here the blueprint/encode based analysis.
Hey Dvir,
According to initial question, I think the problem might cause by "object of type 'closure' is not subsettable". This is the only plot that doesn't show up, but I couldn't figure out which part of the singler.new
is wrong. Do you have any idea? What argument of "SingleR-class"
may raise this error?
found the issue and fixed it. Download again app.R and helpers.R.
I am sorry to bother you, but here's another error...
That seems like a problem with your data for some reason. Can you look at the rownames of singler.new@xy and rownames of singler.new@scores[[1]]? they should be the same, if not something weird is happening.
Hey Dvir,
Ok, the last problem has been solved and no problems to the RDS file, which I can eventually run both locally or upload to your website! Thank you.
Indeed, the row names are different and it was caused by my manually edited (and of course, this is just a toy data). Because I found the "Proportions" plot was grouped by the "orig.ident", but my data are from a single experiment library, which is only annotated as "pbmc3k". Thus, I manually changed them as code described below; otherwise, the "Proportions" plot may raiseError: 'names' attribute [3] must be the same length as the vector[1]
levels(pbmc_standard[['orig.ident']]$orig.ident) <- c(levels(pbmc_standard[['orig.ident']]$orig.ident), "pbmc4k")
pbmc_standard[['orig.ident']]$orig.ident[1:250] <- 'pbmc4k'
colnames(pbmc_standard[['RNA']]@counts)[1:250] <- paste0(colnames(pbmc_standard[['RNA']]@counts)[1:250],'-1')
colnames(pbmc_standard[['RNA']]@counts)[251:521] <- paste0(colnames(pbmc_standard[['RNA']]@counts)[251:521],'-2')
Thanks again. Your friendly reply and kindness are very supportive for a newbie in single-cell RNA sequencing. We may close this session. :)
Hey, thanks for developing such a great annotation tool! I've followed the instruction as described on your website, as well as the S4 object transformation. All work fine except that some warnings pop up like this, but which I don't think affect much about my result (maybe?)
My code:
singler = CreateSinglerObject(pbmc_standard[['RNA']]@counts, annot = NULL, 'pbmc_standard', min.genes = 0, technology = "10X", species = "Human", citation = "", ref.list = list(), normalize.gene.length = F, variable.genes = "de", fine.tune = T, do.signatures = T, clusters = pbmc_standard@active.ident, do.main.types = T, reduce.file.size = T, numCores = SingleR.numCores)
singler$meta.data$xy = pbmc_standard@reductions$tsne@cell.embeddings
singler$meta.data$clusters = pbmc_standard@active.ident
singler.new = convertSingleR2Browser(singler)
singler.new@expr <- pbmc_standard[['RNA']]@data
saveRDS(singler.new,file=paste0(singler.new@project.name,'.rds'))
My questions:
Am I wrong if I use the
"pbmc_standard[['RNA']]@counts"
directly from the previous Seurat object? (=> but it does generate the SingleR object?)What is necessary in the rds file to upload? The slots such as singler.new@xy, singler.new@labels... are well stored in the file, what else should I check?