seqscope / ficture

https://seqscope.github.io/ficture/
Other
29 stars 3 forks source link

match coordinate in pixel.sorted.tsv with coordinate in tissue_position.parquet (visiumHD) #21

Open seongju-cho opened 1 month ago

seongju-cho commented 1 month ago

Hello,

First of all, thank you for making the wonderful method!

I'm working with visiumHD data to get pixel-level annotation Output pixel-level annotation image align perfectly with H&E staining image (some factor successfully capture tumor regions)

Now I'm struggle with matching final output (pixel.sorted.tsv) to raw input (tissue_position.parquet) My goal is to match coordinate in pixel.sorted.tsv with coordinate or cell barcode in tissue_position.parquet

Could you please give me some advices to deal with this problem?

My data is looks like below

nF10.d_12.decode.prj_12.r_4_5.pixel.sorted.tsv

##K=10;TOPK=3
##BLOCK_SIZE=2000;BLOCK_AXIS=X;INDEX_AXIS=Y
##OFFSET_X=3697.29;OFFSET_Y=1595.09;SIZE_X=6739;SIZE_Y=6736;SCALE=100
#BLOCK  X   Y   K1  K2  K3  P1  P2  P3
0   110940  1231    6   8   5   9.87e-01    1.22e-02    7.88e-04
0   111151  1231    5   6   4   1.00e+00    3.81e-04    1.10e-05
0   111351  1231    5   6   3   1.00e+00    3.27e-04    9.42e-05
0   111951  1231    5   6   8   9.99e-01    4.13e-04    8.98e-05
0   112140  1231    8   5   6   1.00e+00    2.64e-13    1.98e-13
0   112340  1231    8   5   6   9.88e-01    1.13e-02    7.02e-04

batched.matrix.tsv.gz

#barcode_idx    random_index    X   Y   gene_id gene    Count
1   266677818472975 1698.07 479.15  ENSG00000106009 BRAT1   1
1   266677818472975 1698.07 479.15  ENSG00000118217 ATF6    1
1   266677818472975 1698.07 479.15  ENSG00000118849 RARRES1 1
1   266677818472975 1698.07 479.15  ENSG00000138759 FRAS1   1
1   266677818472975 1698.07 479.15  ENSG00000146733 PSPH    1
1   266677818472975 1698.07 479.15  ENSG00000154640 BTG3    1
1   266677818472975 1698.07 479.15  ENSG00000158864 NDUFS2  1
1   266677818472975 1698.07 479.15  ENSG00000275395 FCGBP   1
33  266677818472975 1710.34 540.29  ENSG00000071575 TRIB2   1

transcripts.tsv

#barcode_idx    X   Y   gene_id gene    Count
2436295 848.02  345.36  ENSG00000054118 THRAP3  1
2436295 848.02  345.36  ENSG00000109472 CPE 1
7385825 848.45  345.36  ENSG00000112118 MCM3    1
7385825 848.45  345.36  ENSG00000138670 RASGEF1B    1
7385825 848.45  345.36  ENSG00000188243 COMMD6  1
7385825 848.45  345.36  ENSG00000205542 TMSB4X  1
3270763 848.88  345.36  ENSG00000134371 CDC73   1
3270763 848.88  345.36  ENSG00000160551 TAOK1   1
4752802 849.31  345.36  ENSG00000057252 SOAT1   1

tissue_positions.csv (converted from tissue_positions.parquet)

barcode,in_tissue,array_row,array_col,pxl_row_in_fullres,pxl_col_in_fullres
s_002um_00000_00000-1,0,0,0,807.323551123292,345.194674672535
s_002um_00000_00001-1,0,0,1,807.321405086697,345.627668494288
s_002um_00000_00002-1,0,0,2,807.319259049766,346.060662383687
s_002um_00000_00003-1,0,0,3,807.3171130125,346.493656340733
s_002um_00000_00004-1,0,0,4,807.314966974898,346.926650365426
s_002um_00000_00005-1,0,0,5,807.312820936961,347.359644457765
s_002um_00000_00006-1,0,0,6,807.310674898689,347.79263861775
s_002um_00000_00007-1,0,0,7,807.308528860082,348.225632845383
s_002um_00000_00008-1,0,0,8,807.306382821139,348.658627140662

I wish to match (x, y) in pixel.sorted.tsv with barcode in tissue_position.csv

Thanks, SeongJu Cho

Yichen-Si commented 4 days ago

https://github.com/seqscope/ficture/issues/7#issuecomment-2322263199