Topaz (Bepler, et al)
Overview of the Topaz wrapper available through CryoSPARC.
Last updated
Overview of the Topaz wrapper available through CryoSPARC.
Last updated
The wrapper in CryoSPARC incorporates deep learning models used in Topaz to automatically pick particles with a set of previously-picked particles or to denoise micrographs. The wrapper consists of four jobs:
Topaz Train
Topaz Cross Validation
Topaz Extract
Topaz Denoise
Use the first three jobs for particle picking. Use final job for micrograph denoising.
Topaz is a particle detection tool created by Tristan Bepler, Alex J. Noble and team:
Structura Biotechnology Inc. and CryoSPARC do not license Topaz nor distribute Topaz binaries. Please ensure you have your own copy of Topaz licensed and installed under the terms of its .
CryoSPARC requires a Topaz installation in a dedicated conda
environment. The steps below are based on and were modified in December 2024 to force installation of Topaz v0.2.5 and compatible libraries. Newer versions of Topaz are available, but may not be compatible with the Topaz wrapper in CryoSPARC.
conda
Python environmentDo not use the conda
Python installed with CryoSPARC. This installation is destroyed during CryoSPARC updates.
Create and activate aconda
environment named topaz
environment with the following commands:
For Topaz 0.2.5, theconda
environment should be configured with Python 3.6, regardless of the versions of other Python installations on the system.
Once the conda
environment has been created and activated, run the following command to install Topaz:
After running the preceding command, with the conda
environment still active, the command
should print TOPAZ 0.2.5a
to the terminal.
Once Topaz is installed and the conda
environment is active in your current shell, enter the following command to determine the full path to the topaz
binary:
The output should look similar to this:
In the CryoSPARC interface, specify this as the value for the "Path to Topaz executable" parameter:
If using this path results in errors when running a Topaz job (often with a message such as "topaz did not produce valid output"), try aliasing Topaz with a shell script that also activates the correct conda
environment. This process is described in the next section.
topaz.sh
wrapper scriptCryoSPARC has its own conda
installation and environment, which may conflict with the Topaz environment. To prevent this, create a shell script that deactivates the CryoSPARC environment and activates the topaz one.
Create a topaz.sh
file in a well known location such as the home directory (e.g., ~/topaz.sh
). Add the following contents, making the noted substitutions:
Substitute $HOME/anaconda3
on line 17 with the Anaconda or Miniforge installation directory.
Make this file executable by the CryoSPARC user from the command line
In the CryoSPARC interface, specify the full path to topaz.sh
as the "Path to Topaz executable" parameter:
To avoid having to locate and set the Topaz executable path when building every Topaz job, in v4.0.2 onwards you can set a project-level default that will apply to all newly created Topaz jobs.
Navigate to the projects view, select a project and choose the Topaz executable path under the 'Project Level Parameters' module within the sidebar details panel:
Substitute /path/to/topaz
with the full path to be used for CryoSPARC jobs
For the preprocess
command, specify one of
--device n
where n
is a specific GPU number to run the test on
--num-workers n
where n
is the number of processes to use
Use a previously-installed Anaconda Python (3.6+), or . Alternatively, provides the required conda
functionality.
Log out of the current command shell and log in again to ensure no conda environment is active. Run the following commands to verify that the Topaz Installation is working correctly. These are adapted from the . Note the substitutions below.