Skip to content

[BUG] XeniumSample - No attribute embeddings_dict, missing packages installation #112

Open

Description

@Lisamrshhsr

Hello everyone,

I currently try to re-segment our Xenium data including a scRNAseq reference dataset. I came across a few errors which I managed to fix, but now I'm sadly stuck. I installed via pulling from github (Date: 04.06.25) :)

This is my code for importing

from segger.data.io import XeniumSample
from pathlib import Path
from segger.data.utils import calculate_gene_celltype_abundance_embedding
import scanpy as sc
import os

The point where I am stuck is here:

#Setup Xenium sample to create dataset
xs = XeniumSample(verbose=False, embedding_df=gene_celltype_abundance_embedding)
xs.set_file_paths(
    transcripts_path=f'{raw_data_dir}/transcripts.parquet',
    boundaries_path=f'{raw_data_dir}/nucleus_boundaries.parquet',
)
xs.set_metadata()

# Set the embedding to "cell_type_abundance" to use it in further processing
xs.set_embedding("cell_type_abundance")

And now I am stuck with the following error:

AttributeError                            Traceback (most recent call last)
Cell In[37], line 10
      7 xs.set_metadata()
      9 # Set the embedding to "cell_type_abundance" to use it in further processing
---> 10 xs.set_embedding("cell_type_abundance")

File ~/segger_dev/src/segger/data/io.py:452, in SpatialTranscriptomicsSample.set_embedding(self, embedding_name)
    443 def set_embedding(self, embedding_name: str) -> None:
    444     """
    445     Set the current embedding type for the transcripts.
    446 
   (...)    450 
    451     """
--> 452     if embedding_name in self.embeddings_dict:
    453         self.current_embedding = embedding_name
    454     else:

AttributeError: 'XeniumSample' object has no attribute 'embeddings_dict'

Could you please let me know if there is something wrong with my data or this is command is under construction currently? I would be really happy to use segger for improving our segmentation of the heart really soon. It would be great if there's a way how we could get this fixed :)

As a note: the code from the documentation did not work for me (you might be aware of this already). Also I recognized one needs to install torch and dask_geopandas before running the script :)

Thanks a lot and greets,
Lisa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions