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重构slice对齐步骤报错 #236

Open
seqyuan opened this issue May 17, 2024 · 2 comments
Open

3D重构slice对齐步骤报错 #236

seqyuan opened this issue May 17, 2024 · 2 comments
Labels

Comments

@seqyuan
Copy link

seqyuan commented May 17, 2024

aligned_slices, pis = st.align.paste_align(
    models=[slice1.to_memory() for slice1 in slices],
    spatial_key="spatial",
    key_added="align_spatial",
    device="cpu" 
)
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[8], line 1
----> 1 aligned_slices, pis = st.align.paste_align(
      2     models=[slice1.to_memory() for slice1 in slices],
      3     spatial_key="spatial",
      4     key_added="align_spatial",
      5     device="cpu" 
      6 )

File /annogene/data2/share/software/SCV/SC_tools/anaconda3/lib/python3.11/site-packages/spateo_release-1.1.0-py3.11.egg/spateo/configuration.py:186, in SpateoAdataKeyManager.check_adata_is_type.<locals>.decorator.<locals>.wrapper(*args, **kwargs)
    183 call_args = inspect.getcallargs(unwrapped, *args, **kwargs)
    184 adata = call_args[argname]
    185 passing = (
--> 186     all(SpateoAdataKeyManager.adata_is_type(_adata, t) for _adata in adata)
    187     if isinstance(adata, (list, tuple))
    188     else SpateoAdataKeyManager.adata_is_type(adata, t)
    189     if type(adata) == AnnData
    190     else False
    191 )
    192 if (not optional or adata is not None) and not passing:
    193     if isinstance(adata, (list, tuple)):

File /annogene/data2/share/software/SCV/SC_tools/anaconda3/lib/python3.11/site-packages/spateo_release-1.1.0-py3.11.egg/spateo/configuration.py:186, in <genexpr>(.0)
    183 call_args = inspect.getcallargs(unwrapped, *args, **kwargs)
    184 adata = call_args[argname]
    185 passing = (
--> 186     all(SpateoAdataKeyManager.adata_is_type(_adata, t) for _adata in adata)
    187     if isinstance(adata, (list, tuple))
    188     else SpateoAdataKeyManager.adata_is_type(adata, t)
    189     if type(adata) == AnnData
    190     else False
    191 )
    192 if (not optional or adata is not None) and not passing:
    193     if isinstance(adata, (list, tuple)):

File /annogene/data2/share/software/SCV/SC_tools/anaconda3/lib/python3.11/site-packages/spateo_release-1.1.0-py3.11.egg/spateo/configuration.py:173, in SpateoAdataKeyManager.adata_is_type(adata, t)
    172 def adata_is_type(adata: AnnData, t: str) -> bool:
--> 173     return SpateoAdataKeyManager.get_adata_type(adata) == t

File /annogene/data2/share/software/SCV/SC_tools/anaconda3/lib/python3.11/site-packages/spateo_release-1.1.0-py3.11.egg/spateo/configuration.py:170, in SpateoAdataKeyManager.get_adata_type(adata)
    169 def get_adata_type(adata: AnnData) -> str:
--> 170     return adata.uns[SpateoAdataKeyManager.ADATA_TYPE_KEY]

File /annogene/data2/share/software/SCV/SC_tools/anaconda3/lib/python3.11/site-packages/anndata/compat/_overloaded_dict.py:100, in OverloadedDict.__getitem__(self, key)
     98     return self.overloaded[key].get()
     99 else:
--> 100     return self.data[key]

KeyError: '__type'
@Harrison-Q-Ma
Copy link

You can add this line before running alignment that will resolve the error:
adata.uns["__type"] = "UMI"

Copy link

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days

@github-actions github-actions bot added the Stale label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants