(By Ting Chen, Fengnan Gao and Yan-Wen Tan)
Implementation in MATLAB of WAVE (Wasserstein distance Analysis in steady-state Variations in smFRET) to detect and locate non-equilibrium transition positions in FRET trajectories, which is first introduced in Chen, Gao and Tan (2023).1
-
TestNonequilibrium3
: The core of WAVE and the main function. -
MakeNonequilibriumHMMPoissonData
: This script generates simulated data (FRET trajectories) via HMM. -
NonequilibriumCompare
: This script evaluates the analysis result afterTestNonequilibrium3
has finished processing the simulated data generated byMakeNonequilibriumHMMPoissonData
.
Run TestNonequilibrium3
script in Matlab, and select a folder with structure as follows:
Folder_name (a folder containing all FRET trajectories)
-->XXX.txt (records of intensity-time trajectory, containing 2 columns data with same length. The first column is the intensity-time trajectory of donor channel, and the second column is the intensity-time trajectory of acceptor channel)
------E (a folder containing FRET efficiency and region information of all trajectories in FRET folder)
--------->XXX.txt Efficiency.txt (corresponding to XXX.txt, and recording FRET efficiency-time trajectory in the first column, of the same length as intensity-time trajectory. In FRET region: [FRETbegin, FRETend]
, the recorded FRET efficiency~=0
, while in crosstalk region [Crosstalkbegin, Crosstalkend]
and background region [Backgroundbegin, Backgroundend]
, the recorded FRET efficiency=0
)
--------->XXX.txt Region.txt (corresponding to XXX.txt, records region boundaries. This file contains 6 elements, like follows [FRETbegin, FRETend, Crosstalkbegin, Crosstalkend, Backgroundbegin, Backgroundend]
)
We advise the user study the test
folder for this specific structure of organizing data.
test
├── BestHMMParameters2.mat
├── BNESTAnanysis.mat
├── DataSetInformation.mat
├── E
│ ├── test1.txt Efficiency.txt
│ ├── test1.txt Region.txt
│ ├── test2.txt Efficiency.txt
│ ├── test2.txt Region.txt
│ ├── test3.txt Efficiency.txt
│ ├── test3.txt Region.txt
| └── test3.txt Region.txt
├── test1.txt
├── test2.txt
└── test3.txt
Note: Set carefully the parameters in TestNonequilibrium3
before running, especially Changeframe
, which is the time point at which the conditions change and depends on the experimental design.
Follow the steps below:
- Create an empty folder
new_folder
to save simulated data. - Run
MakeNonequilibriumHMMPoissonData
with the newly created empty foldernew_folder
. - Run
TestNonequilibrium3
with the foldernew_folder
containing simulated data. - Evaluate the output with
NonequilibriumCompare
.
Note: The evaluation criteria in NonequilibriumCompare
should match the kinetic rate coefficients set in MakeNonequilibriumHMMPoissonData
. Read the comments in these scripts for details.
BNESTAnanysis is the output of TestNonequilibrium3
. It is a cell
table, with the following format
- 1st row: the name of each FRET trajectory (.txt file)
- 2nd row: the length of FRET trajectory after BNEST
- 3rd row: the last state before BNEST
- 4th row: the first state after BNEST
- 5th row: the trajectory length after condition change and before BNEST
- 6th row: the Length of last segment before BNEST
- 7th row: the FRET trajectory after BNEST
- 8th row: the fitting trajectory after BNEST
- STaSI part:
MDLMulit.m
,StategroupingMulti.m
,change_point_detection
. - HMM part:
HMM_Algorithm2.m
,HMM_Core.m
,HMM_Data_Preparation.m
,HMM_FitTrace_Get_Distribution.m
,HMM_MainSimple.m
,HMM_Max_Likelihood.m
Tcalculation.m
- MWD analysis part:
CountMatrixCalculation.m
,FindMaximumWassersteinDistance3.m
FindMaximumWassersteinDistanceHMMSequence.m
,TcalculationC.m
,FindMaximumWassersteinDistanceOutOrder.m
- Forward/Backward algorithm part:
FindBestTracePart2.m
,MDLCompare.m
- Data simulation and evaluation part:
MakeHMMPoissonData.m
,postcalculationTimeBin.m
,precalculationTimeBin.m
Footnotes
-
Chen, T., Gao, F. and Tan, Y-W. (2023) Transition Time Determination of Single-Molecule FRET Trajectories via Wasserstein Distance Analysis in Steady-state Variations in smFRET (WAVE) ↩