seqscope / ficture

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

plot_pixel not show the entire tissue #14

Closed cherrie-g closed 1 month ago

cherrie-g commented 2 months ago

Hi, I‘m using FICTURE on Stereo-seq data. And I transform the Stereo-seq expression matrix to the input format and sort by X axis as below:

X       Y       gene    Count
2583    6797    Esyt2   1
2584    6797    Calm3   3
2584    6811    Mrpl37  1
2584    6797    Jarid2  2
2585    6792    Apoe    1
2585    6817    Ssr1    2
2585    6792    Vim     1
2585    6817    Acsbg1  1
2585    6799    Rpl10a  1
...

Then I ran FICTURE like this:

ficture run_together \
    --in-tsv /path/transcripts.tsv.gz \
    --in-minmax /path/coordinate_minmax.tsv \
    --out-dir output \
    --major-axis X \
    --mu-scale 2 \
    --train-width 12,15,18 \
    --n-factor 6,12 \
    --anchor-res 4 \
    --n-jobs 4 \
    --plot-each-factor \
    --all

The head lines of the *.pixel.sorted.tsv.gz were like:

##K=6;TOPK=3
##BLOCK_SIZE=2000;BLOCK_AXIS=X;INDEX_AXIS=Y
##OFFSET_X=2583;OFFSET_Y=2268;SIZE_X=7864;SIZE_Y=5699;SCALE=100
#BLOCK  X       Y       K1      K2      K3      P1      P2      P3
0       0       0       0       1       2       1.00e+00        1.00e-07        6.71e-08
0       0       0       0       1       2       1.00e+00        1.00e-07        9.60e-12
0       0       0       0       1       2       1.00e+00        1.00e-12        2.14e-16
0       0       0       0       1       2       1.00e+00        1.00e-14        3.04e-15
0       0       0       0       1       2       1.00e+00        1.00e-14        3.04e-15

Python version in my environment was 3.9. Could you find what's wrong with my run?

hyunminkang commented 2 months ago

I think the current code has a bug when mu_scale is not 1. We will work on fixing the bug. In the meantime, please change your spatial coordinate so that it is micrometer scale, and set mu_scale=1.

cherrie-g commented 2 months ago

It works. Thanks! Is there any parameter recommendation for Stereo-seq?

camelest commented 2 months ago

@cherrie-g Hi, do you mind sharing how you converted the spatial coordinate so that mu_scale would be 1? Did you use the distance of 500 (or 715 nm??) for distance 1 in the spatial coordinate for the conversion? Thank you so much for your help.

cherrie-g commented 2 months ago

@cherrie-g Hi, do you mind sharing how you converted the spatial coordinate so that mu_scale would be 1? Did you use the distance of 500 (or 715 nm??) for distance 1 in the spatial coordinate for the conversion? Thank you so much for your help.

I just extract the 'gene', 'x', 'y', 'MIDCount' column in gem file. And sort by either axis, calculate the max and min value of x, y.

camelest commented 2 months ago

@cherrie-g @hyunminkang Thank you so much, I see. Don't we need to convert x and y coordinate by

new_x = original_x_from_gem * 0.5 (or 0.715??)

or something to set mu_scale=1?

cherrie-g commented 2 months ago

@cherrie-g @hyunminkang Thank you so much, I see. Don't we need to convert x and y coordinate by

new_x = original_x_from_gem * 0.5 (or 0.715??)

or something to set mu_scale=1?

That's maybe more reasonable I think.