-
Notifications
You must be signed in to change notification settings - Fork 4
Estimating the CTF
In order to correct for the CTF-induced information modulations that are introduced by defocusing your image in the TEM, we need to first estimate the CTF for each micrograph. If you'd like to learn more about the CTF (Contrast Transfer Function), make sure to check out Grant Jensen's cryo-EM course. (CTF lecture linked here)
The following python program will run CTFFIND3 on each of your EM micrographs and write a single output text file with all of the measured defocus values for all micrographs.
This is a python program that takes command line options. To see the input options required, just execute the program without any input options:
$ EM-processing/Estimating_CTF/estimateCTF_CTFFIND3.py Usage: estimateCTF_CTFFIND3.py --input= --apix= --mag= --cs= Options: -h, --help show this help message and exit --input=FILE Wild card containing absolute path to .mrc micrographs ('/path/micro/*.mrc') --apix=FLOAT Pixel size of micrographs --mag=INT Magnification of micrographs --cs=float Cs of microscope (mm) --kev=INT Accelerating voltage (keV) --ampContrast=FLOAT Amplitude contrast (0.07 - cryo; 0.15 - neg. stain) --relionoutput Flag to save CTFFIND output log files compatible with Relion for particle extraction -d debug
The input micrographs need to be in .mrc format (Read more about formats here).
In order for this program to run, it needs to have all .mrc micrographs specified via the wildcard input option. This means that you need to provide the complete path to the .mrc micrographs.
Importantly, the wildcard needs to be contained with single or double quotations: '.mrc' or ".mrc".
After running on all of the .mrc micrographs that you specify, and the program will output a text file containing the estimated defocus information ctf_param.txt for each micrograph.
Beyond the wildcard information for the micrographs, CTFFIND3 requires microscope parameters in order to measure the defocus within each image. These options are specified along with the wildcard so that the program can analysis your EM micrographs.
Flag to output Relion-compatible CTF information files. See below for a description of Relion-compatible output files.
This program will output a single text file ctf_param.txt, where each micrograph name will be listed alongside the estimated defocus in X and Y dimensions, along with the angle of astigmatism.
If you are going to extract your particles using Relion and then perform CTF-correction within Relion, then you will need to make sure to output Relion-compatible CTF information files. By specifying --relionoutput, you will have the ctf_param.txt file output, in addition to:
- all_micrographs.star - A Relion-formatted text file that contains CTF information for each micrograph in your dataset
- _ctffind3.log - each micrograph will have a text file that contains the same micrograph base name, but with a new extension: ctffind3.log. This file contains the CTF information calculated by CTFFIND3.
**Important processing note for Relion: **
By default this program will include Relion-specific paths for the micrograph folder as 'Micrographs'. This means that when processing your data using Relion, you need to put the .mrc micrographs, CTF estimation, and .box files into a directory named 'Micrographs.'
Similar to using CTFFIND3, CTFTILT is a program that simultaneously measures the defocus of a given image AND its tilt angle. This is required for RCT/OTR 3D volume calculations, so this routine is required for all ab initio analyses.
The workflow is very similar to CTFFIND3 above, except that the filename of the code is different:
$ EM-processing/Estimating_CTF/estimateCTF_CTFTILT.py Usage: estimateCTF_CTFTILT.py --input= --output= --apix= --tilt= --mag= --cs= --kev= --ampContrast= Options: -h, --help show this help message and exit --input=FILE Wild card containing absolute path to .mrc tilted micrographs ('/path/micro/*.mrc') --output=FILE Output filename --apix=FLOAT Pixel size of micrographs --tilt=int Estimate of tilt angle --mag=INT Magnification of micrographs --cs=float Cs of microscope (mm) --kev=INT Accelerating voltage (keV) --ampContrast=FLOAT Amplitude contrast (0.07 - cryo; 0.15 - neg. stain) -d debug