SingleR-inc / SingleR

Clone of the Bioconductor repository for the SingleR package.
https://bioconductor.org/packages/devel/bioc/html/SingleR.html
GNU General Public License v3.0
172 stars 19 forks source link

BiocParallel errors #233

Closed antoine4ucsd closed 1 year ago

antoine4ucsd commented 1 year ago

Hello I am eager to try SingleR to identify cell subset from scRNAseq data. I followed this tutorial https://bioconductor.org/packages/devel/bioc/vignettes/SingleR/inst/doc/SingleR.html but I get an unusual error:

library(SingleR)
pred.hesc <- SingleR(test = hESCs, ref = hpca.se, assay.type.test=1,
    labels = hpca.se$label.main)

gives me:

Error: BiocParallel errors
  1 remote errors, element index: 1
  2 unevaluated and other errors
  first remote error:
Error: BiocParallel errors
  0 remote errors, element index: 
  25 unevaluated and other errors
  first remote error:

I am using a Mac (last gen)

thank you!

LTLA commented 1 year ago

Nothing obvious comes to mind. I just ran it on my own computer and it works fine. Make sure you're using the latest version of all packages (i.e., using BioC 3.16, no issues from BiocManager::valid()).

antoine4ucsd commented 1 year ago

thank you. I figured it may be a Mac issue . I have BioC 3.15 installed. I will update it I am attaching my session info if you can find anything else obvious

session info.txt

antoine4ucsd commented 1 year ago

Also if I may I am trying to identify human brain cells (microglia, astrocyte, neurons, dendritic cells, etc) that are also likely mixed with endothelial cells and probably T cells and some other immune cells. If I use the BlueprintEncodeData ref alone or combined with HumanPrimaryCellAtlasData, I mostly recover monocytes but NO microglial cells.... is there a better combined atlas to use for such samples? I also try clustifyr package and it find mostly microglial cells... Such different results are intriguing.

I just ran

antoine4ucsd commented 1 year ago

and great news. It finally worked after updating to BioC 3.16 and all related packages... I am still unsure why all cells are identified as mostly monocytes since they are predominiantly microglial cells. if you could advise on the best combined atlas to build, that would be great!

ref <- BlueprintEncodeData()
pred <- SingleR::SingleR(test=mydata, ref=ref, labels=ref$label.main)

resulting in:

   Adipocytes           B-cells      CD8+ T-cells                DC Endothelial cells      Erythrocytes       Fibroblasts 
                8                 8                 2               416                62                 9                 1 
              HSC       Macrophages         Monocytes       Neutrophils          NK cells 
                2               553              1068                 2                 4 
LTLA commented 1 year ago

Neither of those two references have "microglia", so it's not a surprise that they aren't found.

I don't have much experience with neuronal references, but you could probably make your own from the classic scRNAseq::ZeiselBrainData. You should be able to do something like:

zeisel <- scRNAseq::ZeiselBrainData()
zeisel <- scuttle::logNormCounts(zeisel)
ref <- aggregateReference(zeisel, zeisel$level1class) # or level2class

and then use that as a reference. Possibly you would want to throw in BlueprintEncode as another reference (see here), as the Zeisel dataset doesn't contain any coverage for immune types.

antoine4ucsd commented 1 year ago

I will give it a try and let you know how it works! Much appreciated.

antoine4ucsd commented 1 year ago

still not what I would expect. mostly pyramidal CA1 (?) I will keep looking for other sources but all advices are welcome.


astrocytes_ependymal    endothelial-mural            microglia        pyramidal CA1 
                  35                    5                   98                 1997 
LTLA commented 1 year ago

I'd suggest that you look into some of the diagnostics, e.g., here.

antoine4ucsd commented 1 year ago

on it thank you for being so responsive.

antoine4ucsd commented 1 year ago

It works well with a new combined ref DarmanisBrainData and HumanPrimaryCellAtlasData thank you again for your assistance.

Roner2022 commented 1 year ago

hello, I am eager to try SingleR to identify cell subset from scRNAseq data.

cellpred <- SingleR(test = testdata,
ref = refdata, labels = refdata$label.main, method = "cluster", clusters = clusters, assay.type.test = "logcounts", assay.type.ref = "logcounts") but I get an unusual error: Error: BiocParallel errors 1 remote errors, element index: 1 0 unevaluated and other errors first remote error: Error in .read_block_OLD(x, viewport, as.sparse = as.sparse): could not find function ".read_block_OLD"

window10

LTLA commented 1 year ago

Make a new issue, don't keep reviving old threads.