STOmics / Stereopy

A toolkit of spatial transcriptomic analysis.
MIT License
179 stars 59 forks source link

Error whe importing a processed Seurat file in Stereopy #276

Closed agoan27 closed 1 month ago

agoan27 commented 1 month ago

Hi I tried to import a seurat file (h5Seurat) on Stereopy with the dedicated function. The function run sucessfully and the object is created , however i cannot operate with it.

If i inspect the object i found the following error

AttributeError Traceback (most recent call last) File ~/anaconda3/envs/stereopy/lib/python3.8/site-packages/IPython/core/formatters.py:708, in PlainTextFormatter.call(self, obj) 701 stream = StringIO() 702 printer = pretty.RepresentationPrinter(stream, self.verbose, 703 self.max_width, self.newline, 704 max_seq_length=self.max_seq_length, 705 singleton_pprinters=self.singleton_printers, 706 type_pprinters=self.type_printers, 707 deferred_pprinters=self.deferred_printers) --> 708 printer.pretty(obj) 709 printer.flush() 710 return stream.getvalue()

File ~/anaconda3/envs/stereopy/lib/python3.8/site-packages/IPython/lib/pretty.py:410, in RepresentationPrinter.pretty(self, obj) 407 return meth(obj, self, cycle) 408 if cls is not object \ 409 and callable(cls.dict.get('repr')): --> 410 return _repr_pprint(obj, self, cycle) 412 return _default_pprint(obj, self, cycle) 413 finally:

File ~/anaconda3/envs/stereopy/lib/python3.8/site-packages/IPython/lib/pretty.py:778, in _reprpprint(obj, p, cycle) 776 """A pprint that just redirects to the normal repr function.""" 777 # Find newlines and replace them with p.break() --> 778 output = repr(obj) 779 lines = output.splitlines() 780 with p.group():

File ~/anaconda3/envs/stereopy/lib/python3.8/site-packages/stereo/core/stereo_exp_data.py:587, in StereoExpData.repr(self) 586 def repr(self): --> 587 return self.str()

File ~/anaconda3/envs/stereopy/lib/python3.8/site-packages/stereo/core/stereo_exp_data.py:548, in StereoExpData.str(self) 547 def str(self): --> 548 format_str = f"StereoExpData object with n_cells X n_genes = {self.shape[0]} X {self.shape[1]}" 549 format_str += f"\nbin_type: {self.bin_type}" 550 if self.bin_type == 'bins':

File ~/anaconda3/envs/stereopy/lib/python3.8/site-packages/stereo/core/stereo_exp_data.py:232, in StereoExpData.shape(self) 225 @property 226 def shape(self): 227 """ 228 Get the shape of expression matrix. 229 230 :return: 231 """ --> 232 return self.exp_matrix.shape

AttributeError: 'NoneType' object has no attribute 'shape' Selection deleted

Could you help me to understand what is going on?

Thanks

tanliwei-coder commented 1 month ago

Sorry! Stereopy can not support h5seurat.