jianhuupenn / TESLA

Deciphering tumor ecosystems at super-resolution from spatial transcriptomics with TESLA
MIT License
38 stars 10 forks source link

[TESLA] Transfer core/edge to original visium spot #15

Closed jpark27 closed 4 months ago

jpark27 commented 4 months ago

Dear @jianhuupenn,

Hello, again! Sorry for bugging you again. With previous support, I manage to sucessfully run all steps with toy and in-house data :-)

At last, I have been wanting to transfer super-resolution tumour core/edge information to original spots.

image image

Although I recognise you commented on this issue (https://github.com/jianhuupenn/TESLA/issues/7) before, but would you mind give practically how one would do such 'transfer'?

I am asking you this as initially I thought I would use pixel 'x_y' in between 'adata (visium)' and 'enhanced_exp_adata' but seemingly there's no points are having exactly same x, y values at the end. adata.obs['x_y']=adata.obs['x4'].astype(str)+str('_')+adata.obs['x5'].astype(str) enhanced_exp_adata.obs['x_y']=enhanced_exp_adata.obs['x'].astype(str)+str('_')+enhanced_exp_adata.obs['y'].astype(str)

Any tips would be really appreciated!

best wishes, J

jianhuupenn commented 4 months ago

Here is the pseudo code:

ret=[]
for each spot:
    get its x and y coordinates
    identify=annotated image [x, y], this identify can be tumor core, edge, or neither
    ret.append(identify)

return ret