This class implements a Zarr object. A Zarr object is a set of objects that make up an instance of a Zarr data set, irrespective of where it is located. The Zarr object manages the hierarchy as well as the underlying store.
A Zarr object may contain multiple Zarr arrays in a hierarchy. The main
class for managing Zarr arrays is zarr_array. The hierarchy is made up of
zarr_group instances. Each zarr_array is located in a zarr_group.
Active bindings
version(read-only) The version of the Zarr object.
root(read-only) The root node of the Zarr object, usually a zarr_group instance but it could also be a zarr_array instance.
store(read-only) The store of the Zarr object.
groups(read-only) Retrieve the paths to the groups of the Zarr object, starting from the root group, as a character vector.
arrays(read-only) Retrieve the paths to the arrays of the Zarr object, starting from the root group, as a character vector.
Methods
Method new()
Create a new Zarr instance. The Zarr instance manages the groups and arrays in the Zarr store that it refers to. This instance provides access to all objects in the Zarr store.
Usage
zarr$new(store)Arguments
storeAn instance of a zarr_store descendant class where the Zarr objects are located.
Method get_node()
Retrieve the group or array represented by the node located at the path.
Returns
The zarr_group or zarr_array instance located at path, or
NULL if the path was not found.
Method add_group()
Add a group below a given path.
Arguments
pathThe path to the parent group of the new group, a single character string.
nameThe name for the new group, a single character string.
Returns
The newly created zarr_group, or NULL if the group could not
be created.
Method add_array()
Add an array in a group with a given path.
Arguments
pathThe path to the group of the new array, a single character string.
nameThe name for the new array, a single character string.
metadataA
listwith the metadata for the new array.
Returns
The newly created zarr_array, or NULL if the array could not
be created.
Method delete_group()
Delete a group from the Zarr object. This will also delete
the group from the Zarr store. The root group cannot be deleted but it
can be specified through path = "/" in which case the root group
loses any specific group metadata (with only the basic parameters
remaining), as well as any arrays and sub-groups if recursive = TRUE.
Warning: this operation is irreversible for many stores!
Method delete_array()
Delete an array from the Zarr object. If the array is the root of the Zarr object, it will be converted into a regular Zarr object with a root group. Warning: this operation is irreversible for many stores!