Skip to content

Tutorial: Basic reconstruction workflow in Ot2Rec

Elaine Ho edited this page Dec 14, 2022 · 1 revision

This tutorial covers tomogram reconstruction of EMPIAR 10364 with Ot2Rec. Here we’ve assumed that Ot2Rec, Ot2Rec Report, MotionCor2 and IMOD are already installed on your system. If you need help with this, please see the Ot2Rec / Ot2Rec Report wikis, the MotionCor2 installation page, or the IMOD installation page. You’ll need to run this on a GPU enabled Linux system. For reference, our system we used for this tutorial was a virtual Linux machine with 12 Intel Xeon Gold 5218 2.30GHz CPUs and 1 Tesla V100 GP.

  1. Download the example data

  2. Open a terminal and navigate to where the data is stored (replace /path/to/data with the actual path)

cd /path/to/data
  1. Create a new folder – this will be where your processing will be stored.
mkdir processing
cd processing
  1. Start a new Ot2Rec project by running
o2r.new

This creates a new Ot2Rec project and brings up the GUI to fill in the required parameters.

For this dataset, an example image filename is:

Click on create config file and close the GUI. There will now be 3 new files created:

  • new_proj.yaml – a logfile capturing output from Ot2Rec
  • TS_proj.yaml – a metadata file showing the parameters you’ve just filled into the GUI
  • TS_master_md.yaml – this holds all a record of the tilt angles, filenames, tilt series number, and image number, which have been extracted from the filenames. Ot2Rec uses this information to generate the commands to run processes on all the tilt series.
  1. We will now set up the Ot2Rec motioncor2 plugin.

First, ensure that motioncor2 is available on your system (RFI users: use module load motioncor2)

o2r.mc.new

Fill in the project name and pixel size of the data. The pixel size can usually be found in the mdoc or in the mrc header of your images. The MC2 output folder field sets where the motion corrected images will be stored, in this case, in the motioncor folder. You can change this if you’d like to. We have left the remaining parameters at their default values but you are free to change them if you would like to. Note that the path to mc2 executable field will probably be specific to your institution or system, depending on how motioncor2 is installed.

Again, click on the create config file button, close the dialog and two files will be created in your processing folder.

  • o2r_motioncor2.log – this stores the output of motioncor which appears in the terminal.
  • TS_mc2.yaml – this stores the user input you’ve added earlier, along with a process list.

The process list is the list of tilt series that will be processed if we run this plugin. You can edit this manually to only use a selection of the tilt series if you would like to.

  1. To run the motioncor2 plugin, we run
o2r.mc.run TS

Running Ot2Rec plugins requires the project name to be specified, so in this case we add “TS” after the run command to tell Ot2Rec to run the motion correction plugin on the project TS.

This will likely take a while but you can monitor the progress in the terminal. When complete, your motioncor folder should look like this:

  1. Now we will set up the tilt series alignment in IMOD.
o2r.imod.align.new

Fill in the relevant parameters, referring to the mdoc if necessary. Only parameters with *’s are compulsory to fill in.

Again, create the config file and close the dialog box. Two files will be created:

  • o2r_imod_align.log – holds the output from IMOD’s alignment method
  • TS_align.log – holds the configuration parameters from the input you just filled in.

Note that you may have to change the Path to BatchRunTomo directives template depending on where IMOD is installed on your system.

  1. Run the alignment step. Ensure IMOD is loaded (RFI users: use module load imod) Run the Ot2Rec IMOD alignment plugin:
o2r.imod.align.run TS

IMOD will then create the stacks (.st files) from the motion corrected files, using the filepaths saved in the TS_mc2_mdout.yaml file from step 6. After that, alignment will start. You can monitor the process in the terminal. If you’d like to view your aligned tilt series, you can open the _ali.mrc files in IMOD’s 3dmod or in Fiji.

  1. Set up the IMOD reconstruction process.
o2r.imod.recon.new

The thickness parameters determine how many z-slices will be in the reconstruction. Larger thickness values means you are less likely to inadvertently exclude regions of your specimen in the tomogram, but there might be lots of empty space in the tomogram. You can experiment with these parameters by doing a test run – generate the TS_recon.yaml file and edit the process list to only do one tilt series and see if you are happy with the result. Once you are, then you can generate a new TS_recon.yaml by rerunning this step with the parameters you have chosen.

  1. Run the IMOD reconstruction process
o2r.imod.recon.run TS
  1. Generate the Ot2Rec report. (temporary fix – this step will be redundant in the future)

Run o2r.imod.align.stats to generate the statistics for the alignment step to go into the report.

Activate the Ot2Rec report environment (see the Github for detailed instructions if required).

Generate the report by running:

o2r.report.run TS --to_html --to_slides

This generates the report as a html document that you can print to a pdf, or to a slide deck that you can also open in the browser. The report will be in your processing folder and it will be called “report.html” or “report.slides.html”.