You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to use SpaGCN on Visium HD data that I've binned. I was wondering what the ideal beta value to use would be? After binning the 2micron bins the anndata object has a calculated spot size diameter. Would it be appropriate to use that value or the 2 micron bin size for performing clustering?
Also I'm running into an error with running clustering with histology where slice indices are not being returned as integers.
# Read in full resolution image
img = cv2.imread(source_image_path)
# Calculate adjacent matrix
adj = spg.calculate_adj_matrix(
x = x_pixel,
y = y_pixel,
x_pixel = x_pixel,
y_pixel = y_pixel,
image = img,
beta = 29.367863437955762,
alpha = 1,
histology = True,
)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[16], [line 2](vscode-notebook-cell:?execution_count=16&line=2)
[1](vscode-notebook-cell:?execution_count=16&line=1) # Calculate adjacent matrix
----> [2](vscode-notebook-cell:?execution_count=16&line=2) adj = spg.calculate_adj_matrix(
[3](vscode-notebook-cell:?execution_count=16&line=3) x = x_pixel,
[4](vscode-notebook-cell:?execution_count=16&line=4) y = y_pixel,
[5](vscode-notebook-cell:?execution_count=16&line=5) x_pixel = x_pixel,
[6](vscode-notebook-cell:?execution_count=16&line=6) y_pixel = y_pixel,
[7](vscode-notebook-cell:?execution_count=16&line=7) image = img,
[8](vscode-notebook-cell:?execution_count=16&line=8) beta = 29.367863437955762,
[9](vscode-notebook-cell:?execution_count=16&line=9) alpha = 1,
[10](vscode-notebook-cell:?execution_count=16&line=10) histology = True,
[11](vscode-notebook-cell:?execution_count=16&line=11) )
File /data/williamsd7/conda/envs/spatialstuff/lib/python3.12/site-packages/SpaGCN/calculate_adj.py:57, in calculate_adj_matrix(x, y, x_pixel, y_pixel, image, beta, alpha, histology)
[55](https://vscode-remote+ssh-002dremote-002bcn4248.vscode-resource.vscode-cdn.net/data/williamsd7/conda/envs/spatialstuff/lib/python3.12/site-packages/SpaGCN/calculate_adj.py:55) max_x=image.shape[0]
[56](https://vscode-remote+ssh-002dremote-002bcn4248.vscode-resource.vscode-cdn.net/data/williamsd7/conda/envs/spatialstuff/lib/python3.12/site-packages/SpaGCN/calculate_adj.py:56) max_y=image.shape[1]
---> [57](https://vscode-remote+ssh-002dremote-002bcn4248.vscode-resource.vscode-cdn.net/data/williamsd7/conda/envs/spatialstuff/lib/python3.12/site-packages/SpaGCN/calculate_adj.py:57) nbs=image[max(0,x_pixel[i]-beta_half):min(max_x,x_pixel[i]+beta_half+1),max(0,y_pixel[i]-beta_half):min(max_y,y_pixel[i]+beta_half+1)]
[58](https://vscode-remote+ssh-002dremote-002bcn4248.vscode-resource.vscode-cdn.net/data/williamsd7/conda/envs/spatialstuff/lib/python3.12/site-packages/SpaGCN/calculate_adj.py:58) g.append(np.mean(np.mean(nbs,axis=0),axis=0))
[59](https://vscode-remote+ssh-002dremote-002bcn4248.vscode-resource.vscode-cdn.net/data/williamsd7/conda/envs/spatialstuff/lib/python3.12/site-packages/SpaGCN/calculate_adj.py:59) c0, c1, c2=[], [], []
TypeError: slice indices must be integers or None or have an __index__ method
Thanks
The text was updated successfully, but these errors were encountered:
Hi,
I'm attempting to use SpaGCN on Visium HD data that I've binned. I was wondering what the ideal beta value to use would be? After binning the 2micron bins the anndata object has a calculated spot size diameter. Would it be appropriate to use that value or the 2 micron bin size for performing clustering?
Also I'm running into an error with running clustering with histology where slice indices are not being returned as integers.
Thanks
The text was updated successfully, but these errors were encountered: