Introduction
Single particle tracking (SPT) is one of the most direct and employed methods to quantify particle dynamics in a sample using optical microscopy. As the name suggests, this approach relies on the identification and tracking of single particles in a sample, followed by the analysis of the detected trajectories. The analysis of particle trajectories is usually carried out using the description given by Einstein and Smoluchowski of Brownian motion 1, 2 to derive the diffusion coefficient of the objects. Given its nature as a data analysis method rather than a technique onto itself, SPT is indifferent to how the particle is detected, as long as the signal-to-noise levels are sufficient to identify it against the background. As a consequence of this, it is almost always necessary to label the sample with adequate target specificity, and it is important that the labelling should be sparse enough to enable single molecule level of detail, particularly when employing conventional, diffraction-limited microscopy. 3 , 4
Among the earliest example of SPT experiments, we can mention the testing of Einstein’s theory of Brownian motion,
5
during which tracking was executed by purely analog means,
Conventionally, trajectory analysis in diffusive systems is performed by monitoring the Mean Squared Displacement of the particle against the time increments, and analyzing them through the Brownian motion 1 and similar models of diffusion. 9, 10 While this kind of pipeline has the advantage of being straightforward and easy to implement, it is not immune from potential pitfalls. As we elaborate further in the Methods section, the localisation error is a critical factor that is often overlooked. 11 This aspect has become especially critical in recent times, given the rise in sampling rates accessible with modern hardware. Motion blurring, which is inherent in SPT given the movement of the target particles, is also often neglected as a potential source of measurement error, 12 which can also lead to disruptive effects in the estimation precision of relevant physical parameters. Overlooking these sources of error leads to overestimation of the detected diffusion coefficients, 13 or to erroneously detected subdiffusion. 14 These spurious deviation arise particularly at short time ranges, given that the particle displacements at these time frames is comparable to the localisation noise, and is thus particularly dangerous since many analysis pipelines often rely on the very first data points to extract relevant diffusion parameters. 15 In addition to this, another factor that affects the correct estimation of physical quantities is the model fitting methodology employed and the number of Mean Squared Displacement points to employ in the data analysis pipeline, which require careful consideration on an ad-hoc basis for each dataset. 16 – 18
Numerous toolboxes and algorithms have been produced to fulfill the need to identify and track single particles, 19– 21 and analyse their motion employing conventional mean squared displacement analysis, 22 machine and deep learning 23– 25 and other methods. 26, 27 Oftentimes the source code is shared by the authors and is readily available, and while in some cases they are not platform-agnostic and require licensed software to be executed, on the other hand, e.g., web-based tools and open source alternatives have also been developed to widen the access possibility to such tools. On the other hand, tools available on open-source platforms, such as FIJI 28 or ICY, 29 are often more focused on the particle tracking, rather than the data analysis itself.
The TRAIT2D (Tracking Analysis Toolkit - 2D version), hereby presented, aims to supply the scientific community with an accessible, open-source, and platform-agnostic tool for particle tracking, simulation and analysis in two dimensions. In TRAIT2D, intuitive graphical user interfaces facilitate users without coding background to promptly access the tools. The tracking tool provided is the most specialised part of the package, as it was developed for particle tracking techniques with a high sampling rate, capable of acquiring long, uninterrupted trajectories, such as Interferometric Scattering (iSCAT). 30 Thereby, the trajectory linking is based on the algorithm that favour strong spatial and temporal connections between consecutive frames. The choice of particle localization algorithm, based on the radial simmetry approach, 31 is linked with the fact that the data which guided the development of the tool features symmetrical, round particles diffusing on a plane.The analysis and simulation tools, on the other hand, have a wider scope of applications. Once the particle trajectories are obtained, either via the provided tracking tool, or imported from other sources, two avenues are available to perform single particle trajectory analysis. The first and more widely adopted, is through the Mean Squared Displacement, which many users will find more familiar and is still conventionally employed. The second avenue, which we named Apparent Diffusion Coefficient analysis, provides more insights into the localisation error and a more intuitive way of monitoring the diffusion behaviour at different time scales. A statistics-driven assists the user in finding the most appropriate diffusion model to describe the particle trajectories. The source code allows more advanced users to customize data analysis, allowing, for example, the introduction of user-defined diffusion models that integrate seamlessly with the proposed analysis pipeline. The track simulator allows the user to generate particle trajectories on a homogeneous plane, or on a surface divided in compartments where the particle can be transiently confined, with a high degree of customisation. We also added the possibility of generating movies from the simulated trajectories with variable levels of contrast, and a user-specified Point Spread Function. This last module can serve as a validation tool of further particle tracking and analysis pipelines.
Methods
Particle tracking
The particle tracking is developed to support a quantitative analysis module which requires extracted trajectories. We introduce a tool which allows users to adjust tracking parameters, preview results and save final trajectories.
The pre-processing of the image sequence is optional and can be applied prior to the tracking algorithm. The tracking is implemented as a two-step process. Firstly, the particles are detected using spot enhancing filter (SEF) 32 and sub-pixel localisation is estimated by the radial symmetry centre approach. 31 Secondly, the detected particles are linked based on their spatial and temporal locations.
The current tool was developed for the iSCAT imaging technique and the pre-processing step is built in accordance to the technique requirement. To distinguish the molecules of interest from the background, the image sequence is divided by a flat field. The flat field represents an undesired static background scattering, and it is calculated by the pixel-wise temporal median filter over a set of frames (1000 frames in the current version). The background is calculated as a temporal average of the entire image sequence and subtracted from each frame. At last, the movie is normalized and brightness adjustment is applied to the image sequence. 33 Although the pre-processing step is developed to subtract a temporal median filter, as it is conventionally done in iSCAT microscopy, it can also be employed for other techniques as a background subtraction tool.
The particle detection exploits a spot enhancing filter (SEF) to enhance the particles and reduce correlated noise in the image. The SEF can be described by the convolution of the original image with a Laplacian-of-Gaussian (LoG) kernel followed by global thresholding to extract the spots.
(1)
where
(2)
The iSCAT imaging technique provides high temporal resolution. The small displacement of the particle between neighbouring frames allows reducing complexity of the linking algorithm and increase the computational speed. The linking approach focuses on strong spatial connection between frames. Hungarian combinatorial optimisation algorithm 38 is employed for the task of data association. The tolerance of the algorithm towards the spatial and temporal distance can be set by the parameters in the graphical-user interface. The assembled tracks can contain gaps in temporal domain due to the failed detection in one or few frames. These gaps are filled taking into account detections in the neighbouring frames and sub-pixel localisation. At the final stage, all the trajectories are filtered based on their length.
Mean squared displacement analysis
In this and the following section, we will briefly discuss the analysis methods implemented in the TRAIT2D software package. The first method, which we refer to in the code as “MSD analysis”, consists of the approach to determine the physical parameters of diffusion dynamics based on the behaviour of the mean squared displacements against the corresponding time interval.
In the case of MSD analysis, the MSD is initially calculated according to the definition:
(3)
whereby
(4)
in which
(5)
The above formulation assumes that the localisation error in the
(6)
While the user can, of course, fix the localisation error value according to their chosen metric, it is also possible to leave it as a floating parameter. This is theoretically preferable from the point of view that the detection of moving particles is by necessity less precise than that of immobile particles, which are often used as a reference to estimate the localisation precision of a microscopy system. The effect of motion blurring, to which this loss in precision is ascribable, is represented by a negative term by the form 11 :
(7)
where
(8)
and
(9)
which are ultimately used to perform curve fitting and extract the relevant parameters. In the case of free diffusion ( 5 and 8), we once again remark the necessity to consider an adequate range of data over which to set up the model fitting routine, as highlighted in the ntroduction. The same observation, for the same model, is also valid if the user elects to use the following Apparent Diffusion Coefficient analysis.
Apparent diffusion coefficient analysis
The apparent diffusion coefficient (ADC) analysis differs from the MSD analysis mainly for the central role given to the diffusion coefficient compared to mean squared displacement. We define the ADC as:
(10)
thereby enabling us to switch to a diffusion coefficient-centric representation. The nomenclature ”apparent” is adopted to stress how this quantity is still affected by the localisation error and not the absolute value of the diffusion coefficient. Dividing both terms of Eq. 8 by , and with some elementary algebra, it is possible to derive:
(11)
By substituting in place of
The software package hereby presented comes with three built-in diffusion models, 12, 41, 42 corresponding to free (Brownian) diffusion
(12)
confined diffusion
(13)
and compartmentalized diffusion, which is the combination of the above two models
(14)
The nomenclature for these models follows the convention that
(15)
where
The selection of the best model to describe any given track is done by statistical means. Each of the models is fitted to the
(16)
in which
Simulation tools
In order to validate the analysis methods described above, we have developed a simple simulation framework. Our tool can create synthetic particle tracks using various diffusion models. Furthermore, the tracks can be converted into synthetic movies to test the particle detection method.
Track simulation
The free (Brownian) diffusion was simulated by drawing a random walk on a two-dimensional virtual square space of side
This set of equations does not strictly respect the condition that (
The hop diffusion motion was simulated according to the code used for,
44
kindly provided by Dr. J. Keller–Findeisen as a Matlab script, and transcribed into Python by the authors. First of all, a virtual surface of arbitrary dimension is split into an arbitrary number of compartments as a Voronoi diagram with random seed. To each of the compartments, a unique identifier is assigned. A particle is then generated in the centre of the plane, and its motion is simulated in the same way as the Brownian diffusion case. However, an additional condition is in place to simulate the hopping motion. A probability is assigned to the particle of jumping between one compartment and the other, called hopping probability (
Confined diffusion can easily be simulated by fixing
Movie generation
We have created a simple movie simulator to obtain a synthetic movie from a list of detected or simulated tracks. This simulator is inspired by a similar noisy holographic image simulator.
45
Apart from a mandatory list of tracks to simulate, other, parameters required for the simulation are the spatial (
The simulator is initialised using the given tracks. The number of time frames, the minimum, and the maximum spot positions in
Once the simulation grid is initialised, we first add a background signal
everywhere. Each pixel background intensity follows a normal distribution of mean μbg and of variance
, and each simulated background pixels are independent and identically distributed (i.i.d.) random variables. In other words, at this stage there is no spatial or temporal correlation between the pixels intensities. We are using the
Next, for each spot position in each track, we discretize the position in both the spatial and temporal dimensions using
(17)
where
(18)
where
(19)
where ⊗ is the convolution product. Finally, i.i.d. Poisson noise is simulated for each pixel separately, using the value of M(x) as the Poisson distribution parameter. The Poisson noise is simulated using the python module
(20)
where
(21)
The simulated movie is exported as a tiff stack or an avi file. Figure 3 is a static example of a simulated movie frame using a single simulated track. The image on the left is a movie frame before the PSF convolution and the Poisson noise simulation, and the image on the right is the final simulated movie frame after these operations.
Implementation
TRAIT2D is implemented entirely in Python using available packages.
The software components (simulation, tracking, analysis) have been split into separate modules that have graphical user interfaces (GUIs) available or, in the case of the simulation and analysis libraries, can be imported in Python scripts.
TRAIT2D uses an object-oriented approach for its workflows:
The simulation library uses
In the analysis library, tracks are represented as
A unique property of the analysis library is the ability to define and add new diffusion models, through a “singleton” class called
Operation
TRAIT2D requires at least a Python 3 (recommended ≥ 3.7) to run. The software also depends on additional packages: Graphical user interfaces are provided through PyQt (analysis) and Tkinter (simulation, tracking). Scipy, matplotlib and pandas are used for model fitting, plotting and loading data, respectively. These and other dependencies are automatically installed when installing from source using the supplied
Use cases
This section outlines basic use cases for TRAIT2D. The complete documentation as well as a list of tutorials as available at https://eggeling-lab-microscope-software.github.io/TRAIT2D/.
Workflow
The central component of the TRAIT2D software package is the analysis module, through which it is possible to extract physical parameters from the particle trajectories. There are three possible avenues for the user to analyse their data ( Figure 1). By using the tracker module, the user can import their timelapses, as TIFF stacks, into the GUI and extract particle trajectories, which can then be exported as a formatted CSV file, ready to be imported in the analysis GUI. Alternatively, if the trajectories are already available to the user through a different particle tracking tool, they can be imported as well, on condition that their formatting is compliant with the format required by the analysis module. Finally, the user could also generate a control dataset through the simulator module, either through the GUI or as a script. The simulated trajectories will then be exported as a properly formatted CSV file, or a compliant data structure in the case of the user script. The Analysis GUI will perform the data analysis following either the MSD or the ADC pipelines (see Methods section), as indicated by the user. We stress that while the GUI exclusively uses the predefined set of models (see Eq. 12, 13 and 14) for the analysis, the module itself allows the addition of more diffusion models as well as batch processing when used in custom scripts, adding an ulterior degree of flexibility.
Figure 1.
Schematic of the workflow of the TRAIT2D software package, highlighting the three possible paths to feed data to the analysis module: (
Compatible file formats and data structures
The analysis library and GUI expects track data to be supplied in a specific format although column names and units are adjustable. At the time of the first release, the trajectories can only be imported from CSV files. A track file must include at least three columns, which contain the localisation time
When working with the analysis library as an imported module inside a Python script, tracks can also be directly loaded from a dictionary or a Pandas data frame as long as they contain the keys described above.
Installation
The package containing the full software can be downloaded directly from PyPI, using the command:
Alternatively, the source code is available at the Github repository:
https://github.com/Eggeling-Lab-Microscope-Software/TRAIT2D.
Graphical user interfaces
Once installed, the different GUIs can be launched by entering
Importable modules
The analysis and simulation libraries can be used as modules in Python scripts by importing either
Tracking particles
The particle tracker is available only as a GUI tool at the time of writing. It can be accessed by typing the command
Figure 2.
Processing a timelapse image.
(a) Example of the output TIFF file, exported by the program after the tracking procedure has been completed. The tracker has found three tracks: one over the full movie length (blue) and a shorter track confined to the sport in the bottom-left corner (yellow). The latter is cut off due to the spot being close to the border. (b) Graphical result of the analysis, through the ADC pipeline, of the track in blue, using the three built-in models, with an opportune analysis interval, initial values and bounds for the parameters.
Analysing a track through the MSD pipeline
While the majority of the use cases presented here will be focusing on the more elaborate ADC analysis pipeline, a quick overview of the MSD analysis pipeline will be given in this section as well.
MSD analysis uses only the built-in linear (Eq. 8) and power (Eq. 9) models for fitting, and there is no option to add custom models.
Other features, such as bulk processing, however, are also available for the MSD pipeline and work similar to their ADC counterparts.
Below is an example illustrating the process of importing a single track from a file and running MSD analysis on it:
Once again, we reiterate that the fit_max_time parameter, i.e. the time range over which the MSD analysis is performed, must be chosen with care to avoid misrepresenting the dynamics of the tracked particles, especially in the case of Brownian motion. 16– 18
Analysing a track through the ADC pipeline
In order to be analysed, a track must be contained in a compatible file or data structure (see above). Data analysis can then be performed through either the analysis GUI, accessible by typing
First of all, the track data needs to be imported as a
In order to proceed with the analysis, the models need to be defined. The package comes with three default models (Eq.
12,
13 and
14), which can be handily registered in the
For the other models, the procedure is identical, however more or less parameters should be initialized, as required by their expression. Once the
The analysis module saves the analysis results to the
Adding a custom model for ADC analysis
The analysis module allows to define custom diffusion models which can be used in the analysis pipeline, and integrate seamlessly into it. This is done by defining a class which inherits from
The newly defined model can be added to
Bulk processing
When using the analysis module inside a Python script, bulk processing of multiple tracks is available. For this, the
Simulating a track
Track simulation can be done either from the GUI, which can be accessed by typing
The following code example shows the simulation of a track using the imported module and the built-in Brownian diffusion simulator.
The GUI also allows for the creation of an image sequence from the simulated track or a loaded trajectory file. Note that this is currently not possible from the imported module inside a Python script. Figure 3 shows such a simulated particle diffusion movie.
Figure 3.
Simulated particle diffusion movie frame.
(Left) Frame before and (Right) after the convolution by a PSF and the simulation of Poisson noise. An animated version of this simulation is available in this project Github repository.
Conclusion
TRAIT2D is a Python-based, open source and easily deployable toolkit for the analysis and simulation of two-dimensional SPT data. The combination of particle tracking, simulation, and trajectory analysis in the same package provides a number of benefits for the user. Another beneficial feature of this software is its user-friendliness for inexperienced users, thanks to the graphical user interfaces provided for each module. Nevertheless, the potential for customisation is retained and the scope of the module can be readily expanded by users with more advanced coding background.
Data availability
The tracks used throughout the examples above are available in the source tree at the GitHub repository mentioned above in the
Software availability
• Software available from
https://github.com/Eggeling-Lab-Microscope-Software/TRAIT2D/releases/ and
https://pypi.org/project/trait2d. • Source code available from
https://github.com/Eggeling-Lab-Microscope-Software/TRAIT2D. • Archived source code at time of publication:
https://doi.org/10.5281/zenodo.4725268. • License: GPL-3.0 License.
You have requested "on-the-fly" machine translation of selected content from our databases. This functionality is provided solely for your convenience and is in no way intended to replace human translation. Show full disclaimer
Neither ProQuest nor its licensors make any representations or warranties with respect to the translations. The translations are automatically generated "AS IS" and "AS AVAILABLE" and are not retained in our systems. PROQUEST AND ITS LICENSORS SPECIFICALLY DISCLAIM ANY AND ALL EXPRESS OR IMPLIED WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES FOR AVAILABILITY, ACCURACY, TIMELINESS, COMPLETENESS, NON-INFRINGMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Your use of the translations is subject to all use restrictions contained in your Electronic Products License Agreement and by using the translation functionality you agree to forgo any and all claims against ProQuest or its licensors for your use of the translation functionality and any output derived there from. Hide full disclaimer
Copyright: © 2022 Reina F et al. This work is published under https://creativecommons.org/licenses/by/4.0/ (the “License”). Notwithstanding the ProQuest Terms and Conditions, you may use this content in accordance with the terms of the License.
Abstract
Single particle tracking (SPT) is one of the most widely used tools in optical microscopy to evaluate particle mobility in a variety of situations, including cellular and model membrane dynamics. Recent technological developments, such as Interferometric Scattering microscopy, have allowed recording of long, uninterrupted single particle trajectories at kilohertz framerates. The resulting data, where particles are continuously detected and do not displace much between observations, thereby do not require complex linking algorithms. Moreover, while these measurements offer more details into the short-term diffusion behaviour of the tracked particles, they are also subject to the influence of localisation uncertainties, which are often underestimated by conventional analysis pipelines. we thus developed a Python library, under the name of TRAIT2D (Tracking Analysis Toolbox – 2D version), in order to track particle diffusion at high sampling rates, and analyse the resulting trajectories with an innovative approach. The data analysis pipeline introduced is more localisation-uncertainty aware, and also selects the most appropriate diffusion model for the data provided on a statistical basis. A trajectory simulation platform also allows the user to handily generate trajectories and even synthetic time-lapses to test alternative tracking algorithms and data analysis approaches. A high degree of customisation for the analysis pipeline, for example with the introduction of different diffusion modes, is possible from the source code. Finally, the presence of graphical user interfaces lowers the access barrier for users with little to no programming experience.
You have requested "on-the-fly" machine translation of selected content from our databases. This functionality is provided solely for your convenience and is in no way intended to replace human translation. Show full disclaimer
Neither ProQuest nor its licensors make any representations or warranties with respect to the translations. The translations are automatically generated "AS IS" and "AS AVAILABLE" and are not retained in our systems. PROQUEST AND ITS LICENSORS SPECIFICALLY DISCLAIM ANY AND ALL EXPRESS OR IMPLIED WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES FOR AVAILABILITY, ACCURACY, TIMELINESS, COMPLETENESS, NON-INFRINGMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Your use of the translations is subject to all use restrictions contained in your Electronic Products License Agreement and by using the translation functionality you agree to forgo any and all claims against ProQuest or its licensors for your use of the translation functionality and any output derived there from. Hide full disclaimer