Oshlack / speckle

R package for specialised analysis of single cell data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to fit the cell type proportion of spots in visium spatial transcriptome data?

Feng-Zhang opened this issue · comments

How can I perform a variance stabilizing transformation on the proportions estimated by spacexr?
I have the weight matrix below, where row is spot id, column is cell type name, the number in the matrix is the proportion of cell types estimated by spacexr. The sum of each row should equal 1, and here is not since I didn't copy the complete matrix.

                          1            2            3            4            5            6            7
TAAGTTGTGAGGCC 2.292692e-01 3.005909e-05 3.005909e-05 3.005909e-05 3.670932e-01 8.926548e-02 3.005909e-05
GTGCCCCTATCCTG 6.675664e-05 6.675664e-05 6.675664e-05 6.675664e-05 1.318198e-01 6.675664e-05 6.675664e-05
ATGTGCCACATCGG 4.807096e-05 4.807096e-05 4.807096e-05 4.807096e-05 4.807096e-05 1.421878e-01 4.807096e-05
CCGCCGTCTCGATG 3.486809e-05 3.486809e-05 3.486809e-05 3.486809e-05 3.377137e-01 1.014989e-01 3.486809e-05
CAGCTCGTGCTTGA 7.590008e-05 5.721524e-02 7.590008e-05 7.590008e-05 8.041539e-02 5.677883e-01 7.590008e-05
GGCTGGCTGAGGCC 3.149211e-01 1.422552e-01 4.985062e-05 4.985062e-05 2.484134e-01 2.703381e-01 4.985062e-05
TAGGCTGAAGACTG 3.297390e-05 7.494110e-02 3.297390e-05 3.297390e-05 4.182647e-01 2.697740e-01 3.297390e-05
CTTCCGGCATGTCC 1.120751e-04 1.120751e-04 1.120751e-04 1.120751e-04 1.525209e-01 1.120751e-04 1.120751e-04
GCCCCCCATCTGCT 5.294217e-05 5.294217e-05 5.294217e-05 9.104908e-03 5.294217e-05 5.294217e-05 5.294217e-05
AGCTTATTACGTTG 2.840802e-01 1.751406e-01 7.671817e-05 7.671817e-05 5.297927e-02 3.203129e-01 7.671817e-05
AAGGTATCTCAACA 5.380602e-05 5.380602e-05 5.380602e-05 5.380602e-05 6.988223e-02 2.613118e-01 1.747145e-01
CGTTACACACCTCA 5.586827e-05 5.586826e-05 4.689468e-02 1.542028e-02 2.801799e-01 2.109863e-01 5.586827e-05
TGGTTGAGCGATCT 8.984323e-05 2.333192e-02 8.984323e-05 8.984322e-05 1.156254e-01 2.123683e-01 8.984323e-05
GTGGAACCAGCCAA 2.007825e-02 2.777721e-01 6.859269e-05 3.259486e-02 2.409382e-01 4.167652e-02 6.859269e-05
CGGCCGTGCCCACC 6.511133e-05 6.511133e-05 6.511133e-05 6.511133e-05 2.127825e-02 1.997856e-01 6.511133e-05
TTCTGGTTTCTGGC 1.322819e-04 6.351707e-02 1.322819e-04 1.322819e-04 1.415326e-01 1.322819e-04 1.005996e-01
CTGATTGTGCTCAT 2.495690e-01 8.105902e-02 9.274481e-05 9.274481e-05 1.988514e-01 2.882024e-01 9.274481e-05
CACATATGCCTCCT 6.145991e-05 6.145991e-05 6.145991e-05 1.072262e-01 6.145991e-05 1.820542e-01 1.421808e-02
TATCTGTGAAGGAC 6.533813e-05 6.533814e-05 6.533813e-05 6.533813e-05 1.564585e-01 6.533813e-05 6.533813e-05
TGACATATTCATCT 9.465732e-05 8.512554e-03 9.465732e-05 3.381593e-03 9.465732e-05 3.107101e-01 9.465732e-05
CGGCTGGCTCGACC 6.702389e-05 6.702389e-05 6.702389e-05 1.869455e-03 6.702389e-05 1.451687e-01 6.702389e-05
AAGGCTCTACATCA 3.417982e-05 3.417982e-05 3.417982e-05 3.417982e-05 4.057332e-01 2.507974e-01 3.417982e-05
TATGCCCAGGACAG 3.380197e-02 5.018601e-03 1.290414e-04 1.290414e-04 1.290414e-04 1.290414e-04 1.290414e-04
ATGAGTCCACATCT 7.904215e-05 7.904215e-05 7.904215e-05 6.282745e-03 1.597886e-01 3.748211e-01 7.904215e-05
ATCTTTCCTTCAAA 8.409195e-05 8.409195e-05 8.409195e-05 8.409195e-05 8.409195e-05 3.419672e-01 8.409195e-05
CTTTTGCTCCGGAA 7.613547e-05 7.613547e-05 7.613547e-05 7.613547e-05 7.613547e-05 4.174179e-01 1.912609e-02

By the way, would the scale.fac value largely affects the test results? In prop.list <- convertDataToList(sexprops,data.type="proportions", transform="logit", scale.fac=174684/20) vignette, scale.fac seems just equal the total number of cells divided by sample number, which is the mean number of cell for each samples rather than the exact vector of the total number of cells N for each sample.