waldronlab / VisiumIO

Import spaceranger output and 10X spatial data
0 stars 0 forks source link

Issues when creating Visium HD object #2

Closed boyiguo1 closed 2 months ago

boyiguo1 commented 7 months ago

Thanks for creating the package.

I'm experimenting with VisiumIO 0.99.3 to create SpatialExperiment object for Visium HD data.

The dataset that I'm experimenting right now comes from https://www.10xgenomics.com/datasets/visium-hd-cytassist-gene-expression-libraries-of-mouse-brain-he.

The first issue I had is to directly load an .tar.gz object directly via the resource statement.

spe <- TENxVisium(
     resources = "Visium_HD_Mouse_Brain_square_008um_outputs.tar.gz"
    )
Error in TENxVisium(resources = "Visium_HD_Mouse_Brain_square_008um_outputs.tar.gz") : 
  argument "spatialResource" is missing, with no default

I read from the vignette resources = "path/to/10x/visium/file.tar.gz", which I thought .tar.gz is an accepted format, can you clarify?

The second issue I had is with import function after creating an "TENxVisium" object. Specifically, I unzipped the tar.gz object to a folder (which contains a layer of outs to contain all necessary files). I was successfully running TENxVisium function. However, when I tried to import as an spe object, I received the error message Error in if (is.url) { : the condition has length > 1, which doesn't seem to come from SpatialExperiment object.

 spe <- TENxVisium(
  spacerangerOut = "square_008um",
  # spatialResource = "square_008um/spatial",
  jsonFile = "scalefactors_json.json",
  tissuePattern = "tissue_positions.parquet"
)

> spe
An object of class "TENxVisium"
Slot "resources":
TENxFileList of length 3
names(3): barcodes.tsv.gz features.tsv.gz matrix.mtx.gz

Slot "spatialList":
TENxSpatialList of length 8
names(8): aligned_fiducials.jpg ... tissue_positions.parquet

Slot "coordNames":
[1] "pxl_col_in_fullres" "pxl_row_in_fullres"

Slot "sampleId":
[1] "sample01"

> import(spe)
Error in if (is.url) { : the condition has length > 1

Here is the session info

─ Session info ─────────────────────────────────────────────────────────────────────
 setting  value
 version  R Under development (unstable) (2023-11-13 r85520)
 os       Rocky Linux 9.2 (Blue Onyx)
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       US/Eastern
 date     2024-04-14
 pandoc   3.1.3 @ /jhpce/shared/community/core/conda_R/devel/bin/pandoc

─ Packages ─────────────────────────────────────────────────────────────────────────
 package              * version   date (UTC) lib source
 abind                  1.4-5     2016-07-21 [2] CRAN (R 4.4.0)
 beachmat               2.19.1    2024-01-22 [2] Bioconductor 3.19 (R 4.4.0)
 Biobase              * 2.63.1    2024-03-29 [1] Bioconductor 3.19 (R 4.4.0)
 BiocBaseUtils          1.5.0     2023-10-24 [2] Bioconductor
 BiocGenerics         * 0.49.1    2023-11-01 [2] Bioconductor
 BiocIO                 1.13.0    2023-10-24 [2] Bioconductor
 BiocManager            1.30.22   2023-08-08 [2] CRAN (R 4.4.0)
 BiocParallel           1.37.1    2024-03-04 [1] Bioconductor 3.19 (R 4.4.0)
 bit                    4.0.5     2022-11-15 [2] CRAN (R 4.4.0)
 bit64                  4.0.5     2020-08-30 [2] CRAN (R 4.4.0)
 bitops                 1.0-7     2021-04-24 [2] CRAN (R 4.4.0)
 cli                    3.6.2     2023-12-11 [2] CRAN (R 4.4.0)
 codetools              0.2-19    2023-02-01 [3] CRAN (R 4.4.0)
 crayon                 1.5.2     2022-09-29 [2] CRAN (R 4.4.0)
 DelayedArray           0.29.9    2024-03-01 [1] Bioconductor 3.19 (R 4.4.0)
 DelayedMatrixStats     1.25.1    2023-11-09 [2] Bioconductor
 dqrng                  0.3.2     2023-11-29 [2] CRAN (R 4.4.0)
 DropletUtils           1.23.0    2023-10-24 [2] Bioconductor
 edgeR                  4.1.15    2024-01-29 [2] Bioconductor 3.19 (R 4.4.0)
 fansi                  1.0.6     2023-12-08 [2] CRAN (R 4.4.0)
 fs                     1.6.3     2023-07-20 [2] CRAN (R 4.4.0)
 GenomeInfoDb         * 1.39.13   2024-04-07 [1] Bioconductor 3.19 (R 4.4.0)
 GenomeInfoDbData       1.2.12    2024-04-11 [1] Bioconductor
 GenomicRanges        * 1.55.4    2024-03-18 [1] Bioconductor 3.19 (R 4.4.0)
 glue                   1.7.0     2024-01-09 [2] CRAN (R 4.4.0)
 HDF5Array              1.31.5    2024-02-02 [2] Bioconductor 3.19 (R 4.4.0)
 hms                    1.1.3     2023-03-21 [2] CRAN (R 4.4.0)
 httr                   1.4.7     2023-08-15 [2] CRAN (R 4.4.0)
 IRanges              * 2.37.1    2024-01-19 [2] Bioconductor 3.19 (R 4.4.0)
 jsonlite               1.8.8     2023-12-04 [2] CRAN (R 4.4.0)
 lattice                0.22-5    2023-10-24 [3] CRAN (R 4.4.0)
 lifecycle              1.0.4     2023-11-07 [2] CRAN (R 4.4.0)
 limma                  3.59.2    2024-02-04 [2] Bioconductor 3.19 (R 4.4.0)
 locfit                 1.5-9.8   2023-06-11 [2] CRAN (R 4.4.0)
 magick                 2.8.3     2024-02-18 [1] CRAN (R 4.4.0)
 magrittr               2.0.3     2022-03-30 [2] CRAN (R 4.4.0)
 Matrix                 1.6-5     2024-01-11 [2] CRAN (R 4.4.0)
 MatrixGenerics       * 1.15.0    2023-10-24 [2] Bioconductor
 matrixStats          * 1.3.0     2024-04-11 [1] CRAN (R 4.4.0)
 pillar                 1.9.0     2023-03-22 [2] CRAN (R 4.4.0)
 pkgconfig              2.0.3     2019-09-22 [2] CRAN (R 4.4.0)
 R.methodsS3            1.8.2     2022-06-13 [2] CRAN (R 4.4.0)
 R.oo                   1.26.0    2024-01-24 [2] CRAN (R 4.4.0)
 R.utils                2.12.3    2023-11-18 [2] CRAN (R 4.4.0)
 R6                     2.5.1     2021-08-19 [2] CRAN (R 4.4.0)
 Rcpp                   1.0.12    2024-01-09 [2] CRAN (R 4.4.0)
 RCurl                  1.98-1.14 2024-01-09 [2] CRAN (R 4.4.0)
 readr                  2.1.5     2024-01-10 [2] CRAN (R 4.4.0)
 rhdf5                  2.47.3    2024-02-05 [2] Bioconductor 3.19 (R 4.4.0)
 rhdf5filters           1.15.2    2024-02-02 [2] Bioconductor 3.19 (R 4.4.0)
 Rhdf5lib               1.25.1    2023-12-11 [2] Bioconductor 3.19 (R 4.4.0)
 rjson                  0.2.21    2022-01-09 [2] CRAN (R 4.4.0)
 rlang                  1.1.3     2024-01-10 [2] CRAN (R 4.4.0)
 S4Arrays               1.3.7     2024-04-09 [1] Bioconductor 3.19 (R 4.4.0)
 S4Vectors            * 0.41.6    2024-04-05 [1] Bioconductor 3.19 (R 4.4.0)
 scuttle                1.13.0    2023-10-24 [2] Bioconductor
 sessioninfo            1.2.2     2021-12-06 [2] CRAN (R 4.4.0)
 SingleCellExperiment * 1.25.1    2024-03-27 [1] Bioconductor 3.19 (R 4.4.0)
 SparseArray            1.3.5     2024-04-09 [1] Bioconductor 3.19 (R 4.4.0)
 sparseMatrixStats      1.15.0    2023-10-24 [2] Bioconductor
 SpatialExperiment    * 1.13.2    2024-04-05 [1] Bioconductor 3.19 (R 4.4.0)
 statmod                1.5.0     2023-01-06 [2] CRAN (R 4.4.0)
 SummarizedExperiment * 1.33.3    2024-01-23 [2] Bioconductor 3.19 (R 4.4.0)
 TENxIO               * 1.5.3     2023-11-21 [1] Bioconductor 3.19 (R 4.4.0)
 tibble                 3.2.1     2023-03-20 [2] CRAN (R 4.4.0)
 tidyselect             1.2.1     2024-03-11 [1] CRAN (R 4.4.0)
 tzdb                   0.4.0     2023-05-12 [2] CRAN (R 4.4.0)
 UCSC.utils             0.99.5    2024-04-04 [1] Bioconductor 3.19 (R 4.4.0)
 utf8                   1.2.4     2023-10-22 [2] CRAN (R 4.4.0)
 vctrs                  0.6.5     2023-12-01 [2] CRAN (R 4.4.0)
 VisiumIO             * 0.99.3    2024-01-26 [1] Bioconductor 3.19 (R 4.4.0)
 vroom                  1.6.5     2023-12-05 [2] CRAN (R 4.4.0)
 XVector                0.43.1    2024-01-10 [2] Bioconductor 3.19 (R 4.4.0)
 zlibbioc               1.49.3    2024-03-13 [1] Bioconductor 3.19 (R 4.4.0)
alikhuseynov commented 5 months ago

Does this package support reading VisiumHD? @boyiguo1 as on your issue with SPE https://github.com/drighelli/SpatialExperiment/issues/150 if you need to make SPE object for VisiumHD try this function https://github.com/pachterlab/SpatialFeatureExperiment/blob/devel/R/read.R#L223-L324 I haven't PR that to SPE yet.

alikhuseynov commented 4 months ago

@lwaldron any updates on VisiumHD reader?

LiNk-NY commented 3 months ago

Hi @boyiguo1 and @alikhuseynov I just saw your message. The Visium HD format is not supported yet. I am currently working on it.

LiNk-NY commented 2 months ago

@boyiguo1 @alikhuseynov Visium HD format should be supported now. You can test on Bioc-devel version 3.20. Best, Marcel