4d — cryoET

Processing scripts · 4d User Manual

← Back to “Processing sections & scripts”

cryoET — from EER tilt movies to a tomogram

The cryoET project mode brings the first stage of the lab's filament subtomogram-averaging protocol (amy-subtomo-averaging) into 4d: each tilt series is imported as one dataset, its EER movies are turned into TIFF movies, motion-corrected, aligned and reconstructed into a tomogram, and the Library shows the tilt series, the aligned tilt series and the tomogram side by side. The programs are built from their sources by subtomo/build_tools.sh (no SBGrid): RELION 5.0-beta-3, tomotools 0.5.1 with MotionCor3 1.2.4, AreTomo2 1.1.2 and IMOD 5.1.

#TitleWhat it does
10EER to TIFFRELION's relion_convert_to_tiff groups the EER frames of every tilt movie into fractions and writes TIFF movies, and the gain reference as an MRC file for them.
20Tomotoolstomotools motion-corrects the TIFF movies with MotionCor3 and stacks them by tilt angle, then aligns the tilt series with AreTomo2 and reconstructs the tomogram with IMOD.

The workflow

  1. Import the session folder (Import tab, import folder = the session). Every tilt series becomes one dataset in the Library, named after it: Position_11_5. The EER movies are not listed.
  2. Double-click the dataset to open its processing panel. In cryoET it holds the cryoET section only: run 10 EER to TIFF, then 20 Tomotools.
  3. Look at the result in the Library: the dataset's row shows the tilt series, and after step 20 also the aligned tilt series and the tomogram (below). A double-click on any of them opens the 3D file in IMOD's 3dmod.
On the Slurm queue by default. Both steps hand their work to the Slurm queue (the partition, CPUs, memory, GPUs and time of Preferences ▸ System ▸ Slurm), whether you press Run or Run on Slurm Queue, and follow the job: its log appears in the step's output as it grows, the progress bar moves with the job's stages, and the step ends with the job. A job goes on when 4d is closed; running the step again while its job is still in the queue follows that job instead of starting a second one (to start again, cancel it with scancel). Only where Slurm cannot be used — switched off in the Preferences, not reachable, or the job not accepted — the step runs on this computer, and says so.
The raw data are never changed. A dataset links the tilt series, its mdoc, its movies and the gain, and holds everything that is made for it as files of its own. Removing a dataset (Library: Delete or right-click ▸ Move to trash, then Empty TRASH permanently) removes all that was made for it, and only that: links to raw data are removed as links.

Folders

A session as 4d expects it, and a dataset after both steps:

