Closed HenryJinZH closed 2 days ago
Hi Henry, it works fine for me either on crop10 or the wholemap 10X CRC data. can you share your code when loading the full_data? According to the error, it seems to be the inability to construct spatial neighbors.
Hi Silaschuwen. I also tried download the test data from 10x website and it showed the same error. But in other 10x HD datasets I tested, HDST worked pretty well. Here's how I read in the full_data.
path = '/data2/crc_hd/Human_Colon_Cancer_P2/'
hd_data_square_002um_path = path+'square_002um/'
hd_fullres_img_btf_path = path+'Visium_HD_Human_Colon_Cancer_P2_tissue_image.btf'
full_data = sthdio.STHD(
spatial_path = hd_data_square_002um_path, counts_data = 'filtered_feature_bc_matrix.h5', full_res_image_path = hd_fullres_img_btf_path,
load_type = 'original')
It is caused by NaN in spatial coordinates, and removing them will do.
invalid_indices = np.where(np.isnan(full_data.adata.obsm['spatial']))[0]
full_data.adata= full_data.adata[~np.isin(range(full_data.adata.shape[0]), invalid_indices)]
Hi Henry, it looks related to squidpy visium loading function. Could you kindly share your squidpy and scanpy version?
Hi Henry, it looks related to squidpy visium loading function. Could you kindly share your squidpy and scanpy version?
My Squidpy version is 1.6.0, and Scanpy version is 1.10.2.
We found this is due to directly operating STHD on the level of full-size VisiumHD data, which triggers spatial neighbor errors in squidpy. Actually STHD training is designed for patch-level sizes post cropping - we have tested sizes up to 9000 x 9000 full-resolution pixels, about 1/11 of a full-size VisiumHD area. We're testing this limit to provide updates. Thank you!
Tutorials for automatic patchifying followed by STHD modeling and patch merging, are available across notebooks/ s11_patchify.ipynb, s12_per_patch_train.ipynb, s13_combine_patch.ipynb.
Problem Description
I encountered an issue when running the following code:
An error occurred while processing the test 10x CRC data, but everything worked fine when I tested HDST on other 10x datasets.
The error message is as follows:
Has anyone encountered a similar issue before? Any help or suggestions would be greatly appreciated!