Tilt-series preparation, alignment and tomogram reconstruction
Our initial steps for tilt-series motioncorrection, alignment and reconstruction are based on the tomotools package.
Motion Correction
- Generate a
movies.starfile that lists all frames:source params.sh cd $ROOT find frames/ > movies.starOpen the
movies.starfile and paste the 3 first lines of the below cell on top, so that the final file looks like this:data_global loop_ _rlnMicrographMovieName ./frames/Position_10_001_0.00_20241119_150207_EER.eer ./frames/Position_10_002_3.00_20241119_150229_EER.eer ./frames/Position_10_003_6.00_20241119_150252_EER.eer ... -
Copy your gain reference file into
$ROOT/frames/. - Use the Relion command below to sum EER frames into fractions for the motion correction. Adapt the
--eer_groupingparameter to specify the number of frames that will end up in one fraction. Ideally, you want a total of ~5 fractions with a total dose of ~150 e/A2.relion_convert_to_tiff --i ./movie.star --o frames_tiff/ --compression none --gain ./frames/*gain --eer_grouping 92Move all files that ended up outside of the subfolder into
./frames_tiff. - Modify the
.mdocfile to update to.tiffile extensions. You might first want to make a backup of the original mdoc:cp $TOMONAME.mrc.mdoc $TOMONAME.mrc.origin.mdoc sed -i 's/.eer/.tif/' $TOMONAME.mrc.mdoc -
Run the motion correction with tomotools
conda activate tomotools # Set motioncor executable export MOTIONCOR_EXECUTABLE=$MOTIONCOR_EXECUTABLE # Motion / gain correction tomotools preprocess --mcbin 1 --frames ./frames_tiff/frames/ --gainref ./frames_tiff/gain-reference.mrc $TOMONAME.mrc ./ts-aligned/
Tilt-series alignment and initial tomogram reconstruction
-
The tomotools reconstruct command will run a tilt-series alignment with AreTomo and a tomogram reconstruction in IMOD:
tomotools reconstruct -d 3000 -b 4 --aretomo ./ts-aligned/$TOMONAME.mrcThe resulting alignment and reconstruction can be used to check the quality of this tomogram.
WarpTools tomogram reconstruction
Tomograms that we selected for STA now need to be reconstructed a second time, using the previous AreTomo tilt-series alignment, and including a patch CTF estimation. For this, we use the WarpTools software.
- Export the tomotools alignment to warp
cd $ROOT mkdir warp conda activate tomotoolstomotools aretomo2warp --v2 --frames-dir ./frames_tiff ./ts-aligned ./ - With the shell script, reconstruct the tiltseries with warp
cd $ROOT/warp $REPOSITORY/warp_reconstruction.sh $ANGPIX $FRAMEEXPOSURE $RECBINNING
Finally, the folder structure should look something like this:
Tomograms
└───Position_XX_X
│ • Position_XX_X.mrc # Raw tilt series
│ • Position_XX_X.mrc.mdoc # Mdoc file
│
└───frames # Subfolder for EER frames
│ • Position_XX_X_001_-10.00_20251212_214747_EER.eer
│ • Position_XX_X_002_-7.00_20251212_214827_EER.eer
│ ...
│
└───frames_tiff
│ │ • gain-reference.mrc
│ │
│ └───frames # Subfolder for summed .tif frames
│ • Position_XX_X_001_-10.00_20251212_214747_EER.tif
│ • Position_XX_X_002_-7.00_20251212_214827_EER.tif
│ ...
│
└───ts-aligned # alignment and reconstruction by tomotools (AreTomo and IMOD)
│ │ • Position_XX_X_ali_filtered_rec_bin_X.mrc # IMOD reconstruction
│ │ • Position_XX_X_ali.mrc # tilt series aligned with AreTomo
│ │ ... # additional AreTomo alignment files, including even and odd tilt series
│ │
│ └───Position_XX_X_ali_Imod # Subfolder with Imod reconstruction files
│
│
└───warp # warp reconstruction
│ │ • warp_frameseries.settings
│ │ • warp_tiltseries.settings
│ │
│ └───frames # raw frames
│ └───imod # imod alignment files
│ └───mdoc
│ └───processing
│ └───reconstruction
│ │ • Position_XX_ali_X.XXApx.mrc # warp reconstruction (for picking)
│ │
│ └───deconv
│ │ • Position_XX_ali_X.XXApx.mrc # warp high-contrast reconstruction
│
Improve tilt-series alignment with MissAlign
We have found the recently developed MissAlign software to drastically improve the quality of tilt-series alignments. Here, we show how to use MissAlign to improve the AreTomo alignment made with the previous steps. MissAlign is a neural network which can be trained on multiple tilt-series.
-
Inside the
Tomogramsfolder, generate a folder calledmiss-alignmentandcdinto it. -
Copy the
update_warp_xml.pyandconfig_template.yamlfrom MissAlign into this folder and update their content according to your specifications, as detailed in the MissAlign docs. - For each tilt-series that you want to use for MissAlign training, copy its
_ali.xmlfile (generated by warp) into themiss-alignmentfolder:cp ../Position_XX_X/warp/processing/Position_XX_X_ali.xml . - Configure miss-alignment
conda activate miss-alignment python update_warp_xml.py - Run miss-alignment training
miss-alignment train --config-file config_template.yaml --training-devices 0,1 --reconstruction-devices 2,2,2,2,2,3,3,3,3,3 --dataloaders-per-trainer 5 --start-at-iteration 0 --prepare-stacks $ANGPIX_RECThis will take several hours, depending on your GPU configuration.
- Copy the
_ali.xmlfiles (which now contain the refined alignments) back into the warp processing folders:cp Position_XX_X_ali.xml ../Position_XX_X/warp/processing - Reconstruct the tomogram again with WarpTools, now without first importing the alignments:
cd $ROOT/warp WarpTools ts_defocus_hand --settings warp_tiltseries.settings --set_auto WarpTools ts_ctf --settings warp_tiltseries.settings --defocus_max 8 --range_high 4 WarpTools ts_reconstruct --settings warp_tiltseries.settings --angpix $ANGPIX_REC --dont_invert --deconv