> For the complete documentation index, see [llms.txt](https://guide.cryosparc.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/deep-picking/topaz/job-topaz-extract-beta.md).

# Job: Topaz Extract

Topaz Extract job available via wrapper in CryoSPARC.

Once the `Topaz Train` job has been used to train a Topaz model it can be used to pick particles from micrographs using the `Topaz Extract` job. This job has the following inputs and outputs:

**Inputs**

* Topaz Model
* Micrographs

**Outputs**

* Particle Picks
* Micrographs

## Common parameters to change

* **Absolute path of directory containing preprocessed directory** - path to place the downsampled micrographs and particle files. If left blank, a folder will be created in the job directory titled "preprocessed".
* **Downsampling mode** - downsampling should be done to produce a target pixel size of 4-8Å/px.
  * Automatic - downsample factor is chosen such that the target pixel size is 8Å/px and the particle will fit within the receptive field for the specified model.
    * **Estimated particle diameter** - value in Å representing the diameter of the target particle
  * Manual - specify the downsampling factor manually; aiming for a pixel size of 4-8Å.
* **Radius of extracted regions** - specifies how close predicted particles can be to each other when coordinates are identified from the pixel-level probabilities via peak finding. This radius should be close to the actual size of your particle, because it prevents multiple high scoring pixels within a single particle being called as centers of different particles by the peak finding algorithm.
  * If the "Auto" downsampling mode was selected, specify the minimum distance between particle centers in units of particle diameters.
  * If the "Manual" downsampling mode was selected, specify the minimum distance between particle centers in number of downsampled pixels

## Parameters

* **Path to Topaz Executable**
  * The absolute path to the Topaz executable script.
* **Select Pre-trained** `--model`
  * Select pre-trained model to use for extraction. If "None" is selected, will use input model.
* **CPU only** (sets `--device` to `-1`)
  * Specify whether to use GPU or CPU.
* **Absolute path of directory containing preprocessed directory**
  * Path to directory containing preprocessed micrographs for cross validation.
* **Downsampling Mode**
  * **Auto / Estimated Particle Diameter (Å)**&#x20;
    * A suitable downsample factor is chosen such that the target pixel size is 8Å/px and the particle will fit within the receptive field for the specified model.
  * **Manual / Downsampling Factor** `--down-scale` or `--scale`
    * The factor by which to downsample micrographs by.
* **Number of Iterations** `--niters`
  * &#x20;Number of iterations to use for model fit. Only required when using provided pre-trained model.
* **Score Threshold** `--threshold`
  * Threshold particles by score before preprocessing. Only required when using provided pre-trained model.
* **Number of Parallel Threads** `--num-workers`
  * Number of threads to distribute processing over. This parameter decreases the preprocessing time by a factor approximately equal to the input value. It is recommended to set this value to at least 4 as the preprocessing time is often a bottleneck in the time performance of the job. Values less than 2 will default to a single thread.
* **Radius of Extracted Regions** `--radius`
  * If the "Auto" downsampling mode was selected, specify the minimum distance between particle centers in units of particle diameters.
  * If the "Manual" downsampling mode was selected, specify the minimum distance between particle centers in number of downsampled pixels.
* **Extraction Threshold** `--threshold`
  * Log likelihood at which to stop extraction.
* **Particle Threshold** `-t`
  * Threshold at which to filter particle quality.

The `Topaz Extract` job features various parameters but the most notable parameter is the **particle threshold** parameter. This parameter determines the minimum quality threshold at which to accept particle picks. If the results of a `Topaz Extract` job features too many particles, the issue may be solved simply by increasing this parameter. However, selecting an improved threshold can be conveniently done using the `Inspect Particle Picks` job in cryoSPARC as detailed in the next section.

This job also features the **number of parallel threads** parameter. Like in the Topaz Train and Cross Validation jobs, this parameter decreases the preprocessing time by a factor approximately equal to the input value. It is recommended to set this value to at least 4 as the preprocessing time is often a bottleneck in time performance of the job. Values less than 2 will default to single thread.

## Interpreting Training Results from Topaz Extract

Topaz assigns a log-likelihood score from the model to each particle pick based on the surrounding pixel characteristics. These Topaz values can be interacted with in one of two ways:

1. Particle Threshold parameter in Topaz Extract\
   Topaz Extract includes a "Particle Threshold" parameter (default: 0), which can be used to threshold particles at the time of picking. Filtering of particles with the log-likelihood threshold is demonstrated in [Figure 4 of the original Topaz paper](https://www.nature.com/articles/s41592-019-0575-8#:~:text=Fig.%204%3A%20Reconstruction%20resolution%20and%202D%20class%20averages%20for%20Topaz%20particles%20at%20decreasing%20log%2Dlikelihood%20ratio%20thresholds.), where reconstruction resolution and 2D class averages are compared across decreasing thresholds.
2. Normalized Scores in the NCC and Power Fields\
   During Topaz Extract, CryoSPARC normalizes and scales the predicted probability scores from Topaz, storing them in the NCC and Power score fields. This allows particles to be curated downstream using a consistent value/ranking.The particle picks from the `Topaz Extract` job can be observed and have a threshold applied using the Inspect Particle Picks job. This job interacts with particle picks from `Topaz Extract` differently in that it enable a user to apply a threshold based on Topaz model performance rather than power score. To do so, vary the power score threshold in the `Inspect Particle Picks` job. In the image below, the inferred picks have a lower bound threshold of 15 and an upper bound threshold of 48 applied. This number is a model score applied by Topaz indicating how confident the model is in a particle pick.

![Sample Topaz Extract Results with T20S Proteasome](https://1916621962-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7DGv3GkRvGGpbVPCgg%2Fsync%2F5afb415ad38c5091f22eb29414dc99d51cbf2c4f.png?generation=1589377625256264\&alt=media)

All particles outputted from `Topaz Extract` must be processed using the `Extract from Micrographs` job in CryoSPARC. This updates the CTF information within the particle picks and makes the picks compatible with other CryoSPARC jobs such as `Ab-Initio Reconstruction`.
