Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhanced_exp_adata.X is NA #18

Open
travell1993 opened this issue May 23, 2024 · 4 comments
Open

enhanced_exp_adata.X is NA #18

travell1993 opened this issue May 23, 2024 · 4 comments

Comments

@travell1993
Copy link

Thank you very much for your software. However, when I used tissue_hires_image. png as the input image, The results of enhanced_exp_1data.X are all NA. After consulting the community tutorial, I understand that this is due to a mismatch between the image and location information. I would like to know if it is necessary to use images from. tif files in order to run your software? If there is only the tissue_hires_image. png file, what kind of processing does it need to go through?

@wuxiangning
Copy link

hello! have u solve this issue?

@xiaomaoxilian
Copy link

hello! Before generating the h5ad file, you can adjust pixel_x and pixel_y coordinates by multiplying them with the corresponding magnification factor found in the accompanying document.

@wuxiangning
Copy link

well.I did this, but this error still present.can u give us u code please?
Thank u very much!

@xiaomaoxilian
Copy link

xiaomaoxilian commented Dec 26, 2024

from scanpy import read_10x_h5

adata = read_10x_h5("../data/filtered_feature_bc_matrix.h5")
spatial=pd.read_csv("../data/tissue_positions_list.csv",sep=",",header=None,na_filter=False,index_col=0)
adata.obs["x1"]=spatial[1]
adata.obs["x2"]=spatial[2]
adata.obs["x3"]=spatial[3]
adata.obs["x4"]=spatial[4]*0.12207031
adata.obs["x5"]=spatial[5]*0.12207031
adata.obs["array_x"]=adata.obs["x2"]
adata.obs["array_y"]=adata.obs["x3"]
adata.obs["pixel_x"]=adata.obs["x4"]
adata.obs["pixel_y"]=adata.obs["x5"]
#Select captured samples
adata=adata[adata.obs["x1"]==1]
adata.var_names=[i.upper() for i in list(adata.var_names)]
adata.var["genename"]=adata.var.index.astype("str")
adata.write_h5ad("../data/colo4_data.h5ad")```


Hope these codes can help u.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants