STOmics / Stereopy

A toolkit of spatial transcriptomic analysis.
MIT License
193 stars 64 forks source link

ms_data.integrate TypeError: merge() got an unexpected keyword argument 'var_type' #219

Closed nh-codem closed 9 months ago

nh-codem commented 10 months ago

I followed the tutorial on constructing MSData object by converting the anndata to add it to ms_data and after loading the data I encountered the following error when I did the "integrate":

### Load Multi Slices
adata_list = []
retain_chips = ["TX0","TX1","TX2"]
for file in tqdm(glob.glob('my_path/*.h5ad', recursive=False)):
    if re.search(r'([\w.]+).h5ad$', file).group(1) not in retain_chips: continue
    adata = ad.read_h5ad(file)
    adata.uns['chipid'] = re.search(r'([\w.]+).h5ad$', file).group(1)
    adata_list.append(adata)
    del(adata)

adata_dic = {item.uns['chipid']:item for item in adata_list}
adata_list_sorted = [adata_dic[i] for i in retain_chips]
del adata_list,adata_dic

ms_data = MSData(_relationship='continue', _var_type='union')
for slice in tqdm(adata_list_sorted):
    ms_data += st.io.anndata_to_stereo(slice,spatial_key = 'spatial')
    del slice

image

Also, I found "st.io.write_h5ms(ms_data,output='N_slices.h5ms') " fails to export the data with the following prompt: image

Release was installed on 28 November 2023 following the tutorials.

Zhenbin24 commented 10 months ago

Hello, please specify the version when installing stereopy(pip install stereopy==0.14.0b1), otherwise the stable version will be used by default. image

nh-codem commented 10 months ago

pip install stereopy==0.14.0b1

error occured:

(stereoPy) DESKTOP-UJG0K5B Thu Nov 30 16:35:57 ~ $pip install stereopy==0.14.0b1 ERROR: Ignored the following versions that require a different python version: 0.10.0 Requires-Python >=3.8,<3.9; 0.11.0 Requires-Python >=3.8,<3.9; 0.12.0 Requires-Python >=3.8,<3.9; 0.12.1 Requires-Python >=3.8,<3.9; 0.13.0b1 Requires-Python >=3.8,<3.9; 0.14.0b1 Requires-Python >=3.8,<3.9; 0.8.0 Requires-Python >=3.7,<3.9; 0.9.0 Requires-Python >=3.8,<3.9 ERROR: Could not find a version that satisfies the requirement stereopy==0.14.0b1 (from versions: 0.1, 0.1.9, 0.2.0, 0.2.1, 0.2.1.1, 0.2.2, 0.2.3, 0.2.4, 0.3.0, 0.3.1, 0.4.0, 0.5.0, 0.5.1, 0.6.0, 0.7.0) ERROR: No matching distribution found for stereopy==0.14.0b1

Zhenbin24 commented 10 months ago

Hello, you can reinstall a new environment to solve this problem. Please refer to the link for details. Note that you need to use python3.8.