A fully open-source, all-inclusive software platform for doing total internal reflection microscopy (TIRFm) single molecule FRET (smFRET) fast and efficiently. The key feature is reverse-loading of ASCII traces, and Keras/TensorFlow-powered automatic trace sorting. Features include
If you'd like to play around with just the Keras/TensorFlow model, please go to https://github.com/komodovaran/DeepFRET-Model
Peer-reviewed article can be found at: https://elifesciences.org/articles/60404
DeepFRET: Rapid and automated single molecule FRET data classification using deep learning
Johannes Thomsen, Magnus B. Sletfjerding, Stefano Stella, Bijoya Paul, Simon Bo Jensen, Mette G. Malle, Guillermo Montoya, Troels C. Petersen, Nikos S. Hatzakis
eLife 2020;9:e60404; doi: 10.7554/eLife.60404
The easiest way to run DeepFRET-GUI is to download the newest installer for your system from the releases page. We currently support macOS and Windows.
Be aware that macs with the new M1 chip has a seperate installer. If using this installer, it is also necessary to open a terminal and run sudo xattr -rd com.apple.quarantine /Applications/DeepFRET.app
after installing to bring the app out of quarantine and allow it to run. This will prompt for the users password.
If you want to change the code, you can also install from source.
and go to File → Open files. The latest release of DeepFRET supports only videos made with alternating laser excitation (ALEX). However, compatibility with non-ALEX data is implemented in the latest source code (executable files will be released soon). Donor order and appearance can be set in Preferences. The rest of the video layout is auto-guessed by the software and doesn't allow for fine-tuning, so be sure to set up new experiments properly!
If you would like to extract traces from a large number of videos that don't fit into memory, you can tick the 'batch mode' option in Preferences, as well as set a number of detections per movie. This disables the option to interactively re-run spot detection analysis, but allows the software to process an essentially unlimited number of videos.
If you've already exported a lot of smFRET traces from another software, but want to do your analysis in DeepFRET, you can even load in traces directly, without movies. Simply make sure that the trace window ('Traces') is the active window, and follow the same steps as above for loading data. This works both for traces with and without ALEX. NB. The current version only supports traces exported by iSMS; see "supported data formats".
The following shortcuts can be used to navigate the different windows, also found in the menu option Window
:
Window | Shortcut |
---|---|
Images | ⌘1 |
Traces | ⌘2 |
Histogram | ⌘3 |
Transition Density | ⌘4 |
Trace Simulator | ⌘5 |
File > Open Files
or the hotkey ⌘O
.Analyze
.A test movie can be downloaded at: https://drive.google.com/file/d/1yJ19EAQ2fB6vXWdGEJd3bVTBD1sy2Y3D/view?usp=sharing
File > Open Files
or the hotkey ⌘O
.Analyze > Predict
to predict trace types for selected or all traces.Edit > Select All
or ⌘E
and analyze by Analyze > Fit Hidden Markov To Selected
.Preferences > HMM settings
. Options allow to fit each trace individually or all traces globally, to use either EFRET or DD/DA intensities for HMM fitting, and set a BIC strictness parameter to change the sensitivity of the Hidden Markov Model. (NB. Lower BIC strictness, individual trace fitting and EFRET fitting will be more prone to pick up noise as transitions. BIC strictness of 0.5-1.0 is sufficient for most datasets)..txt
files for further analysis..pdf
format (publication quality)..pdf
format (publication quality).Refresh
button. Export
button. To get an overview of data distributions, go to Windows → Histogram. This also allows to fit the FRET distribution with gaussians to estimate the number of underlying conformational states. These plots update with the number of traces selected. Because a large number of operations have to be re-computed every time a trace is selected/de-selected, it can be a bit slow if the window is left open while traces are being selected.
Additionally, DeepFRET includes a Hidden Markov model with the possibility to fit each trace individually (as a smoothing, "step-finding" method), as well as a global fit option, for a true Hidden Markov model fit. This also automatically fits transition lifetimes and plots transition density plots (which can be found in Windows → Transition Density Plot). One can base the model on the donor/acceptor signal, or directly on the FRET signal (though this is less accurate)
The whole process should be cross-platform, but has only been tested on MacOS.
Traces exported by DeepFRET or iSMS can be loaded by opening the Traces window, and then using the Open Files in the menu.
Other traces must support some, or all of the following format:
Column | Meaning |
---|---|
D-Dexc-rw |
Donor excitation, donor emission signal |
A-Dexc-rw |
Donor excitation, acceptor emission signal |
A-Aexc-rw |
Acceptor excitation, acceptor emission signal |
D-Dexc-bg |
Donor excitation, donor emission background |
A-Dexc-bg |
Donor excitation, acceptor emission background |
A-Aexc-bg |
Acceptor excitation, acceptor emission background |
CSV files are supported with variable empty spaces between columns (1, 2, tabs, etc)
At the very minimum, your trace must have a D-Dexc-
column first, as DeepFRET seeks for this to find the rest.
Background columns can be ommitted or set to 0, and missing A-Aexc-
columns can be either ommitted or set to NaN (do not set A-Aexc-rw
to 0, as this indicates the presence of a channel).
At the very minimum, DeepFRET is able to load a trace with just the columns D-Dexc-rw
and A-Dexc-rw
.
Other columns not in the specification are simply ignored.
When saving traces, they will outputted in DeepFRET format.
DeepFRET does not support time columns, and works on a per-frame basis.
Currently, .tiff videos are supported as either overlaid full frames in the correct sequence or 2-channel QuadView. They can be loaded by choosing Open Files when the Images window is active. If batch loading is enable in the preferences, you will be able to load an "unlimited" amount of videos and extract a set number of particles, with all video interactivity disabled.
The .ui
files for the interface can be edited through Qt Creator, and when you
have a working python development env, converted with generate_ui.py
.
This is only needed if you want to change the code. If you just want to run DeepFRET-GUI, see Install.
For macOS and Linux.
Make sure you have installed python3.6
and git
.
git clone https://github.com/hatzakislab/DeepFRET-GUI.git
.cd DeepFRET-GUI
.python -m venv venv
.source venv/bin/activate
.pip install -r requirements-unix.txt
.You should now be able to open the application with python src/main/python/main.py
.
See New release if you now want to make a binary.
This needs to be done only once for the machine. The optional steps is needed if
you want to use fbs
to make a new release. If you only want to change the
python code, you can skip them.
fbs freeze
complains about missing DDLs and tells you to install
Visual C++ Redistributable for Visual Studio 2012, it could be actually
be another version. See fbs issue
147 for details.makensis
to the path.
You need to add C:\Program Files (x86)\NSIS
to the path. You can add it
permanently by following this
guide.
Alternatively, you can execute $env:PATH += "C:\Program Files (x86)\NSIS;"
in the PowerShell to set it for the session of the PowerShell.Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
. Answer Y
when prompted.git clone https://github.com/hatzakislab/DeepFRET-GUI.git
.cd .\DeepFRET-GUI\
.python -m venv venv
..\venv\Scripts\Activate.ps1
.pip install -r requirements-win.txt
.You should now be able to open the application with python .\src\main\python\main.py
.
See New release if you now want to make a binary.
The requirements files are generated with pip-tools. This ensures that we have locked down versions for reproducible environments and still a small and manageable list of dependencies.
If you are not changing the dependencies or you pull a new version with updated
dependencies, you can just run pip install -r requirements-<your os>.txt
as
normally.
If however you need to change or update the dependencies you'll have to install
pip-tools with pip install pip-tools
. You add your changes to
requirements.in
instead of requirements.txt
.
You then have to generate the locked down versions of requirements-unix.txt
and requirements-win.txt
. Given the nature of the requirements, you have to
generate them on their separate
systems.
Make sure the changes to requirements.in
are on both systems. Then run
pip-compile --output-file=requirements-unix.txt requirements.in
on macOS or
Linux and pip-compile --output-file=requirements-win.txt requirements.in
on
Windows. Copy one of the output files to the other system and commit the changes
to requirements.in
, requirements-unix.txt
and requirements-win.txt
in the
same commit.
If you want to update the versions for any of the packages not restricted in
requirements.in
, give pip-compile
the --upgrade
flag when you run it.
If you have pip-tools
installed: Instead on running pip install -r requirements-<your os>.txt
, you can run pip-sync requirements-<your os>.txt
.
This will both install the versions of any package in requirements-<your os>.txt
, but also remove any package not defined. This is especially useful
when making a new release as it ensures the correct version of
all packages cross both systems and also that no extra packages are included in
the binary.
To make a new release there are some considerations. You need access to both a macOS and a Windows machine. They can be virtual.
There are no backward compatibility builds made on macOS. Get a machine with an older version. See the fbs documentation.
The version number is specified in src/build/settings/base.json
. Bump it to a
suitable version and make a git commit
with the change. git tag
this commit
with the tag v
followed by the same version (ex. git tag v0.2
) and push it
to GitHub.
The following have to happen on both macOS and Windows.
pip-sync
to make sure you have the correct versions of all packages.
See pip-tools for details.fbs
artifacts with fbs clean
.fbs freeze
. If you get an error about tk/tcl at this point, see https://github.com/hatzakislab/DeepFRET-GUI/issues/12fbs installer
.The last line should point you to a target/DeepFRET.dmg
or a
target\DeepFRETSetup.exe
. Save that file and repeat the above the other OS
until you have both.
If the correct fbs
is not in your path, you can call it directly. On Unix, it
is at ./venv/bin/fbs
. On Windows it is at .\venv\Scripts\fbs.exe
.
Create a new GitHub
release pointing to
your newly created tag. Attach DeepFRET.dmg
and DeepFRETSetup.exe
as
binaries during the release.
We have to inject some extra hooks into PyInstaller. Unfortunately fbs
does
not expose a way to do that. There is a pull
request by NileGraddis that
introduces such a functionality, but the author of fbs
has decided not to
implement it. We therefore use the fork by
NileGraddis. It
enables us to define additional_hooks_dir
in src/build/settings/base.json
.
fbs
have
pinned
PyInstaller to version 3.4 due to some
incompatibilities. The NileGraddis
fork we use does not have the pinning of PyInstaller in it. We need to pin it
manually. There is an issue
tracking the support for PyInstaller 3.6. This pinning can be removed when there
is no reason to use for fork anymore or fbs
starts supporting PyInstaller 3.6
and the fork is updated.