STOmics / Stereopy

A toolkit of spatial transcriptomic analysis.
MIT License
184 stars 64 forks source link

SingleR HPCA reference dataset - rda2h5ad.R throwing error #190

Closed GokceOGUZ closed 8 months ago

GokceOGUZ commented 11 months ago

Hi,

I am using the v14.0b1 to run the SingleR.

I would like to use the HPCA as the reference dataset. I downloaded the RDA format from the singleR website and tried to convert using the docs/source/_static/rda2h5ad.R as suggested on the tutorial page. But it failed because the R code assumes the object is Summerized Experiment where singleR provides list. So:

  1. Is there an alternate code to convert SingleR references to h5ad?
  2. Is there another database where I can download the SingleR references as Rdata or h5ad format ?

Regards, Gokce

image image

GokceOGUZ commented 11 months ago

Also I downloaded the _l5all.h5ad reference data, tried to read in but getting the error below: image

I have updated my anndata to 0.8 version but still the error persists. I will be really glad if you can enlighten me what am I missing.

Regards, Gokce

GokceOGUZ commented 11 months ago

Ok, I found the answer to my original post. In R, we can use the SingleR package & get the SummerizedExperiment version of the reference dataset by using the reference-based functions (HumanPrimaryCellAtlasData(), BlueprintEncodeData(), DatabaseImmuneCellExpressionData(), NovershternHematopoieticData(), MonacoImmuneData() )

Zhenbin24 commented 9 months ago

Hello, you can refer to this method (https://stereopy.readthedocs.io/en/latest/Tutorials/Format_Conversion.html) to convert the file into h5ad format