Simulate larger systems

For more practicability, the matrix of Transition rates in module Simulation is limited to a five-state system. The simulation of larger systems requires to import FRET states and transition rates from an external pre-set parameter file.

To create and import simulation parameters for a large state system, follow the procedure described below.

Procedure

  1. Create a pre-set file
  2. Load pre-set in Simulation

Create a pre-set file

The pre-set parameter file is a MATLAB binary file that can be created with the template file createSimPrm.m in MATLAB’s editor.

To simulate a J-states system with J greater than 5, the pre-set parameter file needs to contain the J2 state transition rates kjj’ defined for each of the N molecules in the sample.

State transition rates are defined in the trans_rates variable of the template and as a J-by-J-by-N matrix, where the cell (row j, column j’) concerns the unidirectional transition from state j to state j’.

Transition rates are given in second-1 and set to zero to forbid particular state transitions. The diagonal is naturally ignored during the simulation process and can be set to zero.

For example, the script below can be used to define a transition rate matrix for the 10-states system, allowing only step-wise transitions and with uniform rate coefficients kjj’ = 0.1 second-1, except for the transition from state 2 to state 3 (FRET3=0.3 to FRET4=0.4) that is governed by a rate coefficient of 0.5 second-1:

%%%%% EDIT HERE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% defines 10-by-10 transition rates
trans_rates = [ 0   0.1 0   0   0   0   0   0   0   0
		0.1 0   0.1 0   0   0   0   0   0   0
		0   0.1 0   0.5 0   0   0   0   0   0
		0   0   0.1 0   0.1 0   0   0   0   0
		0   0   0   0.1 0   0.1 0   0   0   0
		0   0   0   0   0.1 0   0.1 0   0   0
		0   0   0   0   0.1 0   0.1 0   0   0
		0   0   0   0   0   0.1 0   0.1 0   0
		0   0   0   0   0   0   0.1 0   0.1 0
		0   0   0   0   0   0   0   0.1 0   0.1
		0   0   0   0   0   0   0   0   0.1 0  ];

% replicate the same transition rates matrix for all molecules with the repmat function
trans_rates = repmat(trans_rates,[1 1 N]);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

To build and export the pre-set parameter file:

  1. Open the pre-set template in MATLAB’s editor by going to MATLAB’s menu HOME → Open → Open ... and selecting the file MASH-FRET/tools/createSimPrm.m.

  2. Define the variables FRET and trans_rates in the corresponding sections of the template

  3. Run the script by pressing Run in MATLAB’s menu EDITOR and export the pre-set file.


Load pre-set in Simulation

To use the pre-set state configuration and transition rates, the pre-set file must be imported in module Simulation.

After successful import, the fields used to edit the Number of molecules, the number of states in State configuration and the Transition rates will be locked. Fields will be rendered editable when removing the pre-set file.

To import pre-sets fro simulation:

  1. Load the pre-sets by pressing ... in Pre-set parameters and selecting the corresponding file