Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D visualize #201

Open
Yifan-debug opened this issue Aug 18, 2024 · 1 comment
Open

3D visualize #201

Yifan-debug opened this issue Aug 18, 2024 · 1 comment

Comments

@Yifan-debug
Copy link

Hi developer.

Thanks alot for the useful tools and sorry for keep bothering.

I need a 3D visualiza on my xenium dataset. Now I can correctly load my xenium data and check the transcripts point on 2D shape.
I'm wondering if there is any plan to add the 3D visualize feature.

I also try to subset my sdata["transcripts"] based on the z value. however, after subset, I try to construct the sdata, it's not working. and showed error code. ValueError('Unable to coerce to Series, length must be 11: given 2')

Please also let me know if you have better recommendation on 3D visualization of xenium data.


ValueError Traceback (most recent call last)
d:\Yifan_Wang\Software\envs\SP\lib\site-packages\dask\dataframe\utils.py in ?(funcname, udf)
214 )
215 msg = msg.format(f" in {funcname}" if funcname else "", repr(e), tb)
--> 216 raise ValueError(msg) from e

d:\Yifan_Wang\Software\envs\SP\lib\site-packages\dask\dataframe\core.py in ?(op, meta, out, transform_divisions, *args, **kwargs)
6624 for d in dasks
6625 ]
-> 6626 with raise_on_meta_error(funcname(op)):
6627 meta = partial_by_order(*parts, function=op, other=other)

d:\Yifan_Wang\Software\envs\SP\lib\site-packages\dask\utils.py in ?(*args, **kwargs)
1474 for i, arg in other:
1475 args2.insert(i, arg)
-> 1476 return function(*args2, **kwargs)

d:\Yifan_Wang\Software\envs\SP\lib\site-packages\pandas\core\ops\common.py in ?(self, other)
74 other = item_from_zerodim(other)
75
---> 76 return method(self, other)

d:\Yifan_Wang\Software\envs\SP\lib\site-packages\pandas\core\arraylike.py in ?(self, other)
80 @unpack_zerodim_and_defer("ror")
81 def ror(self, other):
---> 82 return self.logical_method(other, roperator.ror)

d:\Yifan_Wang\Software\envs\SP\lib\site-packages\pandas\core\frame.py in ?(self, other, op)
7908 other = ops.maybe_prepare_scalar_for_op(other, (self.shape[axis],))
7909
-> 7910 self, other = self._align_for_op(other, axis, flex=True, level=None)
7911

d:\Yifan_Wang\Software\envs\SP\lib\site-packages\pandas\core\frame.py in ?(self, other, axis, flex, level)
8185 )
8186 # GH#17901
-> 8187 right = to_series(right)
8188

d:\Yifan_Wang\Software\envs\SP\lib\site-packages\pandas\core\frame.py in ?(right)
8131 else:
8132 if len(left.columns) != len(right):
-> 8133 raise ValueError(
8134 msg.format(req_len=len(left.columns), given_len=len(right))

ValueError: Unable to coerce to Series, length must be 11: given 2

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)
Cell In[46], line 1
----> 1 merged_dict_crop = my_images | my_labels | filtered_data | my_shapes | my_tables
2 print(merged_dict.keys())

File d:\Yifan_Wang\Software\envs\SP\lib\site-packages\dask\dataframe\core.py:2124, in _Frame._get_binary_operator..(self, other)
2121 @classmethod
2122 def _get_binary_operator(cls, op, inv=False):
2123 if inv:
-> 2124 return lambda self, other: elemwise(op, other, self)
2125 else:
2126 return lambda self, other: elemwise(op, self, other)

File d:\Yifan_Wang\Software\envs\SP\lib\site-packages\dask\dataframe\core.py:6626, in elemwise(op, meta, out, transform_divisions, *args, **kwargs)
6617 # For broadcastable series, use no rows.
6618 parts = [
6619 d._meta
6620 if _is_broadcastable(d)
(...)
6624 for d in dasks
6625 ]
-> 6626 with raise_on_meta_error(funcname(op)):
6627 meta = partial_by_order(*parts, function=op, other=other)
6629 result = new_dd_object(graph, _name, meta, divisions)

File d:\Yifan_Wang\Software\envs\SP\lib\contextlib.py:153, in _GeneratorContextManager.exit(self, typ, value, traceback)
151 value = typ()
152 try:
--> 153 self.gen.throw(typ, value, traceback)
154 except StopIteration as exc:
155 # Suppress StopIteration unless it's the same exception that
156 # was passed to throw(). This prevents a StopIteration
157 # raised inside the "with" statement from being suppressed.
158 return exc is not value

File d:\Yifan_Wang\Software\envs\SP\lib\site-packages\dask\dataframe\utils.py:216, in raise_on_meta_error(funcname, udf)
207 msg += (
208 "Original error is below:\n"
209 "------------------------\n"
(...)
213 "{2}"
214 )
215 msg = msg.format(f" in {funcname}" if funcname else "", repr(e), tb)
--> 216 raise ValueError(msg) from e

ValueError: Metadata inference failed in or_.

Original error is below:

ValueError('Unable to coerce to Series, length must be 11: given 2')

Traceback:

File "d:\Yifan_Wang\Software\envs\SP\lib\site-packages\dask\dataframe\utils.py", line 195, in raise_on_meta_error
yield
File "d:\Yifan_Wang\Software\envs\SP\lib\site-packages\dask\dataframe\core.py", line 6627, in elemwise
meta = partial_by_order(*parts, function=op, other=other)
File "d:\Yifan_Wang\Software\envs\SP\lib\site-packages\dask\utils.py", line 1476, in partial_by_order
return function(*args2, **kwargs)
File "d:\Yifan_Wang\Software\envs\SP\lib\site-packages\pandas\core\ops\common.py", line 76, in new_method
return method(self, other)
File "d:\Yifan_Wang\Software\envs\SP\lib\site-packages\pandas\core\arraylike.py", line 82, in ror
return self.logical_method(other, roperator.ror)
File "d:\Yifan_Wang\Software\envs\SP\lib\site-packages\pandas\core\frame.py", line 7910, in _arith_method
self, other = self._align_for_op(other, axis, flex=True, level=None)
File "d:\Yifan_Wang\Software\envs\SP\lib\site-packages\pandas\core\frame.py", line 8187, in _align_for_op
right = to_series(right)
File "d:\Yifan_Wang\Software\envs\SP\lib\site-packages\pandas\core\frame.py", line 8133, in to_series
raise ValueError(

@LucaMarconato
Copy link
Member

HI @Yifan-debug,

Thanks alot for the useful tools and sorry for keep bothering.

no worries, feel free to ask 😊

I'm wondering if there is any plan to add the 3D visualize feature.

We are trying to hire a developer to focus exclusively on 3D but the process is slower than we hoped, so while of interest, for the moment 3D capabilities are limited. Some parts like read/write, transformations and spatial query are fully supported, but others require extra work: aggregation, visualization.

Please also let me know if you have better recommendation on 3D visualization of xenium data.

The good news is that since we designed our data model to reuse existing data structures, such as (dask) pandas DataFrames and Xarray DataArray, you can plug in the data directly to other viewer.

For instance I would suggest for instance to call scanpy for visualizing 3D points, or manually adding layers to napari for 3D points and 3D raster data.

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

No branches or pull requests

2 participants