Code for SPS calculations
Description
Codes to calculate spatial proximity scores (SPSs) between multiplexed cell units (MCUs), used in the paper "Cellular state landscape and herpes simplex virus type 1 infection progression are connected" by Pietilä et al., 2023.
Files
Steps to reproduce
SPSs between MCUs were calculated per cell by grouping neighboring pixels (8-connectivity) of each MCU based on their MCU identity and then dividing the number of neighboring pixels in each MCU group by the total number of neighbors. To assess significance of the SPSs in the original cells, the original MCU identities of pixels, not the coordinates, were randomly permutated per cell and a randomized SPS was then recalculated. The permutations and calculations were repeated 1,000 times per cell. The mean of these randomization controls was then subtracted from the original SPS per MCU-interaction pair per cell.