glue_genes.glue_genomics_data.multires_data.MultiResolutionData#
- class glue_genes.glue_genomics_data.multires_data.MultiResolutionData(label='', coords=None, all_resolutions=[], reduced_dims=[], **kwargs)#
A data class that supports multi-resolution n-dimensional datasets. If these multiple resolutions are accessed as DaskArrays this provides a memory-efficient way to browse very high-resolution images.
The basic scheme is to use the highest resolution dataset for setting up components but to store the lower-resolution versions as a list of Data objects. Then, whenever we need a chunk of the data, we calculate whether we can use one of the lower-resolution images instead. The lower-resolution versions are not part of the DataCollection and so we can’t use the general linking framework, but as they are all different views of the same data we can do this manually.
Currently this class assumes OME-Zarr datasets where the multi-resolution datasets are stored from highest to lowest resolution with each lower resolution version downsampled by a factor of two.
Since the MultiResolutionData set contains the full data, we do not need to override get_mask or get_data.
- __init__(label='', coords=None, all_resolutions=[], reduced_dims=[], **kwargs)#
Methods
__init__
([label, coords, all_resolutions, ...])add_component
(component, label)Add a new component to this data set.
add_component_link
(link[, label])Shortcut method for generating a new
DerivedComponent
from a ComponentLink object, and adding it to a data set.add_subset
(subset[, label])Assign a pre-existing subset to this data object.
broadcast
(attribute)Send a
DataUpdateMessage
to the hubcomponent_ids
()Equivalent to
Data.components
compute_fixed_resolution_buffer
(*args, **kwargs)Get a fixed_resolution_buffer from the smallest resolution dataset that we can glue flips x/y relative to ome-zarr, so we read in the data as tczxy
compute_histogram
(cids[, weights, range, ...])We want to pass the compute_histogram calls to whatever reduced resolution dataset has sufficient number of points.
compute_statistic
(statistic, cid, **kwargs)random_views_for_dask_array (used if random_subset is set and we have a dask array) has a problem if there is structure in the image that corresponds to the chunk size.
dtype
(cid)Lookup the dtype for the data associated with a ComponentID
find_component_id
(label)Retrieve component_ids associated by label name.
get_component
(component_id)Fetch the component corresponding to component_id.
get_data
(cid[, view])Get the data values for a given component
get_kind
(cid)Get the kind of data for a given component.
get_mask
(subset_state[, view])Get a boolean mask for a given subset state.
get_object
([cls])Get the dataset represented as a non-glue object, using the translation infrastructure.
get_selection_definition
([subset_id, format])Get subset state represented as a non-glue object, using the translation infrastructure.
get_subset_object
([subset_id, cls])Get a subset represented as a non-glue object, using the translation infrastructure.
join_on_key
(other, cid, cid_other)Create an element mapping to another dataset, by joining on values of ComponentIDs in both datasets.
new_subset
([subset])Create a new subset, and attach to self.
register_to_hub
(hub)Connect to a hub.
remove_component
(component_id)Remove a component from a data set
reorder_components
(component_ids)Reorder the components using a list of component IDs.
setup_cid_lookups
()to_dataframe
([index])Convert the Data object into a
pandas.DataFrame
object.update_components
(mapping)Change the numerical data associated with some of the Components in this Data object.
update_id
(old, new)Reassign a component to a different
glue.core.component_id.ComponentID
update_values_from_data
(data)Replace numerical values in data to match values from another dataset.
Attributes
components
All
ComponentIDs
in the Data.coordinate_components
The ComponentIDs associated with a
CoordinateComponent
.coordinate_links
A list of the ComponentLinks that connect pixel and world.
coords
The coordinates object for the data.
data
derived_components
The ComponentIDs for each
DerivedComponent
.derived_links
A list of the links present inside all of the DerivedComponent objects in this dataset.
externally_derivable_components
label
The name of the dataset
links
A list of all the links internal to the dataset.
main_components
ndim
The number of dimensions of the data, as an integer.
pixel_aligned_data
Information about other datasets in the same data collection that have matching or a subset of pixel component IDs.
pixel_component_ids
The
ComponentIDs
for each pixel coordinate.primary_components
The ComponentIDs not associated with a
DerivedComponent
shape
The n-dimensional shape of the dataset, as a tuple.
size
The size of the data (the product of the shape dimensions), as an integer.
subsets
Tuple of subsets attached to this dataset.
visible_components
All
ComponentIDs
in the Data that aren't coordinates.world_component_ids
The
ComponentIDs
for each world coordinate.