Summary#

The postprocess.py command-line tool can be used to analyze the results generated by match_template.py.

postprocess.py --help

Top-scoring peaks can be identified using

postprocess.py \
    --input_file output.pickle \
    --output_prefix output \
    --output_format orientations \
    --min_distance 30 \
    --min_boundary_distance 20 \
    --num_peaks 1000

Identifying no more than 1,000 top-scoring peaks that are separated by at least 20 voxel from each other and 30 voxel from the boundaries. Different peak calling strategies can be chosen from using the --peak_caller argument.

Depending on the subequent use case, different output_format options are available and outlined below.

A tab-separated file output.tsv will be created in the process containing eight columns. The z, y and x column correspond to the translation, the euler_z, euler_y and euler_x column to the rotation used to obtain the column score. The detail column contains peak caller specific information.

postprocess.py \
    --input_file output.pickle \
    --output_prefix output \
    --output_format orientations \
    --min_distance 30 \
    --min_boundary_distance 20 \
    --num_peaks 1000

These options generate STAR files compatible with RELION 4 and 5. Both formats contain particle coordinates, Euler angles, scores, and source file references in a format that RELION can directly import. The coordinates and angles are identical to output_format orientations. The created files differ in version headers and in the coordinate system. Relion 4 uses voxel coordinates, Relion 5 centers coordinates and scales them by the voxel size.

postprocess.py \
    --input_file output.pickle \
    --output_prefix output \
    --output_format relion4 \
    --min_distance 20 \
    --num_peaks 1000

The code below will call peaks analogously to Orientations, but additionally also applies the identified orientation to the template and writes it to disk using the naming pattern {output_prefix}_{index}.{extension}. Index 0 corresponds to the highest scoring orientation.

postprocess.py \
    --input_file output.pickle \
    --output_prefix output \
    --output_format alignment \
    --num_peaks 10

The code below will call peaks analogously to Orientations, but additionally extract subsets centered around the peak with specified box size. The generated files follow the naming pattern {output_prefix}_{index}.mrc, where index 0 corresponds to the highest observed score.

postprocess.py \
    --input_file output.pickle \
    --output_prefix output \
    --output_format extraction \
    --min_distance 20 \
    --num_peaks 500 \
    --peak_caller PeakCallerMaximumFilter

The code below will call peaks analogously to Orientations, and compute a simple average based on the identified orientations.

postprocess.py \
    --input_file output.pickle \
    --output_prefix average \
    --output_format average \
    --min_distance 20 \
    --num_peaks 500 \
    --peak_caller PeakCallerMaximumFilter

Note

Orientations are following the conventions outlined in [1]. We use a right-handed coordinate system with orthogonal X, Y and Z axes. Euler angles are expressed using intrinsic ZYZ convention, with the first rotation around the Z-axis, the second around the new Y-axis and the third around the new Z-axis (see euler_to_rotationmatrix). The default orientation the z-unit vector (0, 0, 1).

References#