DOI: 10.6084/m9.figshare.27824757.v1
title: "Spontaneous switching in a protein signaling array reveals near-critical cooperativity"

description: Readme file for the data and code belonging to the manuscript “Spontaneous switching in a protein signaling array reveals near-critical cooperativity” by Keegstra, Avgidis and coworkers.

Amsterdam and Zurich
September 2025 

1. OVERVIEW

This dataset and code consists of a single zip file, with therein everything to reproduce the main figures of the manuscript.
1. All the MATLAB scripts to analyse the experiments.
2. All Python scripts to perform numerical simulations and MATLAB scripts to analyse the Ising simulation results.
3. All the FRET time series, raw and analysed.
4. For each main figure, there is a folder “figure_X” that contains the data and code to reproduce the figure.

2. VERSIONS AND INSTALLATION
All python scripts are compatible with Python 3.7.11 or newer. he packages listed at the top of the file (with ‘import’) all need to be installed if not part of the Python distribution already (most easily through the terminal command: conda install -c conda-forge [package]). The typical installation time will depend on specifications of the local machine, but for most packages is a matter of minutes. There are no special hardware specifications known for these packages, but in case of doubt consult the 

MATLAB is 2019b or newer with statistics toolbox. Installation according to Mathworks instructions. 

3. CODE TO ANALYSE FRET EXPERIMENTS

All experimental data are contained in the MATLAB file `all_experiments_TC_flanking_SNR.mat`.

To extract switching events from the experimental data, run the script `start_here.m` in the `analysis_code_experiments` folder. This script will load the raw FRET time series from `all_experiments_TC_flanking_SNR.mat` and extract all switching statistics.

To analyse raw fluorescent data, we refer to our previous publication: Keegstra et al. , eLife 2017 (https://elifesciences.org/articles/27455).
For completeness, the image processing script (python) is included in the data and software package.

4. CODE TO PERFORM AND ANALYSE ISING SIMULATIONS

The main script to perform the Ising simulations is ising-lattice-parallel-rates.py. [Note one difference in this file is a different definition of J compared to the hamiltonian defined in the manuscript. A value of J=4 in the script is equivalent to J=4/8=0.5 kT as used in the paper.]. 

This script contains a function main that allows it to be executed from the command line. Windows users need to often comment out the last lines of the script, as indicated. For executing it in the command line it can be done by for example the command: python ising-lattice-parallel.py -node XX -nNodes XX -seed XX -OutputFile XX, where XX indicates the appropriate variable values.

To run a simulation on a desktop machine from a code editor like Spyder, use the IsingSimulationsDemo.py script. Typical simulations as performed in the manuscript (e.g. 1000+ time series of 2000 x omega_o s.) require approximately 12-36 hours of computation time on a normal desktop computer, with increasing coupling energy (J) decreasing the computation time. The code makes use of the multiprocessing package for parallel computation, but this is optional. The output of the simulation can be adapted to the user needs, but typically the array states are not saved at intermediate time points to prevent data explosion when computing large arrays, and the minimum output should be a time and activity vector.

To analyse the results of the Ising simulations with Matlab code, the Python pickle files can be converted to matlab using the pickletomat.py script.
To extract switching events from the simulation data, run the script `start_here.m` in the `analysis_code_simulations` folder. All analysed data is included as well as a a single raw simulation data MATLAB file to demonstrate how the analysis code functions. The complete simulation dataset is available upon reasonable and unreasonable requests.

5. CODE TO PLOT THE FIGURES
To generate figures, refer to the scripts within each figure subfolder together with the analysed data. Each folder contains the source data for each figure. Paths may need to be adjusted to run on a local machine.