<session>/                           the import folder
├── gain/*.gain                       the EER gain reference, one for all positions
├── Position_11_5/                    raw data, only read
│   ├── Position_11_5.mrc             the tilt series as saved
│   ├── Position_11_5.mrc.mdoc        its mdoc
│   └── frames/*.eer                  its tilt movies
└── Position_.../

<project>/auto/Position_11_5/        the dataset
├── Position_11_5.mrc            →    link to the tilt series
├── Position_11_5.mrc.origin.mdoc →   link to the mdoc
├── frames/  gain/               →    links to the movies and the gain
├── Position_11_5.mrc.mdoc            the mdoc naming the .tif movies (step 20)
├── Position_11_5.mrc.png             the tilt series' thumbnail (import)
├── movies.star  frames_tiff/         step 10
├── ts-aligned/                       step 20: aligned tilt series, tomogram, alignment
├── ts-aligned~/                      the previous run of step 20, when there is one
└── LOGS/  proc/                      4d's own

Import

10 — EER to TIFF

Purpose

MotionCor3, through tomotools, reads TIFF movies. This step converts the EER movies of all tilts with RELION, summing EER frames into fractions, as in the lab's protocol:

relion_convert_to_tiff --i movies.star --o frames_tiff/ --compression none --gain <gain> --eer_grouping 96

movies.star lists the movies in frames/ (written by the step: no editing by hand).

Parameters

ParameterRole
tomo_eer_gainThe EER gain reference given to RELION (--gain). Set at import to the one .gain of the gain folder; empty, the step takes the one in gain/ and fills it in.
tomo_eer_groupingEER frames per fraction (--eer_grouping, 96). The protocol aims at about 5 fractions per tilt. Best is a number that divides the EER frame count: RELION drops the frames left over after the last full fraction (576 frames: 96 gives 6 fractions and drops none, 92 gives 6 and drops 24).
tomo_threadsMovies converted at the same time (--j, 16).
slurm_*The Slurm queue settings of the Preferences, shown for reference.

Results

movies.star, and frames_tiff/ with frames/*.tif and gain-reference.mrc. RELION does not apply the EER gain to the movies: it converts it into gain-reference.mrc, which step 20 applies.

Running it again

Makes the TIFF movies anew (a new grouping never mixes with old movies), and sets the tomogram of step 20, made from the old movies, aside as ts-aligned~.

20 — Tomotools

Purpose

From the TIFF movies to a tomogram, as in the lab's protocol:

tomotools preprocess --mcbin 1 --frames frames_tiff/frames/ --gainref frames_tiff/gain-reference.mrc Position_11_5.mrc ts-aligned/
tomotools reconstruct -d 3000 -b 4 --aretomo --gpu 0 ./ts-aligned/Position_11_5.mrc
  1. Motion correction (tomotools preprocess): MotionCor3 corrects each tilt movie with the gain reference, and the tilts are stacked in tilt-angle order (with even and odd half-sums).
  2. The mdoc: tomotools finds each tilt's movie by the file name in the mdoc, so the mdoc must name the .tif movies. The step writes the dataset's Position_11_5.mrc.mdoc as a copy with .eer → .tif and keeps the link to the original as Position_11_5.mrc.origin.mdoc.
  3. Alignment and reconstruction (tomotools reconstruct): AreTomo2 aligns the tilt series, the aligned stack is binned and dose-filtered, IMOD reconstructs and trims the tomogram.
  4. For the Library: ts-aligned/Position_11_5_ali.mrc and ts-aligned/Position_11_5_rec.mrc name the aligned tilt series and the tomogram, with their thumbnails.

Parameters

ParameterRole
tomo_gainrefThe gain reference for the TIFF movies (--gainref): frames_tiff/gain-reference.mrc, the one step 10 wrote.
tomo_mc_binMotionCor3 binning (--mcbin, 1).
tomo_thicknessTomogram thickness in unbinned pixels (-d, 3000).
tomo_binTomogram binning (-b, 4).
slurm_*The Slurm queue settings of the Preferences; one GPU is enough.

Results

In ts-aligned/: the motion-corrected tilt series Position_11_5.mrc (and its even/odd halves), the alignment Position_11_5.aln, the aligned tilt series Position_11_5_ali.mrc, the tomogram Position_11_5_ali_filtered_rec_bin_4.mrc (for 4d: Position_11_5_rec.mrc), and the thumbnails. The log reports the tilt range AreTomo2 used.

Running it again

The previous ts-aligned/ becomes ts-aligned~ (replacing an older one), and the step starts from an empty folder. A ts-aligned/ of a run that did not finish (it failed, was cancelled, or its alignment did not pass) is deleted instead, so it never replaces a good backup.

The Library row

The cryoET overview Tomogram shows one row of three per dataset: the tilt series, the aligned tilt series and the tomogram. Each is a 4d thumbnail of its central image — the tilt closest to 0° for a tilt series, the middle slice for the tomogram — so the row comes up fast; a double-click opens the 3D file in 3dmod (IMOD of the dir_imod preference, else $IMOD_DIR, else the one of subtomo/build_tools.sh).

Tilt series, aligned tilt series and tomogram of Position_11_5
Tilt series (0°)Aligned tilt series (0°)Tomogram (central slice)

When something goes wrong

MessageWhat to do
The cryoET tools are not installedBuild them once in the 4d source folder: subtomo/build_tools.sh all. Every installation finds them there through its subtomo link, which build_all makes.
need the EER gain referencePut the session's .gain into a gain/ folder next to the position folders, or set tomo_eer_gain.
No TIFF movies yet / No gain reference frames_tiff/…Run step 10 first (again).
tomotools made no motion-corrected tilt seriesThe movies the mdoc names were not found in frames_tiff/frames/: check that frames/ holds this tilt series' EER movies, then run step 10 again.
AreTomo2 aligned without the tilt anglesThe alignment came out without valid angles (see ts-aligned/<name>.aln); the step stops instead of showing a broken tomogram. Run step 20 again.
Slurm job … still in the queue: following itA job of this step for this dataset is running already; the step follows it. To start anew: scancel <job>, then run the step.
Slurm job … of step … is still in the queue / another step of stage1.sh is runningOnly one step runs on a dataset at a time, as they replace each other's files. Wait for it to end, or cancel its job, then run the step.
Slurm does not answerA recorded job could not be checked and may still be running, so nothing was started. Run the step again once Slurm answers.