angelolab / angelolab/ark-analysis

Neighborhood matrix ValueError: did not find a match in any of xarray's currently installed IO backends ['scipy', 'zarr'].

Abierto
#1,169 2 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Jupyter Notebook
Estrellas
108
Forks
31
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

*Please refer to our [FAQ](https://ark-analysis.readthedocs.io/en/latest/_rtd/faq.html) and look at our [known issues](https://github.com/angelolab/ark-analysis/issues) before opening a bug report.*

**Describe the bug**
Running in Ubuntu 24.04.1 LTS, ark-analysis-0.7.3.dev0+ge22a487.d20241011 in conda env, example_neighborhood_analysis.ipynb, cell 8

ValueError Traceback (most recent call last)
Cell In[8], line 8
4 neighbor_freqs = pd.read_csv(freqs_path)
6 else:
7 # Create new matrix with the radius and cell column specified above
----> 8 neighbor_counts, neighbor_freqs = neighborhood_analysis.create_neighborhood_matrix(
9 all_data, dist_mat_dir, distlim=pixel_radius, cell_type_col=cell_type_col)
11 # Save neighbor matrices
12 neighbor_counts.to_csv(counts_path, index=False)

File ~/miniconda3/envs/ark_env/lib/python3.10/site-packages/ark/analysis/neighborhood_analysis.py:92, in create_neighborhood_matrix(all_data, dist_mat_dir, included_fovs, distlim, self_neighbor, fov_col, cell_label_col, cell_type_col)
89 fov_cluster_names = current_fov_neighborhood_data[cell_type_col].drop_duplicates()
91 # Retrieve fov-specific distance matrix from distance matrix dictionary
---> 92 dist_matrix = xr.load_dataarray(os.path.join(dist_mat_dir, str(fov) + '_dist_mat.xr'))
94 # Get cell_neighbor_counts and cell_neighbor_freqs for fovs
95 counts, freqs = spatial_analysis_utils.compute_neighbor_counts(
96 current_fov_neighborhood_data, dist_matrix, distlim, self_neighbor,
97 cell_label_col=cell_label_col, cluster_name_col=cell_type_col)

File ~/miniconda3/envs/ark_env/lib/python3.10/site-packages/xarray/backends/api.py:303, in load_dataarray(filename_or_obj, **kwargs)
300 if "cache" in kwargs:
301 raise TypeError("cache has no effect in this context")
--> 303 with open_dataarray(filename_or_obj, **kwargs) as da:
304 return da.load()

File ~/miniconda3/envs/ark_env/lib/python3.10/site-packages/xarray/backends/api.py:769, in open_dataarray(filename_or_obj, engine, chunks, cache, decode_cf, mask_and_scale, decode_times, decode_timedelta, use_cftime, concat_characters, decode_coords, drop_variables, inline_array, chunked_array_type, from_array_kwargs, backend_kwargs, **kwargs)
611 def open_dataarray(
612 filename_or_obj: str | os.PathLike[Any] | BufferedIOBase | AbstractDataStore,
613 *,
(...)
629 **kwargs,
630 ) -> DataArray:
631 """Open an DataArray from a file or file-like object containing a single
632 data variable.
633
(...)
766 open_dataset
767 """
--> 769 dataset = open_dataset(
770 filename_or_obj,
771 decode_cf=decode_cf,
772 mask_and_scale=mask_and_scale,
773 decode_times=decode_times,
774 concat_characters=concat_characters,
775 decode_coords=decode_coords,
776 engine=engine,
777 chunks=chunks,
778 cache=cache,
779 drop_variables=drop_variables,
780 inline_array=inline_array,
781 chunked_array_type=chunked_array_type,
782 from_array_kwargs=from_array_kwargs,
783 backend_kwargs=backend_kwargs,
784 use_cftime=use_cftime,
785 decode_timedelta=decode_timedelta,
786 **kwargs,
787 )
789 if len(dataset.data_vars) != 1:
790 raise ValueError(
791 "Given file dataset contains more than one data "
792 "variable. Please read with xarray.open_dataset and "
793 "then select the variable you want."
794 )

File ~/miniconda3/envs/ark_env/lib/python3.10/site-packages/xarray/backends/api.py:569, in open_dataset(filename_or_obj, engine, chunks, cache, decode_cf, mask_and_scale, decode_times, decode_timedelta, use_cftime, concat_characters, decode_coords, drop_variables, inline_array, chunked_array_type, from_array_kwargs, backend_kwargs, **kwargs)
566 kwargs.update(backend_kwargs)
568 if engine is None:
--> 569 engine = plugins.guess_engine(filename_or_obj)
571 if from_array_kwargs is None:
572 from_array_kwargs = {}

File ~/miniconda3/envs/ark_env/lib/python3.10/site-packages/xarray/backends/plugins.py:197, in guess_engine(store_spec)
189 else:
190 error_msg = (
191 "found the following matches with the input file in xarray's IO "
192 f"backends: {compatible_engines}. But their dependencies may not be installed, see:\n"
193 "https://docs.xarray.dev/en/stable/user-guide/io.html \n"
194 "https://docs.xarray.dev/en/stable/getting-started-guide/installing.html"
195 )
--> 197 raise ValueError(error_msg)

ValueError: did not find a match in any of xarray's currently installed IO backends ['scipy', 'zarr']. Consider explicitly selecting one of the installed engines via the ``engine`` parameter, or installing additional IO dependencies, see:
https://docs.xarray.dev/en/stable/getting-started-guide/installing.html
https://docs.xarray.dev/en/stable/user-guide/io.html

**Expected behavior**
Expected for neighborhood matrix to be created without error.

**To Reproduce**
![image](https://github.com/user-attachments/assets/37f94490-1588-4563-a506-1d7f9f261dfd)

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.