Dynamo Processor

This module implements the processing function for the Dynamo software package.

The module will create an Dynamo project directory and set up a new Matlab script to process the raw data from ets_generate_data.py through the Dynamo tomography pipeline.

processors.dynamo_processor.dynamo_main(root, name, dynamo_args)

The main method to drive Dynamo project set up.

The steps taken are:
  1. Make Dynamo dir

  2. Generate the volume index .doc file and the data table .tbl file for Dynamo

  3. Using the template script found at templates/dynamo/dynamo_process.m, generate a Matlab

    script which will take in the generated input files and extract the particles and create a Dynamo alignment project

Parameters
  • root – The ETSimulations project root directory

  • name – ETSimulations project name

  • dynamo_args – Dynamo processor parameters

Returns: None

processors.dynamo_processor.eman2_processor_to_dynamo(root, name, dynamo_args)
Starting from simulated data processed with the EMAN2 Processor, generate the Dynamo .doc and

.tbl files necessary for particle extraction and STA project setup

Parameters
  • root – The ETSimulations project root

  • name – The name used for naming the stacks

  • dynamo_args – The Dynamo Processor arguments

Returns: (the .doc file path, the .tbl file path, the table basename)

processors.dynamo_processor.eman2_real_to_dynamo(dynamo_args)
Starting from real data processed with the EMAN2, generate the Dynamo .doc and

.tbl files necessary for particle extraction and STA project setup

Parameters

dynamo_args – The Dynamo Processor arguments

Returns: (the .doc file path, the .tbl file path, the table basename)

processors.dynamo_processor.extract_e2_particles(stack_file, name, destination)

Unpack a stack of EMAN2 particles into individual sub-volume maps

Parameters
  • stack_file – The EMAN2 particle stack file (either a .lst set or .hdf stack)

  • name – The basename to assign to extracted maps

  • destination – The destination folder to place the extracted particles in

Returns: None

processors.dynamo_processor.extract_tilt_range(tlt_file)

Get the minimum and maximum ytilt angles from the .tlt file.

Parameters

tlt_file – The IMOD .tlt file to parse

Returns: (ymintilt, ymaxtilt)

processors.dynamo_processor.get_eman2_info(info_file, particle_name)

Given an EMAN2 tomogram info JSON file, extract the tilt range and the particle box size

Parameters
  • info_file – The tomogram JSON info file path

  • particle_name – The Boxer particle label to look for for the box size

Returns: A tuple of (min tilt angle, max tilt angle, box size)

processors.dynamo_processor.get_mrc_size(rec)
Return the half the size of each dimension for an MRC file, so that we can move the origin to

the center instead of the corner of the file

Parameters

rec – the MRC file to get the size of

Returns: A tuple (x/2, y/2, z/2) of the half-lengths in each dimension

processors.dynamo_processor.get_slicer_info(mod_file)

Open an IMOD .mod file and retrieve the Slicer information

Parameters

mod_file – The .mod file path

Returns: A list of Slicer point objects with keys {“angles”, “coords”}

processors.dynamo_processor.imod_processor_to_dynamo(root, name)
Starting from simulated data processed with the IMOD Processor, generate the Dynamo .doc and

.tbl files necessary for particle extraction and STA project setup

Parameters
  • root – The ETSimulations project root

  • name – The name used for naming the stacks

Returns: (the .doc file path, the .tbl file path, the table basename)

processors.dynamo_processor.imod_real_to_dynamo(dynamo_args)
Starting from real data processed with the IMOD Processor, generate the Dynamo .doc and

.tbl files necessary for particle extraction and STA project setup

Parameters

dynamo_args – The Dynamo Processor arguments

Returns: (the .doc file path, the .tbl file path, the table basename)

processors.dynamo_processor.parse_lst_file(filename)
Read EMAN2 .lst particle sets and extract a dictionary of particle numbers mapped to the

particle’s tomogram info file, extracted stack file, and local particle number within that tomogram

Parameters

filename – The .lst file path

Returns: A tuple of
(

Dictionary of { particle number: {“info”, “stack”, “local_no”} } objects, Dictionary of { stack: number of particles in stack }

)

processors.dynamo_processor.read_particle_params(json_file)
Given a particle_parms_*.json file from EMAN2 STA, extract the particle list and their

transformation matrices.

Parameters

json_file – The particle_parms_*.json file path

Returns: A tuple of (.lst file name, dictionary of {particle number, transformation matrix})

processors.dynamo_processor.rotate_positions_around_z(positions)
Given a list of coordinates, rotate them all by 90 degrees around the z-axis. This is used to

convert particle coordinates from the raw tiltseries to the final reconstruction’s coordinate system for simulated data.

Parameters

positions – A list of [x, y, z] coordinates

Returns: None

processors.dynamo_processor.shift_coordinates_bottom_left(coords, size, binning=1)
Given an XYZ tuple of particle coordinates and the reconstruction they came from, shift the

coordinates so that the origin is at the bottom-left of the tomogram

Parameters
  • coords – the (x, y, z) coordinates for the particle

  • size – the reconstruction MRC half-dimensions in (nx/2, ny/2, nz/2) form

  • binning – the bin factor from the original stack to the final reconstruction, to be used if you are using coordinates based on the original unbinned coordinate system

Returns: the new coordinates as a (x, y, z) tuple

processors.dynamo_processor.slicer_angles_to_dynamo_angles(angles)

Given a set of angles from IMOD’s Slicer, convert those angles to Dynamo format Euler angles

Parameters

angles – The (x, y, z) Slicer angles

Returns

The corresponding Euler angles for Dynamo

processors.dynamo_processor.transformation_matrix_to_euler(transformation_matrix)

Helper function to convert EMAN2 transformation matrix to Dynamo Euler angles

Parameters

transformation_matrix – The EMAN2 transformation matrix

Returns: The Dynamo Euler angles