Skip to content

S3 reading support#198

Draft
Bisaloo wants to merge 5 commits into
HelenaLC:mainfrom
Bisaloo:s3-read
Draft

S3 reading support#198
Bisaloo wants to merge 5 commits into
HelenaLC:mainfrom
Bisaloo:s3-read

Conversation

@Bisaloo
Copy link
Copy Markdown
Collaborator

@Bisaloo Bisaloo commented May 15, 2026

No description provided.

Comment thread R/read.R
#' @export
readPoint <- function(x, ...) {
pq <- list.files(x, "\\.parquet$", full.names=TRUE)
pq <- paste0(x, file.path("points.parquet", "part.0.parquet"))
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: open an issue in Spatialdata python. Why do points have an extra nesting level?

  • shapes are shapes/layer_name/shapes.parquet
  • points are points/layer_name/points.parquet/part.0.parquet

Is this really intended? If so, if this desirable?

Comment thread R/read.R
skip <- vapply(args, isFALSE, logical(1))

x <- Rarr:::.normalize_array_path(x)
store_meta <- Rarr:::.read_consolidated_metadata(x)$metadata
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Bioconductor, it seems acceptable to use internal functions (see, e.g., ZarrArray) but ideally, this will be eventually exported: Huber-group-EMBL/Rarr#116

Comment thread R/read.R
.readLayer <- \(l) {
j <- list.dirs(file.path(x, l), recursive=FALSE, full.names=TRUE)
names(j) <- basename(j)
message(" reading ", l, "...")
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put this for now because S3 reading is quite slow and I wanted to see what was happening but I don't usually love super verbose functions.

Comment thread R/read.R
Comment on lines +55 to +56
# Until we have a complete store interface (https://github.com/Huber-group-EMBL/Rarr/pull/176),
# only local objects can be fully validated.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be handled by rome eventually anyways.

Comment thread R/read.R
skip <- vapply(args, isFALSE, logical(1))

x <- Rarr:::.normalize_array_path(x)
store_meta <- Rarr:::.read_consolidated_metadata(x)$metadata
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Spatialdata python uses zmetadata instead of .zmetadata. Is there a special reason for this? AFAIK, zarr python uses the hidden version by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant