@@ -1192,7 +1192,7 @@ def raise_error_if_more_than_one(inputs):
11921192
11931193
11941194class AnnDataWrapper (AbstractWrapper ):
1195- def __init__ (self , adata_path = None , adata_url = None , adata_store = None , adata_artifact = None , ref_path = None , ref_url = None , ref_artifact = None , obs_feature_matrix_path = None , feature_filter_path = None , initial_feature_filter_path = None , obs_set_paths = None , obs_set_names = None , obs_locations_path = None , obs_segmentations_path = None , obs_embedding_paths = None , obs_embedding_names = None , obs_embedding_dims = None , obs_spots_path = None , obs_points_path = None , feature_labels_path = None , obs_labels_path = None , convert_to_dense = True , coordination_values = None , obs_labels_paths = None , obs_labels_names = None , ** kwargs ):
1195+ def __init__ (self , adata_path = None , adata_url = None , adata_store = None , adata_artifact = None , ref_path = None , ref_url = None , ref_artifact = None , obs_feature_matrix_path = None , feature_filter_path = None , initial_feature_filter_path = None , obs_set_paths = None , obs_set_names = None , obs_locations_path = None , obs_segmentations_path = None , obs_embedding_paths = None , obs_embedding_names = None , obs_embedding_dims = None , obs_spots_path = None , obs_points_path = None , feature_labels_path = None , obs_labels_path = None , convert_to_dense = True , coordination_values = None , obs_labels_paths = None , obs_labels_names = None , is_zip = None , ** kwargs ):
11961196 """
11971197 Wrap an AnnData object by creating an instance of the ``AnnDataWrapper`` class.
11981198
@@ -1220,6 +1220,7 @@ def __init__(self, adata_path=None, adata_url=None, adata_store=None, adata_arti
12201220 :param list[str] obs_labels_names: The optional display names of columns containing observation labels (e.g., alternate cell IDs), instead of the default index in `obs` of the AnnData store.
12211221 :param bool convert_to_dense: Whether or not to convert `X` to dense the zarr store (dense is faster but takes more disk space).
12221222 :param coordination_values: Coordination values for the file definition.
1223+ :param is_zip: Boolean indicating whether the Zarr store is in a zipped format.
12231224 :type coordination_values: dict or None
12241225 :param \\ *\\ *kwargs: Keyword arguments inherited from :class:`~vitessce.wrappers.AbstractWrapper`
12251226 """
@@ -1229,7 +1230,7 @@ def __init__(self, adata_path=None, adata_url=None, adata_store=None, adata_arti
12291230 self ._adata_url = adata_url
12301231 self ._adata_store = adata_store
12311232 self ._adata_artifact = adata_artifact
1232- self .is_zip = False
1233+ self .is_zip = is_zip
12331234
12341235 # For reference spec JSON with .h5ad files
12351236 self ._ref_path = ref_path
@@ -1251,14 +1252,13 @@ def __init__(self, adata_path=None, adata_url=None, adata_store=None, adata_arti
12511252 self .is_remote = False
12521253 self .is_store = False
12531254 self .zarr_folder = 'anndata.zarr'
1254- if '.zip' in str (adata_path ):
1255+ if is_zip is not None and '.zip' in str (adata_path ):
12551256 self .is_zip = True
1256- # self.zarr_folder = 'anndata.zarr.zip'
12571257 elif adata_url is not None or adata_artifact is not None :
12581258 self .is_remote = True
12591259 self .is_store = False
12601260 self .zarr_folder = None
1261- if '.zip' in str (adata_url ):
1261+ if is_zip is not None and '.zip' in str (adata_url ):
12621262 self .is_zip = True
12631263 # Store artifacts on AbstractWrapper.artifacts for downstream access,
12641264 # e.g. in lamindb.save_vitessce_config
@@ -1362,7 +1362,7 @@ def get_anndata_zarr(base_url):
13621362 if self .is_h5ad :
13631363 options ["refSpecUrl" ] = self .get_ref_url (base_url , dataset_uid , obj_i )
13641364 obj_file_def = {
1365- "fileType" : ft .ANNDATA_ZIPPED_ZARR .value if self .is_zip else ft .ANNDATA_H5AD .value if self .is_h5ad else ft .ANNDATA_ZARR .value ,
1365+ "fileType" : ft .ANNDATA_ZARR_ZIP .value if self .is_zip else ft .ANNDATA_H5AD .value if self .is_h5ad else ft .ANNDATA_ZARR .value ,
13661366 "url" : self .get_zarr_url (base_url , dataset_uid , obj_i ) if not self .is_h5ad else self .get_h5ad_url (base_url , dataset_uid , obj_i ),
13671367 "options" : options
13681368 }
0 commit comments