1. Introductory information
---------------------------
Code and test data set for dwell time analysis underlying Kuijpers et al. Characterizing single-molecule dynamics of viral RNA-dependent RNA polymerases with multiplexed magnetic tweezers.

Authors:
Louis Kuijpers,1 Theo van Laar,1 Richard Janissen,1,2,* and Nynke H. Dekker,1,3,*
1Department of Bionanoscience, Kavli Institute of Nanoscience, 2629 HZ Delft, The Netherlands
2Technical contact
3Lead contact
*Correspondence: R.J. (r.janissen@tudelft.nl); N. H. D. (n.h.dekker@tudelft.nl)

2. Methodological information
-----------------------------

Test Data:
Bead position measurements were taken for 2 hours a constant pulling force of 25 pN at 24C at a camera acquisition rate of 50 Hz.

This script constructs a dwell time distribution of tanslocating polymerases, optimized for data acquired with Magnetic or Optical Tweezers. 
The main function is called <DWT_analysis>. All other files are different function upon which <DWT_analysis> depends; they should be in the same directory.
Below is a description of input arguments that <DWT_analysis> uses:


Input arguments:
----------------
 x_array = the array of enzyme position, converted to nucleotides [nt] or base pairs [bp].
 t_array = the array of timepoints; has to have the same length as x_array.
 Ts =  width of the filtering window in [nt] or [bp]; it is the number of points (odd number) over which the trace is being averaged.
 Nw =  width of the dwell time window. Since that x_array is given in the unit of [nt] or [bp], best choose an integer. 
 Ti = for histogram; Ti is the location of the first bin edge. 
 bins_per_decade = for histogram; defines number of bins per each decade. 
 number_of_decades = for histogram; defines number of decades spanned by the histogram. 
 correction = binary variable (0 or 1). 1: bin width is corrected to be a multiple of the temporal resolution (i.e. time between two consecutive data points).
 nboot = number of bootstrapped samples (integer). Bootstrapping is used to estimate the errorbars in the dwell time distribution.

Example:
--------
 <Example.m> = example script that computes and plots the dwell time distribution for the accompanied trace data example (<DataExample.mat>).

 The distribution does not look so nice due to lack of statistics. In order to have a nicely-looking histogram, one will need more trajectories to collect sufficient dwell times (typically having 10^4 to 10^5 dwell times would be ideal).

4. Sharing and Access information
The data is licenced under Attribution (CC BY-NC). This license lets others remix, tweak, and build upon your work non-commercially, and although their new works must also acknowledge you and be non-commercial, they don’t have to license their derivative works on the same terms.

Script author: 
--------------
  Dr. Behrouz Eslami-Mossallam
  Delft University of Technology
  2629HZ Delft
  The Netherlands

Citation for use of the code:
-----------------------------
 Richard Janissen, Behrouz Eslami-Mossallam, Irina Artsimovitch*, Martin Depken*, Nynke H. Dekker*
 High-throughput single-molecule experiments reveal heterogeneity, state-switching, and three interconnected pause states in bacterial transcription.
 Cell Reports    (2022)