SpaGCN
SpaGCN copied to clipboard
spg.calculate_adj_matrix is making all Nan with our own FFPE histology image
Hello, Thank you for making SpaGCN available to community. When I am trying SpaGCN with my own FFPE histology images on a 10X Visum data, the spg.calculate_adj_matrix is producing all Nan for the Adjacency matrix. I run the following command
adj=spg.calculate_adj_matrix(x=x_pixel,y=y_pixel, x_pixel=x_pixel, y_pixel=y_pixel, image=img, beta=b, alpha=s, histology=True)
But the adj
matrix is all zero. Can you please help me to solve this?
Thank you.
Thank you for your interest in SpaGCN. I would recommend you double-check if you are using the correct image, which matches the pixel_x and pixel_y coordinates. If the coordinates do not match, you will get "nan" for the colour values, and the adj becomes "nan".
I have helped other people solve the same problem on GitHub: https://github.com/jianhuupenn/SpaGCN/issues/7#issuecomment-962761985
Hello, Thank you for making SpaGCN available to community. When I am trying SpaGCN with my own FFPE histology images on a 10X Visum data, the spg.calculate_adj_matrix is producing all Nan for the Adjacency matrix. I run the following command
adj=spg.calculate_adj_matrix(x=x_pixel,y=y_pixel, x_pixel=x_pixel, y_pixel=y_pixel, image=img, beta=b, alpha=s, histology=True)
But the
adj
matrix is all zero. Can you please help me to solve this?Thank you.
I had the same problem but I think I find out the reason why 10X Visum data coordinates do not match the image, there is a file called 'scalefactors_json.json' in the 'spatial' folder, which can adjust the coordinates to match the image, and you can use it to adjust the coordinates to fit the image
Hello, Thank you for making SpaGCN available to community. When I am trying SpaGCN with my own FFPE histology images on a 10X Visum data, the spg.calculate_adj_matrix is producing all Nan for the Adjacency matrix. I run the following command
adj=spg.calculate_adj_matrix(x=x_pixel,y=y_pixel, x_pixel=x_pixel, y_pixel=y_pixel, image=img, beta=b, alpha=s, histology=True)
But the
adj
matrix is all zero. Can you please help me to solve this? Thank you.I had the same problem but I think I find out the reason why 10X Visum data coordinates do not match the image, there is a file called 'scalefactors_json.json' in the 'spatial' folder, which can adjust the coordinates to match the image, and you can use it to adjust the coordinates to fit the image
But how do you convert the spaceranger output image to match the pixels in Squidpy? I have to load the original image file to resolve this issue.
Hello, Thank you for making SpaGCN available to community. When I am trying SpaGCN with my own FFPE histology images on a 10X Visum data, the spg.calculate_adj_matrix is producing all Nan for the Adjacency matrix. I run the following command
adj=spg.calculate_adj_matrix(x=x_pixel,y=y_pixel, x_pixel=x_pixel, y_pixel=y_pixel, image=img, beta=b, alpha=s, histology=True)
But the
adj
matrix is all zero. Can you please help me to solve this? Thank you.I had the same problem but I think I find out the reason why 10X Visum data coordinates do not match the image, there is a file called 'scalefactors_json.json' in the 'spatial' folder, which can adjust the coordinates to match the image, and you can use it to adjust the coordinates to fit the image
But how do you convert the spaceranger output image to match the pixels in Squidpy? I have to load the original image file to resolve this issue.
I mainly use R analysis, and here I use scanpy to load the data, so I don't know Squidpy very well
@galib36 @Kennyluo4 did you ever solve this issue? I am trying to run spagcn with histology image tissue_hires_image.png
but I'm also getting nans. I'm not sure how to use the scalefactors_json.json
file
@galib36 @Kennyluo4 did you ever solve this issue? I am trying to run spagcn with histology image
tissue_hires_image.png
but I'm also getting nans. I'm not sure how to use thescalefactors_json.json
file
Long story short, the error was raised because the coordinates do not match the HE image provided. For details, pls refer to #7
Thanks for the reference @jianhuupenn ! I figured out the issue is my HE image is not the full .tif
image, so you had to scale the coordinates down by a scaling factor. I put my code to do this in #85 if it is helpful.