IMOD Processor

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

The module will create an IMOD project directory and set up a batchruntomo run within it.

processors.imod_processor.add_defocus_to_adoc(adoc_file, defocus)

Helper function to add a defocus argument to an .adoc file :param adoc_file: The .adoc file :param defocus: The defocus value

Returns: None

processors.imod_processor.get_defocus_values(metadata_file, root)
Go through and update the batchruntomo adoc files for each tomogram to reflect the defocus

values found in the simulation metadata

Parameters
  • metadata_file – The sim_metadata.json metadata file generated by ets_generate_data.py

  • root – The directory in which the tomogram sub-directories are located

Returns: None

processors.imod_processor.imod_main(root, name, imod_args)

The method to set-up tiltseries processing using IMOD

The steps taken are:
  1. Make IMOD dir

  2. Copy over template batchruntomo files, as well as IMOD coarse alignment files (simulated

    data will not have enough signal usually to work well with the template-matching coarse alignment step, so we need to skip and fake that step)

  3. Fill in the specific parameters for the batchruntomo files based on the passed in

    arguments

Returns: None

processors.imod_processor.replace_adoc_values(adoc_file, imod_args)
Helper function to replace certain .adoc values for the batchruntomo run, specifically dealing

with the fiducial tracking options made available to the ets_process_data.py configs.

Parameters
  • adoc_file – The .adoc file path to edi

  • imod_args – The dictionary of IMOD Processor arguments

Returns: None

processors.imod_processor.replace_batchtomo_start_and_end_steps(com_file, start, end)

Helper function to edit the start and end step parameters in the batchruntomo .com file

Parameters
  • com_file – The path to the .com file

  • start – The batchruntomo start step

  • end – The batchruntom end step

Returns: None

processors.imod_processor.retrieve_orientations(metadata_file, name, root)
This will put a ‘T4SS_slicerAngles.csv’ file in each IMOD data sub-directory with the slicer

angles for particle in that tomogram (in the order of the coordinates defined in the input particle coordinates text file to TEM-Simulator, except rotated 90 degrees clockwise around the z-axis since the tomogram reconstruction causes such a rotation)

Parameters
  • metadata_file – The sim_metadata.json metadata file generated by ets_generate_data.py

  • name – Particle name

  • root – The directory in which the tomogram sub-directories are located

Returns: None

processors.imod_processor.run_binvol(input_file, output, options)

Helper function to run the IMOD binvol program to bin a tomogram

Parameters
  • input_file – The path to tomogram to bin

  • output – The path to write the binned tomogram to

Returns: None

processors.imod_processor.run_flip(input_file, output)
Helper function to run the IMOD clip flipyz program to rotate a tomogram 90 degrees around the

x-axis while maintaining consistent handedness with EMAN2 reconstructions

Parameters
  • input_file – The path to tomogram to rotate

  • output – The path to write the rotated tomogram to

Returns: None

processors.imod_processor.run_rotx(input_file, output)
Helper function to run the IMOD clip rotx program to rotate a tomogram 90 degrees around the

x-axis while maintaining handedness

Parameters
  • input_file – The path to tomogram to rotate

  • output – The path to write the rotated tomogram to

Returns: None

processors.imod_processor.run_submfg(com_file, cwd=None)

Helper function to run the IMOD submfg program which runs an IMOD .com file

Parameters
  • com_file – The path to the .com file to run

  • cwd – The current working directory to run the program under

Returns: None

processors.imod_processor.run_tomo3d(tomo3d_path, tlt, tiltseries, output, other_args)

Helper function to run the tomo3d SIRT reconstruction program

Parameters
  • tomo3d_path – The path to tomo3d executable

  • tlt – The tilt file

  • tiltseries – The tiltseries to reconstruct

  • output – The output reconstruction file path

  • other_args – Any other tomo3d options passed in

Returns: None

processors.imod_processor.set_up_batchtomo(root, name, imod_args)
Generates a new set of batchruntomo configuration files in the project directory, such as

the .com file for the batchruntomo run, the .adoc directive files, and the .ebt Etomo file

Parameters
  • root – The ets_generate_data.py project root path

  • name – The name of the project

  • imod_args – A dictionary of IMOD Processor arguments

Returns: The newly created IMOD .com file to run the batchruntomo