Ctfplotter plots noise-subtracted, rotationally averaged power spectra from tilt series data and allows one to determine the position of the first zero of the microscope CTF. The power spectra are obtained by extracting small squares of image (referred to as tiles) that overlap by 50%, taking their 2D Fourier transforms, rotationally averaging the transforms to obtain one-dimensional curves, dividing by the corresponding curves obtained from images consisting only of noise, and summing these 1D curves. Once defocus is determined from such power spectra, the phase inversions of the CTF can be corrected with the program Ctfphaseflip. Defocus can be found in angular subranges of the tilt series. The defocus values are stored in a table so that they can be visualized, deleted, or recomputed if necessary. All of the values in the table are saved to the defocus file, which is provided as input to Ctfphaseflip.
|Angles||Open the tilt angle range and tile selection dialog.|
|Fitting||Open the Fitting Ranges and Methods dialog.|
|Zoom in again after zooming back out.|
|Zoom out after zooming in.|
|Adding Non-center Tiles button. If this button is enabled, the current estimation is based only on center tiles; push this button to add non-center tiles to the current estimation.|
|Print the plotted curves.|
|Bring up Qt assistant to display this page.|
Fitting to a CTF-like curve involves finding four to seven parameters, depending on the extent of the fit and whether the option Vary exponent of CTF function is selected. Varying the exponent can allow the curve to fit better to the width of the dip around the first zero, but since it adds a parameter, it can destabilize the fitting and produce bad results in some cases. One of the parameters of the curve is the defocus. The other parameters for a basic fit are an additive factor, a scaling factor, and the decay rate for an exponential that attenuates the curve. However, when there is detectable signal between the second and third zeros and the fitting region is extended to at least halfway between those zeros, the program automatically adds two more parameters, a scaling factor and decay rate for a second exponential. The benefit of this is illustrated in one of the examples below.
The range of the curve is set from the entries X1 Starts and X2 Ends. When the program first starts, it sets these values to be about 0.05/pixel before the first zero, and close to the second zero, respectively, based on the expected defocus. If necessary, you should adjust the starting value so that it is to the right of where the fitted curve strongly deviates from the actual. If the magenta curve become noisy and falls off before a second zero, you should also reduce the ending point of the fit to exclude that region. See the example below.
The fit does rely on an initial approximate value for the defocus and may fail if the actual defocus is far from that value. It takes this value either from the expected defocus or from the current defocus estimate, depending on whether the option is selected to use the current defocus estimate in the Tilt Angle Range Dialog. If the defocus revealed by the power spectrum is far from the expected defocus, you should either change the value of the expected defocus, or select the option to use the current defocus estimate and make sure that estimate is approximately correct.
You can also fit a polynomial to the region around the first zero. The Order of polynomial spin button allows you to select an order between 2 and 6, which involves finding 3 to 7 parameters. The goal here is to get a smooth curve through the dip; the minimum of the curve is taken as the location of the first zero.
As for CTF-like fitting, the range of the curve is set from the entries X1 Starts and X2 Ends. Since you are just trying to localize the dip at the first zero, you should restrict the range as necessary to get a good fit there.
Finding the zero at the intersection of two curves involves fitting two separate curves, before and after the first zero. Each can be fit to either a straight line or a Gaussian over the selected range. The program finds the intersection of the two curves, if possible, and assigns that as the first zero.
X1 sets the fitting range for the curve before the first zero, drawn in green. Use the X1 fitting method radio button to select whether to fit to a straight line or to a Gaussian.
X2 sets the fitting range for the curve after the first zero, drawn in blue. Use the X2 fitting method radio button to fit to a straight line or to a Gaussian.
This dialog also has a control, the Baseline fitting order, to allow a polynomial to be fit to the apparent baseline of the power spectrum at frequencies past the first zero. This polynomial can then be subtracted to make the baseline be flat. This fitting is not on by default (the order is 0) because this baseline adjustment can actually degrade the quality of fits to the curve itself in cases where the baseline is already relatively flat. An order of 2 is generally sufficient but orders of 3 and 4 are possible. The order can also be adjusted with hot keys 0, 1, 2, 3, and 4.
Starting tilt angle
Ending tilt angle:
The views with tilt angle greater than or equal to the starting angle but less than or equal to the ending angle will be included in the estimation. If you enter a value beyond the end of the range of angles in the tilt series, it will be adjusted to the starting or ending angle of the series.
Step angle range:
Pressing Step Up or Step Down will shift the angular range by the amount in the Step angle range by text box. This step size will be added to or subtracted from both the starting and ending tilt angles. If the shift would make one of the limiting angles go outside the bounds of the tilt series, both angles are changed by a lesser amount so as to keep the range the same size. The power spectrum is computed and fit to at the new angular range. The step size is initialized to be half the original angular range.
Once fitting parameters have been set optimally and an appropriate angular range has been chosen, the Autofit All Steps button can be used to step automatically to a series of angular ranges, find the defocus, and store the defocus in the table.
The + pushbutton will open up a section of the dialog for parameters that are rarely adjusted; they include:
This field starts out with the expected defocus value specified in the parameter file, but you can change it. Initially, this value is used to compute the expected frequency of the first zero of the power spectrum and to set the initial values of the X1 and X2 ranges which determine what segments of the power spectrum are fitted. When non-center tiles are being included, Ctfplotter uses a defocus to compute shifts needed to align the power spectra of non-center tiles with the CTF curve of center tiles. With the radio button group Which defocus to use, you can specify whether to use the expected defocus shown in the Expected defocus (um) Edit field or the defocus previously found by the program as the defocus for computing the shifts.
Initial tiles to include radio
Choose whether or not to include the noncenter tiles in the estimation when computing the power spectrum.
If Only central tiles is checked, only the center region defined by Center defocus tol will be included in the next computation, and the "Adding Non-center Tiles" button will be enabled. You need to push that button to add the left region defined by Left defocus tol and the right region defined by Right defocus tol to the estimation.
If All tiles is checked, all regions (center, left, right) will be included when the curve is recomputed, and the "Adding Non-center Tiles" button will be disabled.
Store Defocus in Table:
Push this button to store the defocus found for the selected views in the angles and defocus table. The defocus indicated by "D" is stored unless a second zero has been clicked, in which case the average defocus indicated by "D-avg" is stored.
Angles and Defocus Table:
This table shows the starting and ending tilt angle, the middle of the angular range, and the defocus value for each range where you have stored results. The lines are in order by the middle of the angular range. When you store a value for an angular range matching that of an existing line in the table, the existing defocus value is replaced with the new one. When the program starts, this table is loaded with values from an existing version of the output file. Below the table are three buttons that operate on the table:
Push the Delete Row button to delete the entry for the currently selected row of the table. If you store results for an angular range and then want to replace them with results from a wider or narrower range, you would need to delete the row with the initial results.
Push the Set Tilt Angles button to reset the starting and ending tilt angles to the values on the currently selected row of the table and recompute the power spectrum. To conveniently step through a series of angular ranges, click the mouse anywhere on a row to select that row of the table. Then press the Set Tilt Angles button with the mouse, or using the keyboard accelerator Alt-T. Thereafter, you can type an up or down arrow key to move up or down in the table and press this button again, without moving the mouse. Alternatively, you can double click in the table to select a row and have its power spectrum displayed.
Push the Save to File button to write the contents of the angles and defocus table to the output file.
The range of the display in Y is dominated by the power at low frequencies, so it is essential to zoom the display. This graph was zoomed by pressing the left mouse button with the cursor just above the second low hump in the magenta curve (at ~0.13 in X), then dragging the mouse to just below the curves and just to the left of 0.4 to set the lower right corner of the rubber band. Then the window looks like this:
Now we can see more clearly that the background subtraction is giving a reasonable power spectrum that is close to flat at high frequencies. The next step is to add in all of the tiles, either by pushing the "Adding Non-center Tiles" button or by opening the Angle range dialog and switching to the All tiles option. These two methods will give slightly different results, and the latter is actually preferable.
The power spectrum is much smoother and it is now easier to see that it has a discernable dip, but that the green curve does not fit very well. If we open the Fitting Range & Method dialog, we see that it is fitting from 0.215 to 0.39, a range that was determined from the nominal defocus but is not quite appropriate for the actual defocus. The range was changed to what was shown above in the dialog: the left side was moved to 0.19 to include more of the falling phase of the power spectrum, and the right side was reduced to 0.29 because the power spectrum drops off after that point, well before its second zero. At this point it is also clear that the actual defocus is different from 3 microns, so we select the Current defocus estimate radio button in the Angle Range dialog so that the shifting from non-centered tiles will be more accurate. If the fitting were unstable, a better way to do this would be to change the Expected defocus entry. After recomputing the curves and zooming the display again, it looks like this:
Here we see that the CTF-like fitting works fairly well near the bottom of the dip, and that it leads to a defocus estimate significantly different from the nominal defocus. Turning on the Vary exponent of CTF function gives a slightly different fit:
This fitting method can now be used over different angular ranges, and the results can be stored from each range. If Autofit All Steps is used over the full extent of the tilt series, four ranges have defocus values near 3.5 but the last one has a value of only 3.1 microns. The curve for this range lacks a dip, so this value is wrong. This problem is solved by restricting the high end of the extent analyzed to 57 degrees. After running with this extent and loading the last range to verify that its spectrum has a dip, the angle dialog looks like this:
Although there is no need to try the different fitting methods with this data set, they are illustrated next.
This panel shows the power spectrum for the initial angular range with a fourth-order polynomial fit to the frequency range shown in the dialog above. As is typical of polynomials, the green curve goes off wildly outside the fitting range.
This panel shows the power spectrum with determination of the zero from the intersection of two curves, with the frequency range as shown in the dialog above.
The second example is from microtubules decorated with Eg5, taken with a DE-12 direct detector camera at a nominal defocus of 6 microns. This shows the spectrum and CTF-like fit for an angular range of -20 to 20 degrees, after switching to including all tiles included and using the current defocus estimate.
The fitting range here was 0.085 to 0.19, and it needs to be changed because the defocus is different from the nominal value, and also because there is good signal between the second and third zeros. Changing the fitting range to 0.1 to 0.25 and varying the exponent of the CTF curve gives the following:
The curve fits the second peak much better now because the fit includes two exponential decays, one dominated by the falloff of the power spectrum before the first zero and the other to accommodate the very different decay from the first to the second peak. With this data set, it was possible to fit ranges of 10 degrees, although ranges of 20 degrees gave cleaner results at one end of the tilt range, but the data were too noisy to allow reliable fitting to every individual image.
The third example is from the ventral disk of Giardia, taken with a Gatan K2 camera in an electron-counting mode at a nominal defocus of 4 microns. This is the initial spectrum of -20 to 20 degrees after zooming, and selecting all tiles and the current defocus estimate.
Here, for whatever reason, the power spectra of the noise images do not match that of the actual data, and it is necessary to turn on the fitting to the baseline in the Fitting dialog.
With the baseline fitting turned on (with order 2, in this case), it is clear that the data can be fit to the third zero, and the fit here is with the fitting range set to end at 0.375. These data had low enough noise that it was possible to fit every image. This is accomplished by turning on the Fit each view separately check box and then pressing the button now labeled Autofit All Single Views.
This is a representative spectrum and fit from a tilt of 33 degrees.
Refer to Ctfplotter man page