scverse / scverse/spatialdata-plot

3D visualize

未关闭
#385 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
86
派生
21
平均合并
14 小时 50 分钟
30 天内合并 PR
3

描述

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(

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先重现报告的 notebook 操作:在根据 z 对 sdata["transcripts"] 取子集后,将 my_images、my_labels、filtered_data、my_shapes 和 my_tables 组合起来。阅读现有的 2D Xenium 绘图入口,并检查 transcript 数据是如何重建的;issue 中没有指定源文件或测试。完成标准是定义一条 3D 可视化路径或记录一项限制,并解决报告的 ValueError,或将其更清晰地隔离出来。

由索引模型根据 Issue 内容生成。

评估

技术栈
pandas, python
领域
data-visualization
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。