TESLA icon indicating copy to clipboard operation
TESLA copied to clipboard

Enhanced anndata contains only NaN values for gene expression

Open nrosewick opened this issue 1 year ago • 2 comments

I followed the tutorial using in-house 10X Visium data. I used filtered_feature_bc_matrix.h5, tissue_positions.csv and tissue_hires_image.png as input for Tesla. Countour detection works well using cnt=tesla.cv2_detect_contour(img, apertureSize=5,L2gradient = True) .

I proceed to the imputation

enhanced_exp_adata=tesla.imputation(img=img, raw=counts, cnt=cnt, genes=counts.var.index.tolist(), shape="none", res=res, s=1, k=2, num_nbs=10)

and when I check the enhanced_exp_adata.X all values are nan

Any idea how to solve this ?

Thank you

nrosewick avatar Jan 24 '24 14:01 nrosewick

Thanks for your interest in TESLA. 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 enhanced expression becomes "nan".

I have helped other people solve the same problem on GitHub: https://github.com/jianhuupenn/SpaGCN/issues/7#issuecomment-962761985

jianhuupenn avatar Jan 24 '24 15:01 jianhuupenn

Thank you for your prompt reply.

It was indeed an issue with the matching between pixel_x, y and array_x, y. I had to use the scalefactor provided by 10X spaceranger to have good match for pixels. Nevertheless will TESLA work smoothly with the tissue_hires_image.png generated by 10X spaceranger ( a downsampling image of the input file given to spaceranger).

Thank you

nrosewick avatar Jan 25 '24 13:01 nrosewick

hello! Could u tell me how to use 10X spaceranger to match pixels and arrays?I meet the NAN issue too when i use the tissue_hires_image.png to do this. Thanks

wuxiangning avatar Dec 09 '24 13:12 wuxiangning