> 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/3d-refinement/job-non-uniform-refinement-new.md).

# Job: Non-Uniform Refinement

## At a Glance

Perform a global alignment of input particles to a reference volume using a spatially varying filter.

## Description

Like [Homogeneous Refinement](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/3d-refinement/job-homogeneous-refinement), Non-Uniform Refinement performs a global alignment of particle images to a reference volume obeying the [gold-standard half set split](/the-fsc-and-gold-standard-refinement.md#id-2aa4324a-3a7b-80d7-9da3-cafe99e4c42c). However, where Homogeneous Refinement uniformly filters the resulting map (at each iteration) using the GSFSC, Non-Uniform Refinement filters the map using a spatially varying filter. This typically improves maps with unstructured like micelles or flexible domains. For more information on the filtering performed by Non-Uniform Refinement, see the [Implementation Details](#implementation-details) section, or the original publication (Punjani et al 2020).

## Inputs

#### Particles <a href="#particles" id="particles"></a>

As Homogeneous Refinement is a global refinement, no prior pose information will be used or is needed. Particles must have CTF information in order for refinement to proceed.

#### Initial Volume <a href="#initial-volume" id="initial-volume"></a>

An initial volume is used the first iteration of a Homogeneous Refinement, since the images do not have 3D pose estimates and therefore cannot be used to create a reference volume. In subsequent iterations, the volume created by backprojection of the particles is used for alignments. The initial model will be low-pass filtered before alignment as specified by the [`Initial lowpass resolution`](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/3d-refinement/job-homogeneous-refinement#initial-lowpass-resolution-a) parameter.

{% hint style="warning" %}
The initial volume has a significant impact on the end result of a refinement job. A poor input volume (e.g., a noisy or anisotropic volume, or a volume that is too dissimilar from the target) will produce poor results. See [Ab-Initio Reconstruction](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/3d-reconstruction/job-ab-initio-reconstruction) for information on how CryoSPARC can generate initial volumes.
{% endhint %}

#### Mask (optional) <a href="#mask-optional" id="mask-optional"></a>

If a mask is provided, at each iteration of refinement the volume will be masked using this mask instead of the [dynamic masking](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/3d-refinement/job-homogeneous-refinement#dynamic-masking) routine. This can be helpful if dynamic masking fails, or if unstructured regions (e.g., micelles) interfere with alignment. If the mask is being used to focus refinement on a particular region, Local Refinement may perform better — see [Recommended Alternatives](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/3d-refinement/job-homogeneous-refinement#recommended-alternatives).

Note that the provided mask is only used for alignment. FSC is always calculated with a dynamic mask. You can calculate the FSC with your own mask using [Validation (FSC)](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/post-processing/job-validation-fsc) once the refinement finishes. For masking behaviour in CryoSPARC v5+, see [the dedicated guide page](https://guide.cryosparc.com/processing-data/tutorials-and-case-studies/tutorial-dynamic-masking-in-refinements-v5.0).

## Commonly Adjusted Parameters

#### Window dataset (real-space) <a href="#window-dataset-real-space" id="window-dataset-real-space"></a>

![](/files/alze8AczHB9Z1miakSge)

In general, particle images are expected to be well-centered. This means that (ignoring signal delocalization due to the Contrast Transfer Function) the edges and corners of the particle image do not contain information about the particle. They may, however, contain noise or adjacent particles which interfere with alignment. Refinement algorithms therefore typically window these particle images before comparing them to reference projections.

The window gently transitions from 1.0 at the `Window inner radius` to 0.0 at the `Window outer radius`. In very crowded grids, it may help to use a tighter window (i.e., reduce both radii) to exclude neighboring particles. Note that windowing is performed *before* the images are centered, so if particle images are not well centered windowing may remove particle information.

#### Symmetry <a href="#symmetry" id="symmetry"></a>

The symmetry operator entered here is used to enforce (or relax) symmetry during refinement. By default it is C1 (i.e., no symmetry). See [Symmetry in CryoSPARC](https://guide.cryosparc.com/symmetry-in-cryosparc) for CryoSPARC's symmetry conventions.

#### Symmetry relaxation method <a href="#symmetry-relaxation-method" id="symmetry-relaxation-method"></a>

This parameter can take one of three possible values: “none”, “maximization”, or “marginalization”. For more information on symmetry relaxation, see the [symmetry relaxation tutorial](https://guide.cryosparc.com/processing-data/tutorials-and-case-studies/tutorial-symmetry-relaxation).

#### None

**The point group is used to enforce symmetry**. Each particle is inserted in each of the N different symmetry-related poses, where N is the symmetry order. This effectively increases the signal to noise ratio by a factor of N, but can produce invalid maps or other poor results if the target is not truly symmetric.

#### Maximization

Each particle is aligned to the reference as in an asymmetric reconstruction, but a small neighborhood each of the N symmetry-related poses is then checked. **Only the best of all symmetry-related poses is used.** Note that this means particle images are only used once — the map is not forced to be symmetric.

#### Marginalization

Each particle is aligned to the reference as in an asymmetric reconstruction, but a small neighborhood of each of the N symmetry-related poses is then checked. **Particles contribute to the reconstruction in each symmetry-related pose, weighted by the probability of that pose being correct**. Note that this means particle images are only used once — the map is not forced to be symmetric.

#### Do symmetry alignment <a href="#do-symmetry-alignment" id="do-symmetry-alignment"></a>

<img src="https://guide.cryosparc.com/~gitbook/image?url=https%3A%2F%2F1916621962-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-M7DGv3GkRvGGpbVPCgg%252Fuploads%252Fq6V0myBgbBghpgA90H2x%252F05_align-to-sym.png%3Falt%3Dmedia%26token%3D3170bc9a-4b5c-44a7-80a9-76526726b7b9&#x26;width=768&#x26;dpr=3&#x26;quality=100&#x26;sign=cc92fe6b&#x26;sv=2" alt="" width="563">

If this parameter is on, the input volume is transformed and shifted such that the symmetry axes are aligned to map axes (e.g., the four-fold axis of a C4 symmetric input map is aligned to the Z axis).

#### Re-estimate greyscale level of input reference <a href="#re-estimate-greyscale-level-of-input-reference" id="re-estimate-greyscale-level-of-input-reference"></a>

![](https://guide.cryosparc.com/~gitbook/image?url=https%3A%2F%2F1916621962-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-M7DGv3GkRvGGpbVPCgg%252Fuploads%252FwbBTPgYTZvpI8kVkJMI7%252Freestimate-greyscale.png%3Falt%3Dmedia%26token%3D56379280-dc4f-46af-a8f7-e1579e68c160\&width=768\&dpr=3\&quality=100\&sign=8690eea5\&sv=2)

If this parameter is on (default), the volume's greyscale is re-estimated before refinement begins.

<details>

<summary>Why is greyscale re-estimation important?</summary>

Cryo-EM maps comprise a grid of voxels, with each voxel containing some value which is related to the Coulomb potential of the target at that position. However, these values only provide information about the *relative* potential within a single map, not the absolute potential of the target. In general, maps created from different sets of images will not have the same values in the same voxels. The range of values across all voxels is called the *greyscale*.

Since alignments are scored by assessing the difference between each image and the volume, a difference in greyscale leads to poor alignments. If this parameter is on, the greyscale of the input map will be adjusted to match those of the input particles. In general, we recommend that this parameter is on for Homogeneous Refinements.

This parameter ensures that the volume starts near the mean particle’s greyscale. Each particle will have slightly different contrast due to ice thickness, beam effects, etc. These per-particle differences in scale are fit by [Per-Particle Scale](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/3d-refinement/job-homogeneous-refinement#minimize-over-per-particle-scale).

</details>

#### Number of extra final passes <a href="#number-of-extra-final-passes" id="number-of-extra-final-passes"></a>

This many EM iterations will be performed with the full particle stack after the GSFSC resolution stops improving.

By default, refinement is considered complete after the first iteration in which the GSFSC does not improve. In most cases, this is sufficient. However, the GSFSC is only one measure of map quality. In some cases, continuing refinement after GSFSC resolution stops improving can still result in an overall higher-quality map.

The most common situation in which extra final passes improves the final result is symmetry relaxation. As of yet, there is not a good automated metric by which the refinement can validate whether the symmetry-relaxed poses of the particles have converged. As such, terminating the refinement upon GSFSC convergence may prevent the algorithm from sufficiently breaking pseudosymmetry. For example, consider data from EMPIAR-10256 (Dang et al. 2019).

![](https://guide.cryosparc.com/~gitbook/image?url=https%3A%2F%2F1916621962-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-M7DGv3GkRvGGpbVPCgg%252Fuploads%252FD5S4Rai0a5SHOurW2RcS%252F07_iterations-and-sym-relaxation_iter-subset.png%3Falt%3Dmedia%26token%3Db9474857-4aa5-4e2e-8384-54621de0a42f\&width=768\&dpr=3\&quality=100\&sign=c689ff8f\&sv=2)

GSFSC stops improving after the second iteration. However, signal from the symmetry-breaking CaM molecule is not fully resolved until iteration 32.

#### Adaptive Marginalization <a href="#adaptive-marginalization" id="adaptive-marginalization"></a>

When this parameter is turned on, particle poses will be marginalized, meaning that each particle image contributes to the 3D reconstruction from multiple poses, each weighted by their probability of being correct. Marginalization can improve the results of refinement, with small particles or low-SNR images benefiting the most. For medium and large particles or high-SNR images, maximization (`Adaptive Marginalization` off, the default) works just as well and is computationally less expensive.

#### Maximum align resolution (A) <a href="#maximum-align-resolution-a" id="maximum-align-resolution-a"></a>

During alignment (not reconstruction) the map uses frequencies only up to this resolution. If left blank, the map uses all frequencies up to the current resolution. Keep in mind that in both cases the map is also filtered by the GSFSC curve, so in practice maps may use coarser resolutions than this parameter dictates.

Setting this parameter to a higher numeric value (lower resolution) may reduce overfitting due to high-frequency noise for some datasets. Note that much of the *alignable information* in an individual particle image comes from the low frequencies. Thus, the [*reconstruction*](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/3d-refinement#backprojection) may achieve a higher resolution than that of the alignment limit. For example, consider data from EMPIAR-10424 (Nakane et al. 2020).

![](https://guide.cryosparc.com/~gitbook/image?url=https%3A%2F%2F1916621962-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-M7DGv3GkRvGGpbVPCgg%252Fuploads%252FnobehTzg0Rb4mYB8d16K%252Fmax-align_reconstruction.png%3Falt%3Dmedia%26token%3D0693cb86-7338-41c1-aa68-b9b5aad5c6d6\&width=768\&dpr=3\&quality=100\&sign=6ab95d38\&sv=2)

The map produced with this parameter is left empty (left) is of slightly higher quality (for example, the indicated histidine appears slightly more isotropic), but both maps achieve better than 1.5 Å resolution.

In addition to potentially preventing overfitting, setting the Maximum align resolution to a higher numeric value (lower resolution) may help symmetry relaxation converge if the asymmetric feature is large and the reconstruction goes to high resolution.

![](https://guide.cryosparc.com/~gitbook/image?url=https%3A%2F%2F1916621962-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-M7DGv3GkRvGGpbVPCgg%252Fuploads%252F1rpwzsJsYD4I57qNfa1V%252Fmax-align_relaxation.png%3Falt%3Dmedia%26token%3Daff8f77d-480c-4139-a297-2831e237ca0f\&width=768\&dpr=3\&quality=100\&sign=a1e4b749\&sv=2)

In this example again using data from EMPIAR-10256 (Dang et al. 2019), setting the maximum alignment resolution to 6 Å provided a significantly improved breaking of the C4 psuedosymmetry after the same number of iterations. Note that when using the GSFSC resolution (blue, left) significant density remains in all four positions (indicated with arrows). When limiting alignment to 6 Å, pseudosymmetry is successfully broken. Both maps are lowpass filtered to 6 Å to aid comparison.

#### Initial lowpass resolution (A) <a href="#initial-lowpass-resolution-a" id="initial-lowpass-resolution-a"></a>

Before the first iteration, the input volume is lowpass filtered to this resolution in Å. Typically, the default value of 20 Å does not need to be changed. For highly symmetric or very small particles, a finer resolution may improve results.

#### GSFSC split resolution (A) <a href="#gsfsc-split-resolution-a" id="gsfsc-split-resolution-a"></a>

[Half sets](https://guide.cryosparc.com/processing-data/tutorials-and-case-studies/tutorial-common-cryosparc-plots#fourier-shell-correlation-plots) share information during refinement, up to this resolution. Put another way, half sets are only truly independent at frequencies finer than this value.

This parameter should almost always be left at its default setting of 20 Å. If the GSFSC resolution for a highly symmetrical particle is surprisingly poor and the particles generate good 2D classes, you should first download and inspect the half maps. If they are clearly in different orientations, setting this parameter to a higher resolution may help. Keep in mind that the half-sets are not independent at resolutions coarser than this parameter, so it should be kept as coarse as possible.

If a refinement was run with two completely independent half maps, over iterations the two maps might adopt different orientations in 3D space. The correlation between two half maps in different orientations would be very low, meaning that the GSFSC resolution would be extremely poor even if the half maps were identical.

![](https://guide.cryosparc.com/~gitbook/image?url=https%3A%2F%2F1916621962-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-M7DGv3GkRvGGpbVPCgg%252Fuploads%252FCm4gv9zCvclOpdyOmYIE%252Fsplit-resolution_2.png%3Falt%3Dmedia%26token%3D94df903b-d0c7-46e5-aa84-adc9790a2cff\&width=768\&dpr=3\&quality=100\&sign=225e38c\&sv=2)

To avoid this scenario, the components of each half map below the resolution specified by this parameter are averaged together in every iteration. This forces the half maps to adopt the same overall pose in 3D space, but retains their independence at higher resolutions.

#### Auto batchsize <a href="#auto-batchsize" id="auto-batchsize"></a>

For a typical dataset, the map used for alignment in the first iterations of a refinement is a poor estimate of the true, final volume. Poses aligned to this reference therefore also poor. It is thus wasteful to align *every* particle to these early volumes. CryoSPARC therefore, by default automatically estimates the number of particles (called a batch) to align before generating a new reference for following iterations.

For small particles or particles with poor signal-to-noise ratio, larger batch sizes may be necessary for optimal reconstruction. The automatic estimate of the optimal batch size can be changed using two similar but distinct parameters, described below. In general, adjusting the batch size with `Batchsize snrfactor` is recommended, since the effect of changing it to a specific value is more predictable across datasets.

* `Batchsize epsilon` controls the estimated proportion of Fourier pixels which will be missed by the minibatch. Setting this value *higher* allows for *fewer* particles in the minibatch, while a *lower* value creates minibatches with *more* particles. Note that this parameter should always remain above 0.
* `Batchsize snrfactor` directly multiplies the batch size calculated using `Batchsize epsilon`. Setting this parameter higher by a factor of 2 (i.e., 100 instead of 50) doubles the number of particles in the minibatch. Auto batch sizing can be disabled entirely by turning `Disable auto batchsize` on. In this case, the entire particle stack is used in each iteration. In general, this significantly slows jobs without appreciable improvement in the final result.

#### Minimize over per-particle scale <a href="#minimize-over-per-particle-scale" id="minimize-over-per-particle-scale"></a>

If this parameter is on, each particle’s optimal scale is calculated at each iteration. If this parameter is off, the particles’ input scales are used during each iteration.

![](https://guide.cryosparc.com/~gitbook/image?url=https%3A%2F%2F1916621962-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-M7DGv3GkRvGGpbVPCgg%252Fuploads%252FDhACkbJ1ZA1uJvAUl50T%252Fper-particle-scale.png%3Falt%3Dmedia%26token%3D3bf92b9f-04eb-4bbb-bcc2-de0fa11dbfa7\&width=768\&dpr=3\&quality=100\&sign=b0a3f65c\&sv=2)

The per-particle scale is a value for *each particle image* which adjusts the contrast of the reference volume to the contrast in the individual particle image.

For example, consider two particles produced by the same volume in the same pose, but in different ice thicknesses. The particle in thinner ice will have more contrast than the particle in thick ice, but the reference volume should have the same voxel values for both. Per-particle scale is used to adjust the greyscale of *individual particle images* to account for this fact. As the name implies, each particle has a scale value which relates its greyscale to that of the volume.

While per-particle scale in theory corrects for each image’s greyscale, particles with a low per-particle scale tend to be poorer quality than particles with high per-particle scale. For this reason, it may be beneficial to filter out particles with low scale. See the [Subset Particles by Statistic](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/particle-curation/job-subset-particles-by-statistic#subsetting-by-per-particle-scale) job page for more information on this process.

#### Reset input per-particle scale <a href="#reset-input-per-particle-scale" id="reset-input-per-particle-scale"></a>

If this parameter is on, all particles’ scale is set to `1.0` at the beginning of the refinement. If this parameter is off, particles’ scales are retained from the input. Note that if particles have not yet been refined, their starting scales are all `1.0`.

If `Minimize over per-particle scale` is off and per-particle scales have previously been fit (in an earlier refinement, for example), you may wish to turn this parameter off to retain the previously-found scales.

#### Initialize noise model from images <a href="#initialize-noise-model-from-images" id="initialize-noise-model-from-images"></a>

If this parameter is on, the noise model is directly estimated from the images. If this parameter is off, a constant value is used to initialize the noise model.

In theory, a noise model inferred directly from particle images may help when `Adaptive marginalization` is on, since marginalization tends to be more sensitive to the choice of noise model. In practice, the noise model typically converges during the first or second iteration, so this setting has little impact on the final result.

#### Dynamic masking <a href="#dynamic-masking" id="dynamic-masking"></a>

{% hint style="info" %}
Starting in CryoSPARC v5, the dynamic mask near/far parameters are multiples of the current resolution instead of raw physical units. See [3D Masking in Refinement](https://guide.cryosparc.com/processing-data/tutorials-and-case-studies/tutorial-dynamic-masking-in-refinements-v5.0#dynamic-masking-in-cryosparc-v5.0) for more information.
{% endhint %}

If a static mask is provided to the Mask input, that mask will be applied at each iteration. If a mask is not provided and `Use dynamic refinement mask` is turned on, a mask will be dynamically generated during refinement.

![](https://guide.cryosparc.com/~gitbook/image?url=https%3A%2F%2F1916621962-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-M7DGv3GkRvGGpbVPCgg%252Fuploads%252FMgxE0ylb4dIozKBoH5yn%252F12_dynamic-mask-generation.png%3Falt%3Dmedia%26token%3D288a3c9c-e233-4a8b-9d3a-9bab0a5ecdeb\&width=768\&dpr=3\&quality=100\&sign=69134ebf\&sv=2)

Once the GSFSC resolution is the same as or finer than `Dynamic mask start resolution (A)`, a mask will be generated by thresholding each half map at the `Dynamic mask threshold (0-1)`.

If `Dynamic mask use absolute value` is turned on, this thresholding is performed on the absolute value of the map (i.e., a threshold of 0.2 would include voxels with value less than -0.2 or greater than 0.2). This is useful if there are regions of the map which are expected to be empty. Since empty pockets will have lower density than the corners of the image (which may have neighboring particles or contaminants), they will tend to have negative map values. However, these pockets are typically small and near regions of high density, so this parameter is rarely required in practice.

The mask is then padded with `1.0` for a distance of `Dynamic mask near (A)` and a soft edge is added, reaching `0.0` at a distance of `Dynamic mask far (A)`.

Dynamic masking can effectively be disabled by setting `Dynamic mask start resolution (A)` to an unrealistically low value, such as 0.1 Å. Starting in CryoSPARC v5, dynamic masking can be disabled by turning off `Use dynamic refinement mask`.

Cryo-EM maps can have very different absolute voxel values. To account for this, the `Dynamic mask threshold (0-1)` parameter is a *relative threshold*. The map is thresholded at a voxel value of `Dynamic mask threshold` times the maximum voxel value in the map.

For instance, consider a map with voxels ranging from `-0.10` to `0.23`. If `Dynamic mask threshold (0-1)` is set to `0.5`, all values greater than `0.115` are set to `1.0` and all values less than or equal to `0.115` are set to `0.0`. The mask is then dilated and padded using the `Dynamic mask {near, far}` parameters.

Non-uniform Refinement's spatially-varying filter makes it less dependent on masking of the solvent around the protein, since the filtering automatically smooths any noise in the solvent region. In some cases, improved results can be obtained by disabling dynamic masking completely.

In versions of CryoSPARC prior to v5, dynamic masking can effectively be disabled by setting `Dynamic mask start resolution (A)` to an unrealistically low value, such as 0.1 Å.

Starting in CryoSPARC v5, the dedicated `Use dynamic refinement mask` parameter may be turned off instead of adjusting the `start resolution`.

#### GPU batch size of images <a href="#gpu-batch-size-of-images" id="gpu-batch-size-of-images"></a>

Set the number of images simultaneously loaded into the GPU. Note that GPU batch size is a purely computational consideration — it will not have an effect on the final result. It differs in this way from the batch size of the *refinement*, which controls the number of images seen in each iteration and is controlled by the [`Batchsize epsilon` and `Batchsize snrfactor`](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/3d-refinement/job-homogeneous-refinement#auto-batchsize) parameters.

Reading images from the filesystem is slow. To speed up refinement, CryoSPARC will try to load as many images into the GPU at once as it can. However, it is challenging to precisely determine the space required by a given refinement, so the number of images that fits can only be estimated. If you run out of GPU memory during a refinement, you *may* be able to complete the refinement by manually setting this parameter to a low number of images.

#### Defocus Refinement and Global CTF refinement <a href="#defocus-refinement-and-global-ctf-refinement" id="defocus-refinement-and-global-ctf-refinement"></a>

CryoSPARC can estimate per-particle defocus and per-group higher-order CTF aberrations during a refinement. On-the-fly CTF estimation is controlled by `Optimize per-particle defocus` (for [Local CTF Refinement](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/ctf-refinement/job-local-ctf-refinement)) and `Optimize per-group CTF params` (for [Global CTF Refinement](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/ctf-refinement/job-global-ctf-refinement)). See the associated pages for information about the other CTF refinement parameters.

We recommend first performing separate Local and Global CTF Refinements and assessing whether the datasets benefit from these optimizations before performing them on-the-fly during refinement. For more information, see the guide page on [CTF refinement](https://guide.cryosparc.com/processing-data/tutorials-and-case-studies/tutorial-ctf-refinement).

#### Do EWS correction <a href="#do-ews-correction" id="do-ews-correction"></a>

Whether to correct for the curvature of the Ewald sphere. This typically produces moderate resolution improvements for large particles which are already at high resolution without Ewald sphere correction. If this option is turned on, ensure that the correct curvature is selected in `EWS curvature sign`. For more information on these parameters, see the [Ewald Sphere Correction section of this page](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/3d-refinement/job-homogeneous-refinement#ewald-sphere-correction), or the [dedicated guide page](https://guide.cryosparc.com/processing-data/tutorials-and-case-studies/tutorial-ewald-sphere-correction).

### Non-uniform refine enable

If this parameter is off, Non-Uniform’s refinement is identical to [Homogeneous Refinement](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/3d-refinement/job-homogeneous-refinement). We therefore recommend that this parameter is left on and that in cases where non-uniform refinement is not desired Homogeneous Refinement is used instead.

### Non-uniform AWF

The Adaptive Window Factor (AWF) controls how much 3D space is considered around each point in the density map when optimizing local filter parameters. Lower values consider smaller regions of space, and so yield less smooth filter parameters. These less-smooth filters may be more susceptible to overfitting. Higher values consider more 3D space (and so are more resistant to overfitting), but have slower transitions between ordered and disordered regions. The default value of 3 is usually appropriate, and values below 1.5 are not recommended.

### Low-Memory Mode

CryoSPARC v4.4 introduced performance optimizations that make Non-Uniform Refinement approximately twice as fast it was in CryoSPARC v4.3. However, this optimization comes at the cost of increased memory consumption. Turning on `Low-Memory Mode` uses the slower CryoSPARC v4.3 version of the code, reducing the job’s memory usage. This may be necessary when working with very large (e.g., larger than 600 -- 1024 px, depending on GPU model) boxes or GPUs with relatively little VRAM.

## Outputs

### All particles

Particles are output with updated poses.

If CTF parameters were refined during the job, these output particles also have updated CTF estimates. Note that this may mean that exposure group parameters for these particles differ from those of the micrographs. If the particles are re-extracted, ensure that `Force re-extract CTFs` from micrographs is off (the default setting) to retain these refined CTF parameters.

### Refined volume

The final volume produced by the refinement is output as `map`. It is filtered to the GSFSC resolution.

Additionally, a sharpening B-factor is automatically estimated and applied to the volume to produce a sharp volume (`map_sharp`). The B-factor is estimated using the [Guinier plot](https://guide.cryosparc.com/processing-data/tutorials-and-case-studies/tutorial-common-cryosparc-plots#guinier-plot).

Masks used for refinement and FSC calculation are available as `mask_refine` and `mask_fsc`, respectively. Typically, the mask used for FSC calculation is tighter than the mask used for refinement.

Half maps are available as `map_half_A` and `map_half_B`.

### Masks

In versions of CryoSPARC before v5, there is a single mask output, `mask`, which contains the refinement mask. It is the same as the `mask_refine` part of the Refined volume output.

Starting with CryoSPARC v5, each mask has its own output, typically `mask_refine` for the mask used during refinement, `mask_fsc` for the mask used to calculate the FSC, and `mask_fsc_auto` for the autotightened mask used to calculate the final FSC. See [Dynamic Masking in Refinements (v5.0+)](https://guide.cryosparc.com/processing-data/tutorials-and-case-studies/tutorial-dynamic-masking-in-refinements-v5.0) for more on mask generation in v5.

### Plots

The plots produced by Homogeneous Refinement are explained in [the Common CryoSPARC Plots](https://guide.cryosparc.com/processing-data/tutorials-and-case-studies/tutorial-common-cryosparc-plots) guide page.

## Common Problems

Refinement is the central process of single particle analysis. As such, it is difficult to provide an exhaustive overview of potential problems arising during refinements. However, a few pathologies are more common than others.

### Map has spikes or shells

Spikes of density radiating away from the center of the map or shells of density surrounding the map are both signs of overfitting. Often, this means that there is still a significant amount of “junk” in the particle stack, and more particle curation is necessary. If you’re unfamiliar with techniques for particle curation, they are covered in detail in a [case study in this guide](https://guide.cryosparc.com/processing-data/tutorials-and-case-studies/case-study-dktx-bound-trpv1-empiar-10059).

### Map has streaks or blurring along a single viewing direction

![](/files/RTYOSMqY7EXdGaMK5ewW)

This effect is called anisotropy, and is a telltale sign of orientation bias, also known as preferred orientation. Typically, correcting this issue requires new data, but some cases of anisotropy can be corrected with careful particle picking. Maps with these issues usually have low cFAR scores, which is a measure of map anisotropy. More information about orientation bias is available in the [Orientation Diagnostics tutorial](https://guide.cryosparc.com/processing-data/tutorials-and-case-studies/tutorial-orientation-diagnostics) and [a case study on EMPIAR 10096](https://guide.cryosparc.com/processing-data/tutorials-and-case-studies/case-study-picking-induced-orientation-bias-in-ha-trimer-empiar-10096-and-10097#re-picking-the-ha-dataset).

## Common Next Steps

Typically a volume needs to be visually inspected to understand the results of a refinement. In most cases, an improvement of visible features in the 3D map and/or a reduction in noise is desirable.

{% hint style="info" %}
A better GSFSC resolution alone may not be indicative of a truly improved map — visual inspection is an important component of the single particle analysis pipeline.
{% endhint %}

If noise features are visible (see Common Problems), the input particle stack should be cleaned and a new refinement re-run. At this stage, [Heterogeneous Refinement](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/3d-refinement/job-heterogeneous-refinement) or [Ab-Initio Reconstruction](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/3d-reconstruction/job-ab-initio-reconstruction) are typically most suited to particle curation (rather than 2D methods).

If one region of the map is high quality and others are blurry, a [Local Refinement](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/local-refinement/job-new-local-refinement-beta) with a focused mask on the blurry region may be useful. Simultaneously, [3D Classification](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/variability/job-3d-classification) may be able to separate particles into separate conformations, which can then be refined independently.

If the map looks symmetric (or if symmetry was imposed), performing a refinement with symmetry relaxation turned on may reveal some asymmetry hidden in the data. 3D Classification of [Symmetry Expanded](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/utilities/job-symmetry-expansion) particles with a mask around a single asymmetric unit of the map can also help classify asymmetry.

## Recommended Alternatives

Large, rigid objects like viruses tend to perform equally well with and without a spatially varying filter, so [Homogeneous Refinement](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/3d-refinement/job-homogeneous-refinement) may work as well as Non-Uniform Refinement in cases like these while using less memory and running faster.

[Local Refinement](https://guide.cryosparc.com/processing-data/all-job-types-in-cryosparc/local-refinement/job-new-local-refinement-beta) may perform better than Homogeneous and Non-Uniform Refinements when a particle has multiple domains which move relative to each other. This process is discussed in more detail in the Local Refinement job page, the [yeast tri-snRNP case study](https://guide.cryosparc.com/processing-data/tutorials-and-case-studies/case-study-yeast-u4-u6.u5-tri-snrnp), and [the TRPV1 case study](https://guide.cryosparc.com/processing-data/tutorials-and-case-studies/case-study-dktx-bound-trpv1-empiar-10059#masked-refinement-of-the-ctd) and [workshop recording](https://guide.cryosparc.com/processing-data/tutorial-videos#part-2-trpv1-and-a-standard-workflow).

## Non-Uniform Regularization

In statistical estimation methods, **regularization** is the application of outside knowledge to a problem. In the case of cryo-EM, one example of regularization is the application of a smoothing filter to the 3D map during refinement. In each refinement iteration, the data (noisy particle images) would be best fit by a spiky, noisy 3D map. However, we know that biomolecule density is generally smooth and that our data are noisy, so we **regularize** with a lowpass filter that removes high-resolution noise and spurious details. Typically [the GSFSC](/the-fsc-and-gold-standard-refinement.md#id-2aa4324a-3a7b-80d7-9da3-cafe99e4c42c) is both our most reliable estimate of the resolution and an appropriate global filter for the 3D map.

<figure><img src="/files/ibgaJjPvnhkDhMghXNKs" alt=""><figcaption></figcaption></figure>

In Homogeneous Refinements, we regularize the refinement by applying the GSFSC filter across the entire (masked) map. However, there are cases in which this is an overly optimistic or overly-pessimistic filter.

Consider a membrane protein in detergent micelles. We may be able to align the protein quite well, but the micelle will never look the same in every particle no matter how well it is aligned, since it is different in each particle image. When we filter the 3D map, we’d ideally use a higher resolution filter for the protein density (which we can align well, and so has reliable structural detail we'd like to keep) and a lower resolution filter for the micelle (which is unimportant and impossible to align, and so has artifactual structural detail we'd like to remove).

There is no single filter that will produce an optimal map in this case. The best choice is a compromise — filter at a resolution such that the micelle is only slightly overfit, and the helices are only slightly too blurry.

![An abstract representation of filtering during a Homogeneous Refinement. On the left, a diagram of the state of the map. Note that the helices (blue) and micelle (orange) are both blurred the same amount. On the right, points represent the noisy, unfiltered map voxels. The filtered map is represented with a line.](/files/YOkCCvnoEqLvAU3bt5Hi)

Non-Uniform Refinement takes advantage of the fact that we know some regions of the map (in this case, the helices) are more reliable than other regions (the micelle). We can use this information to perform a stricter regularization (i.e., a lower resolution filter) on the less reliable regions and trust the data more (i.e., use a higher resolution filter) in the more reliable regions. In other words, the **regularization** is **not uniform** across the map.

![An abstract representation of Non-Uniform Refinement using the same scheme as the previous figure.](/files/vb5N51ll7Kgoc7fIfDsJ)

Recall that this filter is applied during each iteration of refinement, not just when the map is output at the end of the job. Thus, each iteration of a Non-Uniform Refinement sees the more reliable regions at a higher resolution and the less reliable regions at a lower resolution. This typically improves the map over iterations, with higher resolution in the more reliable regions and reduced overfitting in the less reliable regions.

![A comparison of Homogeneous (left) and Non-Uniform (right) Refinement of a flexible, membrane-bound particle (Fab-bound membrane protein PfCRT, EMPIAR 10330). The same particles, starting map, and parameters were used for each.](/files/RW9928KsS62vdbqH4srx)

Note that this improvement is only expected if there actually are differences in the quality of the underlying data in different parts of the target, such as a micelle or flexible domain. If the particle is rigid and soluble, the quality of the data is more-or-less constant across the entire particle, and so the non-uniform regularization behaves essentially the same as uniform GSFSC regularization.

![A comparison of Homogeneous (left) and Non-Uniform (right) Refinement of a rigid particle (T20S proteasome, EMPIAR 10025). The same particles, starting map, and parameters were used for each.](/files/p4hvWXWvciP377eIDeHv)

## Implementation Details

{% hint style="info" %}
This section aims to provide an intuitive explanation of the implementation of Non-Uniform Regularization in CryoSPARC for interested readers. As such, some simplifications are made and some details are omitted. For a complete, formal explanation please see Punjani and colleagues 2020.

Throughout this section, we present illustrations of 2D maps for ease of visualization. The same principals apply in 3D.
{% endhint %}

#### Visual Vocabulary

![](/files/x4eX4l4MjkvqWuyIkKnk)

Whenever a diagram is meant to refer to a 3D *map*, we use a colored protein schematic. When a diagram is meant to refer to a 2D *particle image*, we use a black-and-white pixelated protein schematic.

When a diagram discusses an operation that occurs at *every position in a map or image*, a grid is overlaid on a protein schematic. Note that in reality, “every position” typically refers to every pixel/voxel, but fewer grid points will be shown in these diagrams to reduce visual clutter.

Here we use the example of a membrane protein. The transmembrane helices (blue) are taken to represent the part of the map that is well-aligned and consistent across all images. The micelle (orange) is taken to represent the region that is difficult to align and/or differs among all of the particle images. The explanation in this section could just as correctly be applied to a protein with a rigid region (which would be blue) and a flexible region (which would be orange).

#### Uniform Regularization

For comparison, first consider performing a refinement with uniform regularization. The dataset is split into two half-sets (A and B). Particle images in each of these half-sets are aligned to their own half-map without any filter. The half-map is then updated using the updated particle poses, producing unfiltered maps. These half-maps may contain some overfit noise, but because the noise is different in each half-set, each half-map’s overfit features are unique.

![](/files/t3dOnjxjj75x2mxmDiik)

We now regularize the problem by imposing a filter on the half maps. The ideal filter includes all of the real structural information and no overfit noise, but there is no way to directly know which features of a map are real and which are not. However, we can find an optimal filter using *cross-validation:*

![](/files/4FOiwvaIJc4BhuXNDrdh)

To evaluate how useful a particular filter is, we first apply it to one half map but not the other. For instance, if we filtered half-map A we’d produce $$\mathrm{A\_f}$$ and leave $$\mathrm{B}$$ untouched. The quality of this filter is measured by the error $$\mathrm{A\_f - B}$$.

* If the filter is too pessimistic, the problem will be over-regularized. $$\mathrm{A\_f}$$ will be missing real structural features which are present in $$\mathrm{B}$$. This can be measured as *error* between the two half maps.
* If the filter is too optimistic, the problem will be under-regularized. Too much high-frequency noise is kept in $$\mathrm{A\_f}$$ which again increases error compared to $$\mathrm{B}$$, because the overfitting in each map is unique.
* The optimal filter balances these two forces: it keeps as much real signal as it can in $$\mathrm{A\_f}$$ while removing enough noise that the error between the two maps is as low as possible.

We then apply the same filter to $$\mathrm{B}$$ and measure the error between $$\mathrm{B\_f}$$ and (unfiltered) $$\mathrm{A}$$. Once we find the single filter which minimizes the **total error** $$\mathrm{(A\_f - B) + (B\_f - A)}$$ we have found the optimal regularization filter. This optimal filter is applied to each half-map and the half-set particles are aligned to the filtered half-maps in the next iteration.

{% hint style="info" %}
The process of splitting the data into a *training set* (in this case, the filtered map) and a *validation set* (in this case, the unfiltered map) is called **cross-validation**. Although filtering the half-maps by the GSFSC is not usually described as a cross-validation approach, the optimal uniform filter found by the cross-validation process described above is effectively identical to the the standard GSFSC filter.
{% endhint %}

#### Non-Uniform Regularization

In uniform regularization, a single filter $$\mathrm{f}$$ is applied to every voxel in $$\mathrm{A}$$ and $$\mathrm{B}$$. For non-uniform regularization, we must produce a function $$\mathrm{F(\mathbf{x})}$$ which produces the *locally optimal* regularization filter $$\mathrm{f\_x}$$ around the coordinate $$\mathrm{\mathbf{x}}$$.

We will find $$\mathrm{F(\mathbf{x})}$$ using cross-validation, in much the same way that the uniform regularization filter was found previously. However, rather than compare one filtered half-map to the other, we split each half-set in half again (e.g., half set $$\mathrm{A}$$ becomes quarter sets $$\mathrm{A1}$$ and $$\mathrm{A2}$$). Each of these quarter sets produces a quarter map without being realigned. This prevents contamination of one half-set’s regularization parameters with information from the other, preserving the gold-standard half-set independence.

![](/files/I1hXpWriJ2u1qwgexs7j)

Then the same cross-validation procedure described for uniform regularization is used, but instead of comparing a filtered half map to an unfiltered half map, we compare **every voxel** of a quarter map to the same voxel position in the unfiltered quarter map. This produces a filter for every voxel that minimizes the error for that particular voxel.

![A schematic representation of non-uniform regularization. Every voxel has an optimal filter. In this diagram, filters with more high resolution information are represented by a high-frequency sine wave, while filters with only low resolution information are represented with low-frequency waves.](/files/DaLzJMKdAqwqihZkvxJ5)

This produces a set of filters which largely have the behavior we want: less reliable regions of the map are filtered more aggressively than more reliable regions. However, in this formulation the filter may change rapidly from voxel to voxel. For instance, in the diagram above some voxels in the helices are filtered to a very low resolution, while the adjacent voxel keeps all of its high resolution information.

In some cases, allowing the filter to change rapidly from voxel to voxel may be desirable (like the border voxels between ordered and disordered or solvent regions), but in general the filter should change smoothly. We therefore add one final constraint: the optimal non-uniform regularization filter should be *spatially smooth*. In other words, it is allowed to vary across the map, but not too quickly.

![A schematic representation of non-uniform regularization with smoothness enforced. Note that the filter resolution no longer rapidly changes from voxel to voxel, but still filters the helices with a finer resolution than the micelle and solvent.](/files/3pOE8KSHPEYfeTOP0XJ1)

This filter allows the map to have high-resolution features in the helices but removes high-frequency noise in the micelle while also avoiding the high voxel-to-voxel variability when the filter was not forced to be smooth.

The smoothness of the filter is controlled by the Non-uniform AWF (Adaptive Window Factor) parameter. If the AWF is set too low, the regularization will be able to respond quickly to changes in map quality but will be noisy (as in the first schematic). If it is too high, it will act more like uniform regularization since it is slow to respond to changes in map quality. In general, values between 2 and 3 balance these two forces well and the default of 3 is almost always appropriate.

![A schematic representation of non-uniform regularization with the AWF set too high. The filter is no longer able to respond to changes in the map and filters the helices and micelle almost identically.](/files/Roa5SpR4WIc2oFqM2NW0)

Here we have only produced diagrams showing the filter for one of the quarter-maps, but recall that cross-validation works by evaluating the quality of a filter by its *total error*, i.e., $$(\mathrm{A1\_{F({\mathbf{x})}} - A2) + (A2\_{F(\mathbf{x})} - A1)}$$.

Note also that each half set has its own independently estimated filter $$\mathrm{F(\mathbf{x})}$$, so each map is filtered without any information from the other half set. This means that Non-uniform Refinement follows a stricter adherence to half-set separation than Homogeneous Refinement, which uses a single GSFSC filter for both half sets.

## References

Punjani, A., Zhang, H. & Fleet, D. J. Non-uniform refinement: adaptive regularization improves single-particle cryo-EM reconstruction. *Nat. Methods* **17**, 1214–1221 (2020).
