원시데이터 수집 시스템
선정목록으로

cisTEM, user-friendly software for single-particle image processing

관련 필름·전자재료 · (16) CPI(투명 폴리이미드)

기본 정보

저자
  1. Timothy Grant — Janelia Research Campus, Howard Hughes Medical Institute, Ashburn, United States|||University of Virginia, United States
  2. Alexis Rohou — Janelia Research Campus, Howard Hughes Medical Institute, Ashburn, United States
  3. Nikolaus Grigorieff — Janelia Research Campus, Howard Hughes Medical Institute, Ashburn, United States|||University of Virginia, United States
DOI
10.7554/elife.35383
저널
eLife
발행년도
2018
발행기관
eLife Sciences Publications Ltd
피인용수
983
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.7554/elife.35383
토픽
Electron and X-Ray Spectroscopy Techniques
OpenAlex ID
W2791354025

평가 내용

관련도
관련
사업분야
필름·전자재료 · (16) CPI(투명 폴리이미드)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '필름·전자재료 > CPI(투명 폴리이미드)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

We have developed new open-source software called <i>cis</i>TEM (computational imaging system for transmission electron microscopy) for the processing of data for high-resolution electron cryo-microscopy and single-particle averaging. <i>cis</i>TEM features a graphical user interface that is used to submit jobs, monitor their progress, and display results. It implements a full processing pipeline including movie processing, image defocus determination, automatic particle picking, 2D classification, ab-initio 3D map generation from random parameters, 3D classification, and high-resolution refinement and reconstruction. Some of these steps implement newly-developed algorithms; others were adapted from previously published algorithms. The software is optimized to enable processing of typical datasets (2000 micrographs, 200 k - 300 k particles) on a high-end, CPU-based workstation in half a day or less, comparable to GPU-accelerated processing. Jobs can also be scheduled on large computer clusters using flexible run profiles that can be adapted for most computing environments. <i>cis</i>TEM is available for download from cistem.org.

본문 81,738자

본문 펼치기
1 _cis_ TEM: User-friendly software for single-particle image processing 2 3 Tim Grant <sup>1</sup>, Alexis Rohou <sup>1,2</sup> and Nikolaus Grigorieff <sup>1</sup> 4 1 Janelia Research Campus, Howard Hughes Medical Institute, Ashburn, Virginia, USA 5 2 Present address: Department of Structural Biology, Genentech, South San Francisco, California, USA 6 7 Abstract 8 We have developed new open-source software called _cis_ TEM (computational imaging system 9 for transmission electron microscopy) for the processing of data for high-resolution electron 10 cryo-microscopy and single-particle averaging. _cis_ TEM features a graphical user interface that is 11 used to submit jobs, monitor their progress, and display results. It implements a full processing 12 pipeline including movie processing, image defocus determination, automatic particle picking, 13 2D classification, ab-initio 3D map generation from random parameters, 3D classification, and 14 high-resolution refinement and reconstruction. Some of these steps implement newly-developed 15 algorithms; others were adapted from previously published algorithms. The software is 16 optimized to enable processing of typical datasets (2000 micrographs, 200k – 300k particles) on 17 a high-end, CPU-based workstation in half a day or less, comparable to GPU-accelerated 18 processing. Jobs can also be scheduled on large computer clusters using flexible run profiles that 19 can be adapted for most computing environments. _cis_ TEM is available for download from 20 cistem.org. 21 22 Introduction 23 The three-dimensional (3D) visualization of biological macromolecules and their assemblies by 24 single-particle electron cryo-microscopy (cryo-EM) has become a prominent approach in the 25 study of molecular mechanisms (Cheng et al., 2015; Subramaniam et al., 2016). Recent advances 26 have been primarily due to the introduction of direct electron detectors (McMullan et al., 2016). 27 With the improved data quality, there is increasing demand for advanced computational 28 algorithms to extract signal from the noisy image data and reconstruct 3D density maps from 29 them at the highest possible resolution. The promise of near-atomic resolution (3 – 4 Å), where 30 densities can be interpreted reliably with atomic models, has been realized by many software 31 tools and suites (Frank et al., 1996; Hohn et al., 2007; Lyumkis et al., 2013; Punjani et al., 2017; 32 Scheres, 2012; Tang et al., 2007; van Heel et al., 1996). Many of these tools implement a 33 standard set of image processing steps that are now routinely performed in a single particle 34 project. These typically include movie frame alignment, contrast transfer function (CTF) 35 determination, particle picking, two-dimensional (2D) classification, 3D reconstruction, 36 refinement and classification, and sharpening of the final reconstructions. 37 We have written new software called _cis_ TEM to implement a complete image processing 38 pipeline for single-particle cryo-EM, including all these steps, accessible through an easy-to-use 39 graphical user interface (GUI). Some of these steps implement newly-developed algorithms 40 described below; others were adapted from previously published algorithms. _cis_ TEM consists of 41 a set of compiled programs and tools, as well as a wxWidgets-based GUI. The GUI launches 42 programs and controls them by sending specific commands and receiving results via TCP/IP 43 sockets. Each program can also be run manually, in which case it solicits user input on the 44 command line. The design of _cis_ TEM, therefore, allows users who would like to have more 45 control over the different processing steps to design their own procedures outside the GUI. To 46 adopt this new architecture, a number of previously existing Fortran-based programs were 47 rewritten in C++, including Unblur and Summovie (Grant and Grigorieff, 2015b), 48 mag_distortion_estimate and mag_distortion_correct (Grant and Grigorieff, 2015a), CTFFIND4 49 (Rohou and Grigorieff, 2015), and Frealign (Lyumkis et al., 2013). Additionally, algorithms 50 described previously were added for particle picking (Sigworth, 2004), 2D classification 51 (Scheres et al., 2005) and ab-initio 3D reconstruction (Grigorieff, 2016), sometimes with 52 modifications to optimize their performance. _cis_ TEM is open-source and distributed under the 53 Janelia Research Campus Software License 54 (http://license.janelia.org/license/janelia_license_1_2.html). 55 _cis_ TEM currently does not support computation on graphical processing units (GPUs). 56 Benchmarking of a hotspot identified in the global orientational search to determine particle 57 alignment parameters showed that an NVIDIA K40 GPU performs approximately as well as 16 58 Xeon E5-2687W CPU cores after the code was carefully optimized for the respective hardware 59 in both cases. Since CPU code is more easily maintained and more generally compatible with 60 existing computer hardware, the potential benefit of GPU-adapted code is primarily the lower 61 cost of a high-end GPU compared with a high-end CPU. We chose to focus on optimizing our 62 code for CPU. 63 64 Results 65 _Movie alignment and CTF determination_ 66 Movie alignment and CTF determination are based on published algorithms previously 67 implemented in Unblur and Summovie (Grant and Grigorieff, 2015b), and CTFFIND4 (Rohou 68 and Grigorieff, 2015), respectively, and these are therefore only briefly described here. Unblur 69 determines the translations of individual movie frames necessary to bring features (particles) 70 visible in the frames into register. Each frame is aligned against a sum of all other frames that is 71 iteratively updated until there is no further change in the translations. The trajectories along the 72 x- and y-axes are smoothed using a Savitzky–Golay filter to reduce the possibility of spurious 73 translations. Summovie uses the translations to calculate a final frame average with optional 74 exposure filtering to take into account radiation damage of protein and maximize its signal in the 75 final average. _cis_ TEM combines the functionality of Unblur and Summovie into a single panel 76 and exposes all relevant parameters to the user (Figure 1). Both programs were originally written 77 in Fortran and have been rewritten entirely in C++. 78 CTFFIND4 fits a calculated two-dimensional CTF to Thon rings (Thon, 1966) visible in the 79 power spectrum calculated from either images or movies. The fitted parameters include 80 astigmatism and, optionally, phase shifts generated by phase plates. When computed from 81 movies, the Thon rings are often more clearly visible compared to Thon rings calculated from 82 images (Figure 2; (Bartesaghi et al., 2014)). When selecting movies as inputs, the user can 83 specify how many frames should be summed to calculate power spectra. An optimal value to 84 amplify Thon rings would be to sum the number of frames that correspond to an exposure of 85 about 4 electrons/Å <sup>2</sup> (McMullan et al., 2015). 86 Since our original description of the CTFFFIND4 algorithm (Rohou and Grigorieff, 2015), 87 several significant changes were introduced. (1) The initial exhaustive search over defocus 88 values can now be performed using a one-dimensional version of the CTF (i.e. with only two 89 parameters: defocus and phase shift) against a radial average of the amplitude spectrum. This 90 search is much faster than the equivalent search over the 2D CTF parameters (i.e., four 91 parameters: two for defocus, one for astigmatism angle and one for phase shift) and can be 92 expected to perform well except in cases of very large astigmatism (Zhang, 2016). Once an 93 initial estimate of the defocus parameter has been obtained, it is refined by a conjugate gradient 94 minimizer against the 2D amplitude spectrum, as done previously. In _cis_ TEM, the default 95 behavior is to perform the initial search over the 1D amplitude spectrum, but the user can revert 96 to previous behavior by setting a flag in the “Expert Options” of the “Find CTF” Action panel. 97 (2) If the input micrograph’s pixel size is smaller than 1.4 Å, the resampling and clipping of its 98 2D amplitude spectrum will be adjusted so as to give a final spectrum for fitting with an edge 99 corresponding to 1/2.8 Å <sup>-1</sup>, to avoid all of the Thon rings being located near the origin of the 100 spectrum, where they can be very poorly sampled. (3) The computation of the quality of fit 101 (????? in (Rohou and Grigorieff, 2015)) is now computed over a moving window, similar to 102 (Sheth et al., 2015), rather than at intervals delimited by nodes in the CTF. (4) Following 103 background subtraction as described in (Mindell and Grigorieff, 2003), a radial, cosine-edged 104 mask is applied to the spectrum, and this masked version is used during search and refinement of 105 defocus, astigmatism and phase shift parameters. The cosine is 0.0 at the Fourier space origin, 106 and 1.0 at a radius corresponding to 1/4 Å <sup>-1</sup>, and serves to emphasize high-resolution Thon rings, 107 which are less susceptible to artefacts caused by imperfect background subtraction. For all 108 outputs from the program (diagnostic image of the amplitude spectrum, 1D plots, etc.), the 109 background-subtracted, but non-masked, version of the amplitude spectrum is used. (5) Users 110 receive a warning if the box size of the amplitude spectrum and the estimated defocus parameters 111 suggest that significant CTF aliasing occurred (Penczek et al., 2014). 112 113 _Particle picking_ 114 Putative particles are found by matching to a soft-edged disk template, which is related to a 115 convolution with Gaussians (Voss et al., 2009) but uses additional statistics based on an 116 algorithm originally described by (Sigworth, 2004). The use of a soft-edged disk template as 117 opposed to structured templates has two main advantages. It greatly speeds up calculation, 118 enabling picking in ‘real time’, and alleviates the problem of templates biasing the result of all 119 subsequent processing towards those templates (Henderson, 2013; Subramaniam, 2013; van 120 Heel, 2013). Any bias that is introduced will be towards a featureless “blob” and will likely be 121 obvious if present. 122 Rather than fully describing the original algorithm by (Sigworth, 2004), we will emphasize here 123 where we deviated from it. The user must specify three parameters: the radius of the template 124 disk, the maximum radius of the particle, which sets the minimum distance between picks, and 125 the detection threshold value, given as a number of standard deviations of the (Gaussian) 126 distribution of scores expected if no particles were present in the input micrograph. Values of 1.0 127 to 6.0 for this threshold generally give acceptable results. All other parameters mentioned below 128 can usually remain set to their default values. 129 Prior to matched filtering, micrographs are resampled by Fourier cropping to a pixel size of 15 Å 130 (the user can override this by changing the “Highest resolution used in picking” value from its 131 default 30 Å), and then filtered with a high-pass cosine-edged aperture to remove very low 132 frequency density ramps caused by variations in ice thickness or uneven illumination. 133 The background noise spectrum of the micrograph is estimated by computing the average 134 rotational power spectrum of 50 areas devoid of particles, and is then used to “whiten” the 135 background (shot + solvent) noise of the micrograph. Normalization, including CTF effects, and 136 matched filtering are then performed as described (Sigworth, 2004), except using a single 137 reference image and no principal components’ decomposition. When particles are very densely 138 packed on micrographs, this approach can significantly over-estimate the background noise 139 power so that users may find they have to use lower thresholds for picking. It might also be 140 expected that under those circumstances, micrographs with much lower particle density will 141 suffer from a higher rate of false-positive picks. 142 One difficulty in estimating the background noise spectrum of the micrograph is to locate areas 143 devoid of particles without a priori knowledge of their locations. Our algorithm first computes a 144 map of the local variance and local mean in the micrograph (computed over the area defined by 145 the maximum radius given by the user (Roseman, 2004; van Heel, 1982)) and the distribution of 146 values of these mean and variance maps. The average radial power spectrum of the 50 areas of 147 the micrograph with the lowest local variance is then used as an estimate of the background noise 148 spectrum. Optionally, the user can set a different number of areas to be used for this estimate (for 149 example if the density of particles is very high or very low) or use areas with local variances 150 closest to the mode of the distribution of variances, which may also be expected to be devoid of 151 particles. 152 Matched-filter methods are susceptible to picking high-contrast features such as contaminating 153 ice crystals or carbon films. (Sigworth, 2004) suggests subtracting matched references from the 154 extracted boxes and examining the remainder in order to discriminate between real particles and 155 false positives. In the interest of performance, we decided instead to pick using a single artificial 156 reference (disk) and to forgo such subtraction approaches. To avoid picking these kinds of 157 artifacts, the user can choose to ignore areas with abnormal local variance or local mean. We find 158 that ignoring high-variance areas often helps avoid edges of problematic objects, e.g. ice crystals 159 or carbon foils, and that avoiding high- and low-mean areas helps avoid picking from areas 160 within them, e.g. the carbon foil itself or within an ice crystal (Figure 3). The thresholds used are 161 set to ??+ 2 ???? for the variance and ??± 2 ???? for the mean, where ?? is the mode 162 (i.e. the most-commonly-occurring value) and ???? the full width at half-maximum of the 163 distribution of the relevant statistic. For micrographs with additional phase plate phase shifts 164 between 0.1 and 0.9 π, where much higher contrast is expected, the variance threshold is 165 increased to ??+ 8 ????. We have found that in favorable cases many erroneous picks can 166 be avoided. Remaining false-positive picks are removed later during 2D classification. 167 Because of our emphasis on performance, our algorithm can be run nearly instantaneously on a 168 typical ~4K image, using a single processor. In the Action panel, the user is presented with an 169 “Auto preview” mode to enable interactive adjustment of the picking parameters (Figure 3). In 170 this mode, the micrograph is displayed with optional and adjustable low-pass and high-pass 171 filters, and the results of picking using the currently selected parameters are overlaid on top. 172 Changing one or more of the parameters leads to a fast re-picking of the displayed micrograph, 173 so that the parameters can be optimized in real-time. Once the three main parameters have been 174 adjusted appropriately, the full complement of input micrographs can be picked, usually in a few 175 seconds or minutes. 176 A possible disadvantage of using a single disk template exists when the particles to be picked are 177 non-uniform in size or shape (e.g. in the case of an elongated particle). In this case, it may be 178 expected that a single template would have difficulty in picking all the different types and views 179 of particles present, and that in this case using a number of different templates would lead to a 180 more accurate picking. In practice, we found that with careful optimization of the parameters, 181 elongated particles and particles with size variation (Figure 3) were picked adequately. 182 The underlying implementation of the algorithm supports multiple references as well as 183 reference rotation. These features may be exposed to the graphical user interface in future 184 versions, for example enabling the use of 2D class averages as picking templates (Scheres, 185 2015). 186 187 _2D classification_ 188 2D classification is a relatively quick and robust way to assess the quality of a single-particle 189 dataset. _cis_ TEM implements a maximum likelihood algorithm (Scheres et al., 2005) and 190 generates fully CTF-corrected class averages that typically display clear high-resolution detail, 191 such as secondary structure. Integration of the likelihood function is done by evaluating the 192 function at defined angular steps ?? that are calculated according to 193 ??= ?/? (1) 194 where ? is the resolution limit of the data and ? is the diameter of the particle (twice the mask 195 radius that is applied to the iteratively-refined class averages). _cis_ TEM runs a user-defined 196 number of iterations ? defaulting to 20. To speed up convergence, the resolution limit is adjusted 197 as a function of iteration cycle ? (0 ≤?< ?): 198 ?= ?????? + ?(??????ℎ −??????)⁄(?−1) (2) 199 where ?????? and ??????ℎ are user-defined resolution limits at the first and last iteration, 200 defaulting to 40 Å and 8 Å, respectively. The user also sets ?, the number of classes to calculate. 201 Depending on this number and the number of particles ? in the dataset, only a percentage ? of 202 the particles are included in the calculation. These particles are randomly reselected for each 203 iteration and ? is typically small, for example 0.1, in the first 10 iterations (?0−9), then increases 204 to 0.3 for iteration 10 to 14 (?10−14) and finishes with five iterations including all data (?15−19): ⁄ 300??⁄ < 1 205 ?0−9 = { <sup>300??,</sup> 1, 300??⁄ ≥1 206 ?10−14 = { <sup>0.3, ?0−9</sup> <sup>< 0.3</sup> (3) ?0−9, ?0−9 ≥0.3 207 ?15−19 = 1 . 208 For example, for a dataset containing ?= 100,000 particles, ?0−9 = 0.15, i.e. 15% of the data 209 will be used to obtain ?= 50 classes. Apart from speeding up the calculation, the stepwise 210 increase of the resolution limit and the random selection of subsets of the data also reduce the 211 chance of overfitting (see also the calculation of ab-initio 3D reconstructions and 3D refinement 212 below) and, therefore, increase the convergence radius of the 2D classification algorithm. 213 For the calculation of the likelihood function, the particle images X ? are noise-whitened by 214 dividing their Fourier transforms ℱ{ X ?} by the square root of the radially average noise power 215 spectrum, ???: 216 ℱ{ X ̃?}(?) = ℱ{ X ?}(?)⁄√???(?) (4) 217 where ? is the 2D reciprocal space coordinate and ?= |?| its magnitude. The noise power 218 spectrum is calculated from the boxed particle images using the area outside the circular mask 219 set by the user according to the expected particle size. To increase accuracy, it is further 220 averaged across 2000 randomly selected particles. The background (density outside the mask) is 221 further normalized by adding a constant to each particle that yields a background average of 222 zero. 223 Finally, at the beginning of each iteration, noise features in the class averages A ? are suppressed 224 by resetting negative values below a threshold ?? to the threshold: 225 ?? = −0.3 max ??,? (5) ? 226 where ? runs over all pixels in average A ?. 227 228 _3D refinement (FrealignX)_ 229 The refinement of 3D reconstructions in _cis_ TEM uses a version of Frealign (Lyumkis et al., 230 2013) that was specifically designed to work with _cis_ TEM. Most of Frealign’s control 231 parameters are exposed to the user in the “Manual Refine” Action panel (Figure 4). The “Auto 232 Refine” and “Ab-Initio” panels also use Frealign but manage many of the parameters 233 automatically (see below). Frealign’s algorithm was described previously (Grigorieff, 2007; 234 Lyumkis et al., 2013) and this section will mostly cover important differences, including a new 235 objective function used in the refinement, different particle weighting used in reconstructions, 236 optional likelihood-based blurring, as well as new masking options. 237 Matched filter To make Frealign compatible with _cis_ TEM’s GUI, the code was completely 238 rewritten in C++, and it will be referred to here as Frealign v10, or FrealignX. The new version 239 makes use of a matched filter (McDonough and Whalen, 1995) to maximize the signal in cross 240 correlation maps calculated between particle images and reference projections. This requires 241 whitening of the noise present in the images and resolution-dependent scaling of the reference 242 projections to match the signal in the noise-whitened images. Both can be achieved if the spectral 243 signal-to-noise ratio (SSNR) of the data is known. As part of a 3D reconstruction, Frealign 244 calculates the resolution-dependent ?????, the radially averaged SSNR present in the particle 245 images before they are affected by the CTF (Sindelar and Grigorieff, 2012). Using ????? and 246 the CTF determined for a particle, the SSNR in the particle image can be calculated as 247 ???(?) = ?????(?) × ??? <sup>2</sup> (?) (6) 248 (as before, ? is the 2D reciprocal space coordinate and ?= |?|). Here, ??? is defined as the 249 ratio of the variance of the signal and the noise. The Fourier transform ℱ{ X ̃?} of the noise 250 whitened particle image X ̃? can then be calculated as <u>ℱ{</u> <u>X</u> <u>?}(?)</u> 251 ℱ{ X ̃?}(?) = √1 + ???(?) (7) ℱ{ X ̃?}(?) = √|ℱ{ X ?}|? <sup>2</sup> (?) <u>ℱ{</u> <u>X</u> <u>?}(?)</u> 252 where ℱ{ X ?} is the Fourier transform of the original image X ?, | ∙ | is the absolute value, and 253 |ℱ{ X ?}|2? is the radially averaged spectrum of the squared 2D Fourier transform amplitudes of 254 image X ?. To implement Eq. (7), a particle image is first divided by its amplitude spectrum, 255 which includes power from both signal and noise, and then multiplied by a term that amplifies 256 the image amplitudes according to the signal strength in the image. The reference projection A ? 257 can be matched by calculating <u>ℱ{</u> <u>A</u> <u>?}(?)</u> 258 ℱ{ A ̃?}(?) = √???(?) . (8) ℱ{ A ̃?}(?) = √|ℱ{ A ?}|? <sup>2</sup> (?) <u>ℱ{</u> <u>A</u> <u>?}(?)</u> 259 Eq. (8) scales the variance of the signal in the reference to be proportional to the measured 260 signal-to-noise ratio in the noise-whitened images. The main term in the objective function ?(?) 261 maximized in FrealignX is therefore given by the cross-correlation function ̃ ̃ 262 ??(?) = ‖ℱ?1,?3{ A ̃?(?)}‖‖ℱ?1,?3{ X ̃?}‖ (9a) ??(?) = ??(ℱ?1,?3{ A ̃?(?)} ̃ ̃ ̃ ̃ ∗ℱ?1,?3{ X ̃?}) ̃ ̃ 263 where ? is a set of parameters describing the particle view, x,y position, magnification and 264 defocus, ??( ∙ ) is the real part of a complex number, ‖ ∙ ‖ is the Euclidean norm, i.e. the square 265 root of the sum of the squared pixel values, and ℱ?1,?3{ ∙ } <sup>∗</sup> is the conjugate complex value of the 266 Fourier transform ℱ?1,?3{ ∙ }. The subscripts ?1 and ?3 specify the low- and high-resolution 267 limits of the Fourier transforms included in the calculation of Eq. (9a), as specified by the user. 268 To reduce noise overfitting, the user has the option to specify also a resolution range in which the 269 absolute value of the cross terms in the numerator of Eq. (9a) are used (Grigorieff, 2000; Stewart 270 and Grigorieff, 2004), instead of the signed values (option “Signed CC Resolution Limit” under 271 “Expert Options” in the “Manual Refine” Action panel). In this case ̃ ̃ ∗ℱ?2,?3{ X ̃?})| ̃ ̃ ̃ ̃ 272 ??(?) = (9b) ‖ℱ?1,?3{ A ̃?(?)}‖‖ℱ?1,?3{ X ̃?}‖ ??(?) = ??(ℱ?1,?2{ A ̃?(?)} ̃ ̃ ̃ ∗ℱ?1,?2{ X ̃?})+|??(ℱ?2,?3{ A ̃?(?)} ̃ 273 where ?2 is specified by the “Signed CC Resolution Limit.” The objective function also includes 274 a term ?(?|Θ) to restrain alignment parameters (Chen et al., 2009; Lyumkis et al., 2013; 275 Sigworth, 2004), which currently only includes the x,y positions: <u>?</u> <sup>2</sup> (?−?̅) <sup>2</sup> (?−?̅) <sup>2</sup> 276 ?(?|Θ) = − ? <sup>(</sup> 2?? <sup>2</sup> + 2?? <sup>2</sup> <sup>)</sup> (10) ?(?|Θ) = − <u>?</u> <sup>2</sup> ? <sup>(</sup> (?−?̅) <sup>2</sup> + 2?? <sup>2</sup> (?−?̅) <sup>2</sup> 277 where ? is the standard deviation of the noise in the particle image and Θ represents a set of 278 model parameters including the average particle positions in a dataset ?̅ and ?̅, and the standard 279 deviations of the x,y positions from the average values, ?? and ??, and ? is the number of pixels 280 in the mask applied to the particle before alignment. The complete objective function is therefore 281 ?(?) = ??(?) + ?(?|Θ) . (11) 282 The maximized values determined in a refinement are converted to particle scores by 283 multiplication with 100. 284 CTF refinement FrealignX can refine the defocus assigned to each particle. Given typical 285 imaging conditions with current instrumentation (300 kV, direct electron detector), this may be 286 useful when particles have a size of about 400 kDa or larger. Depending on the quality of the 287 sample and images, these particles may generate sufficient signal to yield per-particle defocus 288 values that are more accurate than the average defocus values determined for whole micrographs 289 by CTFFIND4 (see above). Refinement is achieved by a simple one-dimensional grid search of a 290 defocus offset applied to both defocus values determined in the 2D CTF fit obtained by 291 CTFFIND4. FrealignX applies this offset to the starting values in a refinement, typically 292 determined by CTFFIND4, and evaluates the objective function, Eq. (11), for each offset. The 293 offset yielding the maximum is then used to assign refined defocus values. In a typical 294 refinement, the defocus offset is searched in steps of 50 Å, in a range of ± 500 Å. In the case of 295 β-galactosidase (see below), a single round of defocus refinement changed the defocus on 296 average by 60 Å; the RMS change was 80 Å. For this refinement, the resolution for the signed 297 cross terms equaled the overall refinement resolution limit (3.1 Å), i.e. no unsigned cross terms 298 were used. The refinement produced a marginal improvement of 0.05 Å in the Fourier Shell 299 Correlation (FSC) threshold of 0.143, suggesting that the defocus values determined by 300 CTFFIND4 were already close to optimal. In a different dataset of rotavirus double-layer 301 particles, a single round of defocus refinement changed the defocus on average by 160 Å; the 302 RMS change was 220 Å. In this case, the refinement increased the resolution from ~3.0 Å to 303 ~2.8 Å. 304 Masking FrealignX has a 3D masking function to help in the refinement of structures that 305 contain significant disordered regions, such as micelles in detergent-solubilized membrane 306 proteins. To apply a 3D mask, the user supplies a 3D volume that contains positive and negative 307 values. _cis_ TEM will binarize this volume by zeroing all voxels with values less than or equal to 308 zero, and setting all other voxels to 1, indicating the region of the volume that is inside the mask. 309 A soft cosine-shaped falloff of specified width (e.g. 10 Å) is then applied to soften the edge of 310 the masked region and avoid sharp edges when the mask is applied to a 3D reconstruction. The 311 region of the reconstruction outside the mask can be set to zero (simple multiplication of the 312 mask volume), or to a low-pass filtered version of the original density, optionally downweighted 313 by multiplication by a scaling factor set by the user. At the edge of the mask, the low-pass 314 filtered density is blended with the unfiltered density inside the mask to produce a smooth 315 transition. Figure 5 shows the result of masking the reconstruction of an ABC transporter 316 associated with antigen processing (TAP, (Oldham et al., 2016)). The mask was designed to 317 contain only density corresponding to protein and the outside density was low-pass filtered at 30 318 Å resolution and kept with a weight of 100% in the final masked reconstruction. The 319 combination of masking and low-pass filtering in this case keeps a low-pass filtered version of 320 the density outside the mask in the reconstruction, including the detergent micelle. Detergent 321 micelles can be a source of noise in the particle images because the density represents disordered 322 material. However, at low, 20 to 30 Å resolution, micelles generate features in the images that 323 can help in the alignment of the particles. In the case of TAP, this masking prevented noise 324 overfitting in the detergent micelle and helped obtain a reconstruction at 4 Å resolution (Oldham 325 et al., 2016). 326 3D reconstruction In Frealign, a 3D reconstruction V ? of class average ? and containing ? 327 images is calculated as (Lyumkis et al., 2013; Sindelar and Grigorieff, 2012) V ? = ℱ <sup>−1</sup> { ∑??=1???2 ? ??? ∑?=1 <u>2</u> <sup>̂</sup> ? ??? ?=1 <u>2</u> <sup>~~ℛ~~</sup> <sup>(??,???∙????∙ℱ{</sup> <sup>X</sup> <sup>̂?})</sup> <sup>̂</sup> 328 V ? = ℱ <sup>−1</sup> {∑??=1???2 <sup>~~ℛ~~</sup> ? <sup>(?</sup> <u>?</u> <sup>?,???∙???</sup> ?2 )+1⁄?????? ~~}~~ (12) <sup>̂</sup> ?? ?? 329 where ??? is the probability of particle ? belonging to class ?, ?? is the standard deviation of the 330 noise in particle image ?, ?? are its alignment parameters, ??? the score-based weights (Eq. (14), 331 see below), ???? the CTF of the particle image, ℛ(??,∙ ) the reconstruction operator merging 332 data into a 3D volume according to alignment parameters ??, ????? the radially averaged 333 particle SSNR derived from the FSC between half-maps (Sindelar and Grigorieff, 2012), X ̂? 334 noise-whitened image ?, and ℱ <sup>−1</sup> { ∙ } the inverse Fourier transform. For the calculation of the 3D 335 reconstructions, as well as 3D classification (see below) the particle images are not whitened 336 according to Eq. (7). Instead, they are whitened using the radially- and particle-averaged power 337 spectrum of the background around the particles: <u>ℱ{</u> <u>X</u> <u>?}(?)</u> 338 ℱ{ X ̂?}(?) = (13) ℱ{ X ̂?}(?) = √|ℱ{?( X ?)}|? <sup>2</sup> (?) <u>ℱ{</u> <u>X</u> <u>?}(?)</u> 339 where ?( X ?) is a masked version of image X ? with the area inside a circular mask centered on the 340 particle replaced with the average values at the edge of the mask, and scaled variance to produce 341 an average pixel variance of 1 in the whitened image X ̂?. Using the procedure in Eq. (13) has the 342 advantage that whitening does not depend on the knowledge of the SSNR of the data, and 343 reconstructions can therefore be calculated even when the SSNR is not known. 344 Score-based weighting In previous versions of Frealign, resolution-dependent weighting was 345 applied to the particle images during reconstruction (the Frealign parameter was called “PBC”, 346 (Grigorieff, 2007)). The weighting function took the form of a B-factor dependent exponential 347 that attenuates the image data at higher resolution. FrealignX still uses B-factor weighting but the 348 weighting function is now derived from the particle scores (see above) as 349 ?(?????, g ) = ? <sup>−???</sup> 4 <sup>~~(~~</sup> <sup>?????−?????̅̅̅̅̅̅̅̅)?2</sup> . (14) 350 ??? converts the difference between a particle score and ?????̅̅̅̅̅̅̅, the score average, into a B 351 factor. Setting ??? to zero will turn off score-based particle weighting. Scores typically vary by 352 about 10, and values for ??? that produce reasonable discrimination between high-scoring and 353 low-scoring particles are between 2 and 10 Å <sup>2</sup>, resulting in B-factor differences between particles 354 of 20 to 100 Å <sup>2</sup> . 355 3D Classification FrealignX uses a maximum-likelihood approach for 3D classification 356 (Lyumkis et al., 2013). Assuming that all images were noise-whitened according to Eq. (13), 357 which scales the variance of each image such that the average standard deviation of the noise in a 358 pixel is 1, the probability density function (PDF) of observing image X ?, given alignment 359 parameters ?? and reconstruction V ?, is calculated as (Lyumkis et al., 2013) ?̃ <u>1</u> 2? <sup>)</sup> 2 ̂ <u>1</u> exp [− <u>1</u> ‖ X ̂?−????∙℘( V ?,???)‖? 360 Γ( X ?|???, V ?) = (2? <sup>)</sup> exp [− 2 ] ?(???|Θ?) . (15) Γ( X ?|???, V ?) = ( ‖ X ̂?−????∙℘( V ?,???)‖? 361 As before, ??? are the alignment parameters (usually just Euler angles and x,y shifts) determined 362 for image ? with respect to class average ?, ℘ is the projection operator producing an aligned 2D 363 projection of reconstruction V ? according to parameters ???, ‖ X ̂? −???? ∙℘( V ?, ???)‖2?̃ is the 364 sum of the squared pixel value differences between whitened image X ̂? and the reference 365 projection inside a circular mask defining the area of the particle with user-defined diameter, ?̃ 366 is the number of pixels inside this mask, and ?(???|Θ?) is a hierarchical prior describing the 367 probability of observing alignment parameters ??? given model parameters Θ? (see Eq. (10)). 368 Eq. (15) does not include marginalization over alignment parameters. Marginalization could be 369 added to improve classification when particle alignments suffer from significant errors. 370 However, this is currently not implemented in _cis_ TEM. Given the joint probability, Eq. (15), 371 determined in a refinement, the probability ??? of particle ? belonging to class ? can be updated 372 as (Lyumkis et al., 2013) <u>Γ(</u> <u>X</u> <u>?|Θ??,</u> <u>V</u> <u>?)??</u> 373 ??? = ? (16) ∑?=1 Γ( X ?|Θ??, V ?)?? 374 where the summation in the denominator is taken over all classes and the average probabilities 375 ?? for a particle to belong to class ? are given by the average values of ??? determined in a prior 376 iteration, calculated for the entire dataset of ? particles: 377 ?? = <u>1</u> ??=1 ??? . (17) ? <sup>∑</sup> ?? = <u>1</u> 378 An example of 3D classification is shown in Figure 6 for F1FO-ATPase, revealing different 379 conformational states of the γ subunit (Zhou et al., 2015). 380 Focused classification 3D classification can be improved by focusing on conformationally- or 381 compositionally-variable regions of the map. To achieve this, a mask is applied to the particle 382 images and reference projections, the area of which is defined as the projection of a sphere with 383 user-specified center (within the 3D reconstruction) and radius. This 2D mask is therefore 384 defined independently for each particle, as a function of its orientation. When using focused 385 classification, ?̃ in Eq. (15) is adjusted to the number of pixels inside the projected mask and the 386 sum of the squared pixel value differences in Eq. (15) is limited to the area of the 2D mask. By 387 applying the same mask to image and reference, only variability inside the masked region is used 388 for 3D classification. Other regions of the map are ignored, leading to a “focusing” on the region 389 of interest. The focused mask also excludes noise contained in the particle images outside the 390 mask and therefore improves classification results that often depend on detecting small 391 differences between particles and references. A typical application of a focused mask is in the 392 classification of ribosome complexes that may exhibit localized conformational and/or 393 compositional variability, for example the variable conformations of an IRES (Abeyrathne et al., 394 2016) or different states of tRNA accommodation (Loveland et al., 2017). 395 Likelihood-based blurring In some cases, the convergence radius of refinement can be 396 improved by blurring the reconstruction according to a likelihood function. This procedure is 397 similar to the maximization step in a maximum likelihood approach (Scheres, 2012). The 398 likelihood-blurred reconstruction is given by ∑??=1 <u>1</u> ∑??=1???2 ?? = ??=1?12? <sup>∫</sup> ???? Γ( X ?|??, V ??−1)ℛ(??,??∙????∙ X ?)????? ?? <u>2</u> <sup>∫</sup> ???? Γ( X ?|??, V ? 399 V ?? = ?? ∑??=1???2 <sup>ℛ(??,??∙???</sup> ?2 )+1⁄?????? (18) V ?? ?? 400 where, in the case of FrealignX, ???? only includes the x,y particle positions and in-plane 401 rotation angle ?, which are a subset of the alignment parameters ??, and V ??−1 is the 402 reconstruction from an earlier refinement iteration. As before, Γ( X ?|??, V ??−1) is the probability 403 of observing image ?, given alignment parameters ?? and reconstruction ???−1. Integration over 404 these three parameters can be efficiently implemented and, therefore, does not produce a 405 significant additional computational burden. 406 Resolution assessment The resolution of reconstructions generated by FrealignX is assessed 407 using the FSC criterion (Harauz and van Heel, 1986) using the 0.143 threshold (Rosenthal and 408 Henderson, 2003). FSC curves in _cis_ TEM are calculated using two reconstructions (“half-maps”) 409 calculated either from the even-numbered and odd-numbered particles, or by dividing the dataset 410 into 100 equal subsets and using the even- and odd-numbered subsets to calculate the two 411 reconstructions (in the _cis_ TEM GUI, the latter is always used). The latter method has the 412 advantage that accidental duplication of particles in a stack is less likely to affect the FSC 413 calculation. All particles are refined against a single reference and, therefore, the calculated FSC 414 values may be biased towards higher values (Grigorieff, 2000; Stewart and Grigorieff, 2004). 415 This bias extends slightly beyond the resolution limit imposed during refinement, by 416 approximately 2⁄?????, where ????? is the mask radius used to mask the reconstructions (see 417 above). During auto-refinement (see below), the resolution limit imposed during refinement is 418 carefully adjusted to stay well below the estimated resolution of the reconstruction and the 419 resolution estimate is therefore unbiased (Scheres and Chen, 2012). However, users have full 420 control over all parameters during manual refinement and will have to make sure that they do not 421 bias the resolution estimate by choosing a resolution limit that is close to, or higher than, the 422 estimated resolution of the final reconstruction. Calculated FSC curves are smoothed using a 423 Savitzky–Golay cubic polynomial that reduces the noise often affecting FSC curves at the high 424 resolution end. 425 The FSC calculated between two density maps is dependent on the amount of solvent included 426 inside the mask applied to the maps. A larger mask that includes more solvent background will 427 yield lower FSC values than a tighter mask. To obtain an accurate resolution estimate in the 428 region of the particle density, one possibility is to apply a tight mask that closely follows the 429 boundary of the particle. This approach bears the risk of generating artifacts because the particle 430 boundary is not always well defined, especially when the particle includes disordered domains 431 that generate weak density in the reconstruction. The approach in Frealign avoids tight masking 432 and instead calculates an FSC curve using generously masked density maps, corrected for the 433 solvent content inside the mask (Sindelar and Grigorieff, 2012). The corrected FSC curve is 434 referred to as ????_??? and is calculated from the uncorrected ???????? as (Oldham et al., 435 2016) <u>?????????</u> 436 ????_???ℎ???−???? = 1+(?−1)???????? <sup>~~,~~</sup> (19) 437 where ? is the ratio of mask volume to estimated particle volume. The particle volume can be estimated from its molecular mass ?? as <u>Å</u> <sup>3</sup> <u>Å</u> <sup>3</sup> 438 estimated from its molecular mass ?? as 0.81Da <sup>?? (Matthews, 1968). FSC curves obtained with</sup> 439 the generous masking and subsequent solvent correction yield resolution estimates that are very 440 close to those obtained with tight masking (Fig. 7C). Eq. (19) assumes that both maps have 441 similar SSNR values, as is normally the case for the two reconstructions calculated from two 442 halves of the dataset, indicated by the subscript ℎ???−????. If one of the maps does not 443 contain noise from solvent background, for example when calculating the FSC between a 444 reconstruction and a map derived from an atomic model, the solvent-corrected FSC is given as <u>?????????</u> 445 ????_????????−??? = √1+(?−1)????????2 . (20) ????_????????−??? = √ <u>?????????2</u> 446 Speed optimization FrealignX has been optimized for execution on multiple CPU cores. Apart 447 from using optimized library functions for FFT calculation and vector multiplication (Intel Math 448 Kernel Library), the processing speed is also increased by on-the-fly cropping in real and 449 reciprocal space of particle images and 3D reference maps. Real-space cropping reduces the 450 interpolation accuracy in reciprocal space and is therefore limited to global parameter searches 451 that do not require the highest accuracy in the calculation of search projections. Reciprocal-space 452 cropping is used whenever a resolution limit is specified by the user or in an automated 453 refinement (ab-initio 3D reconstruction and auto-refinement). For the calculation of in-plane 454 rotated references, reciprocal-space padding is used to increase the image size four-fold, 455 allowing fast nearest-neighbor resampling in real space with sufficient accuracy to produce 456 rotated images with high fidelity. 457 458 _Ab-initio 3D reconstruction_ 459 Ab-initio reconstruction offers a convenient way to proceed from single particle images to a 3D 460 structure when a suitable reference is not available to initialize 3D reconstruction and refinement. 461 Different ab-initio methods have been described (Hohn et al., 2007; Punjani et al., 2017; Reboul 462 et al., 2018) and _cis_ TEM’s implementation follows a strategy published originally by (Grigorieff, 463 2016). It is based on the premise that iterative refinement of a reconstruction initialized with 464 random angular parameters is likely to converge on the correct structure if overfitting is avoided 465 and the refinement proceeds in small steps to reduce the chance of premature convergence onto 466 an incorrect structure. The procedure is implemented as part of _cis_ TEM’s GUI and uses 467 FrealignX to perform the refinements and reconstructions. 468 After initialization with random angles, _cis_ TEM performs a user-specified number of global 469 alignment parameter searches, recalculating the reconstruction after each search and applying an 470 automatic masking procedure to it before the next global search. Similar to 2D classification (see 471 above), only a randomly selected subset of the data is used in each iteration and the resolution 472 limit applied during the search is increased with every iteration. The number of iterations ? 473 defaults to 40, the starting and final resolution limits ?????? and ??????ℎ default to 20 Å and 8 Å, 474 respectively, and the starting and final percentage of included particles in the reconstruction, 475 ?????? and ??????ℎ default to 2500??⁄ and 10,000??⁄, respectively (results larger than 1 are 476 reset to 1), with ? the number of 3D classes to be calculated as specified by the user, and ? the 477 number of particles in the dataset. If symmetry is applied, ? is replaced by ????? where ???? is 478 the number of asymmetric units present in one particle. The resolution limit is then updated in 479 each iteration ? as in Eq. (2), and the percentage is updated as 480 ?= ?????? + ?(??????ℎ −??????)⁄(?−1), (21) 481 again resetting results larger than 1 to 1. _cis_ TEM actually performs a global search for a 482 percentage 3? of the particle stack, i.e. three times as many particles as are included in the 483 reconstructions for each iteration. The particles included in the reconstructions are then chosen to 484 be those with the highest scores as calculated by FrealignX. 485 The global alignment parameters are performed using the “general” FrealignX procedure with 486 the following changes. Firstly, the ????? is not directly estimated from the FSC calculated at 487 each round. Instead, for the first 3 iterations, a default ????? is calculated based on the 488 molecular weight. From the 4 <sup>th</sup> iteration onwards, the ????? is calculated from the FSC, 489 however if the calculated ????? is higher than the default ?????, the default ????? is taken 490 instead. This is done in order to avoid some of the overfitting that will occur during refinement. 491 Secondly, during a normal global search the top ℎ (where ℎ defaults to 20) results of the grid 492 search are locally refined, and the best locally refined result is taken. In the ab-initio procedure, 493 however, the result of the global search for a given particle image is taken randomly from all 494 results that have a score which lies in the top 15% of the difference between the worst score and 495 the best score. 496 During the reconstruction steps, the calculated ? for each particle is reset to 1 prior to 3D 497 reconstruction and score weighting is disabled. This is done because the ? and score values are 498 not meaningful until an approximately correct solution is obtained. 499 The reconstructions are automatically masked before each new refinement iteration to suppress 500 noise features that could otherwise be amplified in subsequent iterations. The same masking 501 procedure is also applied during auto-refinement (see below). It starts by calculating the density 502 average ?̅ of the reconstruction and resetting all voxel values below ?̅ to ?̅. This thresholded 503 reconstruction is then low-pass filtered at 50 Å resolution and turned into a binary mask by 504 setting densities equal or below a given threshold ? to zero and all others to 1. The threshold is 505 calculated as 506 ?= ?̅???????? + 0.03(?̅max _500 −?̅????????) (22) 507 where ?̅???????? is the density average of the low-pass filtered map and ?̅max _500 is the average of 508 the 500 highest values in the filtered map. The largest contiguous volume in this binarized map is 509 then identified and used as a mask for the original thresholded reconstruction, such that all 510 voxels outside of this mask will be set to ?̅. Finally, a spherical mask, centered in the 511 reconstruction box, is applied by resetting all densities outside the mask to zero. 512 The user has the option to repeat the ab-initio procedure multiple times using the result from the 513 previous run as the starting map in each new run, to increase the convergence radius if necessary. 514 In the case of symmetric particles, the default behavior is to perform the first 2/3 <sup>rds</sup> of the 515 iterations without applying symmetry. The non-symmetrized map is then aligned to the expected 516 symmetry axes and the final 1/3 <sup>rd</sup> of the iterations are carried out with the symmetry applied. 517 This default behavior can be changed by the user such that symmetry is always applied, or is 518 never applied. 519 Alignment of the model to the symmetry axes is achieved using the following process. A brute 520 force grid search over rotations around the x, y and z axes is set up. At each position on the grid 521 the 3D map is rotated using the current x, y and z parameters, and then its projection along Euler 522 angle (0, 0,0) is calculated. All of the symmetry-related projections are then also calculated, and 523 for each one a cross-correlation map is calculated using the original projection as a reference, 524 and the peak within this map is found. The sum of all peaks from all symmetry related directions 525 is taken and the x,y,z rotation that most closely aligns the original 3D map along the symmetry 526 axes should provide the highest peak sum. To improve robustness, this process is repeated for 527 two additional angles (-45, -45, -45 and 15, 70, -15) that were chosen with the aim of including 528 different-looking areas when the map to be aligned is unusual in some way. The x,y,z rotation 529 that results in the largest sum of all peaks, over all three angles, is taken as the final rotation 530 result. Shifts for this rotation are then calculated based on the found 2D x,y shifts between the 531 initial and symmetry related projections, with the z shift being set to 0 for C symmetries. The 532 symmetry alignment is also included as a command-line program, which can be used to align a 533 volume to the symmetry axis when the ab-initio is carried out in C1 only, or when using a 534 reference obtained by some other means. 535 536 _Automatic refinement_ 537 Like ab-initio 3D reconstruction, auto-refinement makes use of randomly selected subsets of the 538 data and of an increasing resolution limit as refinement proceeds. However, unlike the ab-initio 539 procedure, the percentage of particles ?? and the resolution limit ?? used in iteration ? depend on 540 the resolution of the reconstructions estimated on iteration ?−1. When the estimated resolution 541 improved in the previous cycle, 542 ?? = max[??, ??−1] (23) 543 with 544 ?? = 8000?? <sup>75</sup> ⁄ <sup>??−1</sup> 2 ⁄? (24) 545 where ? is the number of 3D classes to be calculated and ? the number of particles in the 546 dataset. As before, if the particle has symmetry, ? is replaced by ????? where ???? is the 547 number of asymmetric units present in one particle. If the calculated ?? exceeds 1, it is reset to 1. 548 The resolution limit is estimated as 549 ?= ???0.5 −2⁄????? (25) 550 where ???0.5 is the point at which the FSC, unadjusted for the solvent within the mask (see 551 above) crosses the 0.5 threshold and ????? is the user-specified diameter of the spherical mask 552 applied to the 3D reference at the beginning of each iteration, and to the half-maps used to 553 calculate the FSC. The term 2⁄????? accounts for correlations between the two half-maps due 554 to the masking (see above). When the resolution did not improve in the previous iteration, 555 ?? = 1.5??−1 (26) 556 (reset to 1 if resulting in a value larger than 1). At least five refinement iterations are run and 557 refinement stops when ?? reaches 1 (all particles are included) and there was no improvement in 558 the estimated resolution for the last three iterations. 559 If multiple classes are refined, the resolution limit in Eq. (25) is set independently for each class, 560 however the highest resolution used for classification is fixed at 8 Å. At least nine iterations are 561 run and refinement stops when ?? reaches 1, the average change in the particle occupancy in the 562 last cycle was 1% or less, and there was no improvement in the estimated resolution for the last 563 three iterations. 564 In a similar manner to the ab-initio procedure, ? values for each particle are set to 1 and score 565 weighting is turned off. This is done until the refinement resolution is better than 7 Å, at which 566 point it is assumed the model is of a reasonable quality. 567 568 _Map sharpening_ 569 Most single-particle reconstructions require some degree of sharpening that is usually achieved 570 by applying a negative B-factor to the map. _cis_ TEM includes a map sharpening tool that allows 571 the application of an arbitrary B-factor. Additionally, maps can be sharpened by whitening the 572 power spectrum of the reconstruction beyond a user-specified resolution (the default is 8 Å). The 573 whitening amplifies terms at higher resolution similar to a negative B-factor but avoids the over 574 amplification at the high-resolution end of the spectrum that sometimes occurs with the B-factor 575 method due to its exponential behavior. Whitening is applied after masking of the map, either 576 with a hollow spherical mask of defined inner and outer radius, or with a user-defined mask 577 supplied as a separate 3D volume. The masking removes background noise and makes the 578 whitening of the particle density more accurate. Both methods can be combined in _cis_ TEM, 579 together with a resolution limit imposed on the final reconstruction. The whitened and B-factor 580 sharpened map can optionally be filtered with a figure-of-merit curve calculated using the FSC 581 determined for the reconstruction (Rosenthal and Henderson, 2003; Sindelar and Grigorieff, 582 2012). 583 584 _GUI design and workflow_ 585 _cis_ TEM’s GUI required extensive development because it is an integral part of the processing 586 pipeline. GUIs have become more commonplace in cryo-EM software tools to make them more 587 accessible to users (Conesa Mingo et al., 2018; Desfosses et al., 2014; Moriya et al., 2017; 588 Punjani et al., 2017; Scheres, 2012; Tang et al., 2007). Many of the interfaces are designed as so 589 called wrappers of command-line driven tools, i.e. they take user input and translate it into a 590 command line that launches the tool. Feedback to the user takes place by checking output files, 591 which are also the main repository of processing results, such as movie frame alignments, image 592 defocus measurements and particle alignment parameters. As processing strategies become more 593 complex and the number of users new to cryo-EM grows, the demands on the GUI increase in 594 the quest for obtaining the best possible results. Useful GUI functions include guided user input 595 (so-called wizards) that adjust to specific situations, graphical presentation of relevant results, 596 user interaction with running processes to allow early intervention and make adjustments, tools 597 to manipulate data (e.g. masking), implementation of higher-level procedures that combine more 598 primitive processing steps to achieve specific goals, and a global searchable database that keeps 599 track of all processing steps and result. While some of these functions can be or have been 600 implemented in wrapper GUIs, the lack of control of these GUIs over the data and processes 601 makes a reliable implementation more difficult. For example, keeping track of results from 602 multiple processing steps, some of them perhaps repeated with different parameters or run many 603 times during an iterative refinement, can become challenging if each step produces a separate 604 results file. Communicating with running processes via files can be slow and is sometimes 605 unreliable due to file system caching. Communication via files may complicate the 606 implementation of higher-level procedures, which rely on the parsing of results from the more 607 primitive processing steps. 608 The _cis_ TEM GUI is more than a wrapper as it implements some of the new algorithms in the 609 processing pipeline directly, adjusting the input of running jobs as the refinement proceeds. It 610 enables more complex data processing strategies by tracking all results in a single searchable 611 database. All processing steps are run and controlled by the GUI, which communicates with 612 master and slave processes through TCP/IP. _cis_ TEM uses an SQL database, similar to Appion 613 (Lander et al., 2009), to store all results (except image files), offers input functions that guide the 614 user or set appropriate defaults, and implements more complex procedures to automate 615 processing where possible. _cis_ TEM’s design is flexible to allow execution in many different 616 environments, including single workstations, multiple networked workstations and large 617 computer clusters. 618 User input and the display of results is organized into different panels that make up _cis_ TEM’s 619 GUI, each panel dedicated to specific processing steps (for examples, see Figure 1, 3, 4). This 620 design guides users through a standard workflow that most single particle projects follow: movie 621 alignment, CTF determination, particle picking, 2D classification, 3D reconstruction, refinement 622 and classification, and sharpening of the final reconstructions. Three types of panels exist, 623 dealing with Assets, Actions and Results. Assets are mostly data that can be used in processing 624 steps called Actions. They include Movies, Images, Particle Positions and Volumes. One type of 625 Asset, a Refinement Package, defines the data and parameters necessary to carry out refinement 626 of a 3D structure (or a set of structures if 3D classification is done), it contains a particle stack, as 627 well as information about the sample (e.g. particle size and molecular weight) along with 628 parameters for each particle (e.g. orientations and defocus values). Actions comprise the above 629 mentioned workflow steps, with additional options for ab-initio 3D reconstruction, as well as 630 automatic and manual 3D refinement to enable users to obtain the best possible results from their 631 data. The results of most of these Actions are stored in the database and can be viewed in the 632 related Results panels, which display relevant data necessary to evaluate the success of each 633 processing step. The option to sort and select results by a number of different metrics is available 634 in the movie alignment and CTF estimation Results panels. For example images can be sorted / 635 selected based on the CTF fit resolution (Rohou and Grigorieff, 2015). Movie alignment, 3D 636 refinement and reconstruction also produce new Image and Volume Assets, respectively. 637 Importing or generating new Assets is accomplished by wizards that solicit the necessary user 638 input and perform checks were possible to avoid nonsensical input. In the more complex case of 639 creating a new Refinement Package Asset, the wizard allows the specification of input data, for 640 example based on particle picking results or the selection of 2D and 3D classes. Once an Action 641 has been launched, results are displayed as soon as they become available, together with an 642 overall progress bar, giving users an estimate of how long a processing step will take and of 643 whether the results are as expected. If desired, an Action can be aborted and restarted with a 644 different set of parameters, or the Action can be run again after regular termination to test 645 different parameters. In the latter case, all prior results remain accessible and users can specify 646 those to be used for the next step in the workflow. This provides users with the flexibility to pick 647 and choose the best results in cases where different parts of a dataset require different settings to 648 yield optimal results. 649 650 _Parallelization_ 651 _cis_ TEM uses a home-grown scheme to accelerate processing in parallel environments. Image 652 processing of single-particle data is an embarrassingly parallel problem, i.e. the parallelization of 653 most tasks can be achieved simply by dividing the data to be processed into smaller chunks that 654 are each processed by a separate program thread, without the need for inter-process 655 communication. Only certain steps require merging of data, such as the calculation of a 3D 656 reconstruction from the entire dataset. _cis_ TEM parallelizes processing steps by running multiple 657 instances of the same program, each dealing with a subset of the data, then directly 658 communicating with the launched processes over TCP/IP sockets. This enables the _cis_ TEM GUI 659 to distribute jobs and receive results in real time. Communication is directed through a 660 “manager” process, which enables jobs to be run on a cluster, while the GUI itself can run on a 661 local workstation. 662 How each copy of the program is run is specified by the user by setting up a “Run Profile”. This 663 profile is a user defined command, or script that will be run to launch the job, and is designed to 664 be flexible to enable the user to set up parallelization in many different environments. For 665 example, users can design profiles to run on multiple machines via SSH, or to submit to a cluster 666 (e.g. using qsub) etc., or even merge the two in a single profile. One disadvantage of this system 667 is that it may be difficult to create profiles for clusters that require many jobs to be submitted 668 using one command. 669 Another advantage of using a home-grown scheme over existing schemes (e.g. MPI) occurs 670 when jobs are run on a multi-node computing cluster. In this case, jobs will complete even if the 671 full number of requested processors is not available. For example, if a user requests 300 CPUs 672 for a processing step but only 100 are available, _cis_ TEM launches 300 jobs of which 200 will 673 remain in the job scheduler’s queue. Data processing starts immediately with the 100 jobs that 674 are allowed to run and will complete even if the remaining jobs never run. In such a scenario, an 675 MPI-based job could only run when 300 CPUs become available, potentially delaying execution. 676 In the few cases were a step requires merging of an entire dataset, for example in a 3D 677 reconstruction, parallelization is achieved by calculating multiple intermediate 3D 678 reconstructions for subsets of the data, dumping the intermediate reconstructions to disk and 679 merging them after all reconstruction jobs have finished. It can therefore help to designate a fast 680 disk as a scratch disk to allow rapid dumping and reading of the relatively large files (200 MB – 681 5 GB). 682 683 _Benchmarking with_ β _-galactosidase_ 684 A high-resolution dataset of β-galactosidase (Bartesaghi et al., 2015) was used to benchmark 685 Relion 2 (Kimanius et al., 2016) and is also used here to illustrate the workflow of _cis_ TEM and 686 assess the time for the completion of different processing steps. The entire dataset was 687 downloaded from the EMPIAR database (Iudin et al., 2016) and consists of 1539 movies 688 containing 38 frames, recorded at super-resolution on a K2 Summit camera (Gatan, Inc., 689 Pleasanton, CA) and stored locally as tif files using LZW compression (the conversion to tiff and 690 compression was performed by mrc2tif (Mastronarde and Held, 2017)). The pixel size of the 691 super-resolution frames was 0.3185 Å, and images were binned to a pixel size of 0.75 Å after 692 movie processing. For 2D classification and ab-initio 3D reconstruction, particles were boxed 693 using 384 x 384 pixel boxes. For auto- and manual refinement, the particles were re-boxed into 694 648 x 648 pixel boxes (boxing is part of the creation of Refinement Packages, see above). For all 695 processing steps, a Dell Precision T7910 workstation containing two E5-2699 v4 Xeon 696 processors with a total of 44 cores was used. Processing parameters were left on default settings 697 except for CTF determination, which was performed at 3.5 Å resolution using the movie 698 averages instead of the frames, and particle picking, which used optimized parameters based on 699 previewing a few selected images (Figure 3). The resolution limit during refinement (auto, 700 manual and CTF) never exceeded 3.1 Å. The data were stored on a local SSD Raid 0 disk for fast 701 access. Table 1 lists the timings of the different processing steps using all 44 CPU cores. Results 702 obtained at different points in the workflow are shown in Figure 7. 703 Processing step Details Time (hours) Movie processing 1539 movies, 38 frames, super-resolution 1.1 CTF determination Using aligned movie average as input 0.1 Particle picking 131,298 particles 0.1 2D classification 50 classes, 28 selected with 119,523 particles 0.8 Ab initio 3D reconstruction 40 iterations 0.8 Auto refinement 8 iterations, final resolution 2.2 Å 1.4 Manual refinement 1 iteration (incl. defocus), final resolution 2.2 Å 0.4 Total 4.7 704 705 Table 1 Benchmarking of _cis_ TEM using a high-resolution dataset of β-galactosidase (Bartesaghi 706 et al., 2015). 707 708 Discussion 709 The implementation of a complete image processing workflow in _cis_ TEM offers users a uniform 710 experience and guarantees smooth transitions between processing steps. It also helps developers 711 maintain the software as all the tools and algorithms are developed in-house. 712 The main focus of _cis_ TEM is on the processing of single-particle cryo-EM data and high 713 resolution 3D reconstruction. Future releases of _cis_ TEM may include on-the-fly processing of 714 data as it is collected, particle-based movie alignment, support for helical particles, improved 3D 715 masking tools, more reliable resolution and quality indicators, as well as miscellaneous tools 716 such as the determination of the detective quantum efficiency of electron detectors. 717 Since _cis_ TEM does not rely on third-party libraries, such as Python, MPI or CUDA, that usually 718 have to be installed and compiled separately on the target system, ready-to-run binaries can be 719 made available for download that are optimized for different architectures. Using the wxWidgets 720 library also means that _cis_ TEM can be compiled for different operating systems, including 721 Linux, Windows and OSX. Using a configure script, different options for the fast Fourier 722 transforms (FFTs) can be specified, including the FFTW (http://www.fftw.org) and Intel MKL 723 (http://software.intel.com/en-us/mkl) libraries. The downloadable binaries are statically linked 724 against the MKL library as this exhibits superior speeds compared to the FFTW library on Intel 725 based CPUs. 726 While the lack of support for GPUs simplifies the installation and execution of _cis_ TEM, it can 727 also be a limitation on workstations that are optimized for GPU-accelerated code. These 728 workstations often do not have many CPU cores and, therefore, _cis_ TEM will run significantly 729 more slowly than code that can take advantage of the GPU hardware. Users who would like to 730 run both CPU and GPU-optimized software may therefore have to invest in both types of 731 hardware. 732 733 Materials and Methods 734 _Development of cis_ TEM 735 The entire _cis_ TEM image processing package was written in C++ using the wxWidgets toolkit 736 (http://wxwidgets.org) to implement the GUI, as well as the libtiff library (http://www.libtiff.org) 737 to support the tiff image format, the SQLite library (https://sqlite.org) to implement the SQL 738 database, and Intel’s MKL library (http://software.intel.com/en-us/mkl) for the calculation of 739 Fourier transforms and vector products. Optionally, _cis_ TEM can also be linked against the 740 FFTW library (http://www.fftw.org) to replace the MKL library. The code was written and 741 edited using Eclipse (http://www.eclipse.org) and GitHub (http://github.com) was used for 742 version control. 743 744 _Image and data formats_ 745 _cis_ TEM stores all image data using the MRC format (Crowther et al., 1996). Additionally, 746 particle parameters can be imported from, and exported to Frealign (Grigorieff, 2016) and Relion 747 (Scheres, 2012). 748 749 Acknowledgements 750 The authors are grateful for feedback from early testers of _cis_ TEM, including Ruben Diaz 751 Avalos, Sarah Loerch, Priyanka Abeyrathne, Peter Rickgauer, Ben Himes, Andrei Korostelev, 752 Anna Loveland, Gabriel Demo, Jue Chen, Dmitry Lyumkis, Hiro Furukawa, Wei Lu and Juan 753 Du. 754 755 Competing Interests 756 The authors declare no competing interest. 757 758 759 760 761 Figure 1 Movie alignment panel of the _cis_ TEM GUI. All Action panels provide background 762 information on the operation they control, as well as a section with detailed explanations of all 763 user-accessible parameters. All Action panels also have an Expert Options section that exposes 764 additional parameters. 765 766 767 768 Figure 2 Thon ring pattern calculated for micrograph “0000” of the high-resolution dataset of β 769 galactosidase (Bartesaghi et al., 2015) used to benchmark _cis_ TEM. The left pattern was 770 calculated from the average of aligned frames while the right pattern was calculated using the 771 original movie with 3-frame sub-averages. The pattern calculated using the movie shows 772 significantly stronger rings compared to the other pattern. 773 774 775 776 Figure 3 Particle picking panel of the _cis_ TEM GUI. The panel shows the preview mode, which 777 allows interactive tuning of the picking parameters for optimal picking. The red circles 778 overlaying the image of the sample indicate candidate particles. The picking algorithm avoids 779 areas of high variance, such as the ice contamination visible in the image. 780 781 782 783 Figure 4 Manual refinement panel with Expert Options exposed. Most of the parameters needed 784 to run FrealignX can be accessed on this panel. The panel also allows application of a 3D mask, 785 which can be imported as a Volume Asset. 786 787 788 Figure 5 3D masking with low-pass filtering outside the mask. A) Orthogonal sections through 789 the 3D reconstruction of the transporter associated with antigen processing (TAP), an ABC 790 transporter (Oldham et al., 2016). Density corresponding to the protein, as well as the detergent 791 micelle (n-Dodecyl b-D-maltoside; highlighted with arrows), is visible. B) Orthogonal sections 792 through a 3D mask corresponding to the sections shown in A). The sharp edges of this mask are 793 smoothed before the mask is applied to the map. C) Orthogonal sections through the masked 3D 794 reconstruction. The regions outside the mask are low-pass filtered at 30 Å resolution to remove 795 high-resolution noise from the disordered detergent micelle, but keeping its low-resolution signal 796 to help particle alignment. 797 798 799 Figure 6 3D classification of a dataset of F1FO-ATPase, revealing different conformational states 800 (Zhou et al., 2015). Sections through the F1 domain showing the γ subunit (arrows) in three 801 different states related by 120° rotations are shown on the left. A surface rendering of the map 802 corresponding to State 1a is shown on the right. Scale bars, 25 Å. 803 804 805 806 Figure 7 Processing results of the β-galactosidase dataset (Bartesaghi et al., 2015) used to 807 benchmark _cis_ TEM. A) Different stages of the ab-initio reconstruction procedure, starting from a 808 reconstruction from randomly assigned Euler angles. The process takes less than an hour to 809 complete on a high-end CPU-based workstation. B) High-resolution detail of the refined β 810 galactosidase reconstruction with an average resolution of 2.2 Å, showing sidechain details for 811 most amino acids. C) FSC plots for the refined β-galactosidase reconstruction. The black curve 812 was calculated using a tight mask applied to the half maps (Masked_FSC). An correction for 813 potential masking artifacts (Chen et al., 2013) did not lead to adjustments of this curve. The red 814 curved was calculated with a more generous spherical mask and adjusted for the solvent 815 background within that mask (Part_FSC, Eq. (19)). The resolution limit of 3.1 Å, which was not 816 exceeded during refinement, as well as the FSC = 0.143 threshold are indicated by lines. 817 References 818 Abeyrathne, P.D., Koh, C.S., Grant, T., Grigorieff, N., and Korostelev, A.A. (2016). Ensemble 819 cryo-EM uncovers inchworm-like translocation of a viral IRES through the ribosome. Elife _5_ . 820 Bartesaghi, A., Matthies, D., Banerjee, S., Merk, A., and Subramaniam, S. (2014). Structure of 821 beta-galactosidase at 3.2-A resolution obtained by cryo-electron microscopy. Proc Natl Acad Sci 822 U S A _111_, 11709-11714. 823 Bartesaghi, A., Merk, A., Banerjee, S., Matthies, D., Wu, X., Milne, J.L., and Subramaniam, S. 824 (2015). 2.2 A resolution cryo-EM structure of beta-galactosidase in complex with a cell 825 permeant inhibitor. Science _348_, 1147-1151. 826 Chen, J.Z., Settembre, E.C., Aoki, S.T., Zhang, X., Bellamy, A.R., Dormitzer, P.R., Harrison, 827 S.C., and Grigorieff, N. (2009). Molecular interactions in rotavirus assembly and uncoating seen 828 by high-resolution cryo-EM. Proc Natl Acad Sci U S A _106_, 10644-10648. 829 Chen, S., McMullan, G., Faruqi, A.R., Murshudov, G.N., Short, J.M., Scheres, S.H., and 830 Henderson, R. (2013). High-resolution noise substitution to measure overfitting and validate 831 resolution in 3D structure determination by single particle electron cryomicroscopy. 832 Ultramicroscopy _135_, 24-35. 833 Cheng, Y., Grigorieff, N., Penczek, P.A., and Walz, T. (2015). A primer to single-particle cryo 834 electron microscopy. Cell _161_, 438-449. 835 Conesa Mingo, P., Gutierrez, J., Quintana, A., de la Rosa Trevin, J.M., Zaldivar-Peraza, A., 836 Cuenca Alba, J., Kazemi, M., Vargas, J., Del Cano, L., Segura, J. _, et al._ (2018). Scipion web 837 tools: Easy to use cryo-EM image processing over the web. Protein Sci _27_, 269-275. 838 Crowther, R.A., Henderson, R., and Smith, J.M. (1996). MRC image processing programs. J 839 Struct Biol _116_, 9-16. 840 Desfosses, A., Ciuffa, R., Gutsche, I., and Sachse, C. (2014). SPRING - an image processing 841 package for single-particle based helical reconstruction from electron cryomicrographs. J Struct 842 Biol _185_, 15-26. 843 Frank, J., Radermacher, M., Penczek, P., Zhu, J., Li, Y., Ladjadj, M., and Leith, A. (1996). 844 SPIDER and WEB: processing and visualization of images in 3D electron microscopy and 845 related fields. J Struct Biol _116_, 190-199. 846 Grant, T., and Grigorieff, N. (2015a). Automatic estimation and correction of anisotropic 847 magnification distortion in electron microscopes. J Struct Biol _192_, 204-208. 848 Grant, T., and Grigorieff, N. (2015b). Measuring the optimal exposure for single particle cryo 849 EM using a 2.6 A reconstruction of rotavirus VP6. Elife _4_, e06980. 850 Grigorieff, N. (2000). Resolution measurement in structures derived from single particles. Acta 851 Crystallogr D Biol Crystallogr _56_, 1270-1277. 852 Grigorieff, N. (2007). FREALIGN: high-resolution refinement of single particle structures. J 853 Struct Biol _157_, 117-125. 854 Grigorieff, N. (2016). Frealign: An Exploratory Tool for Single-Particle Cryo-EM. Methods 855 Enzymol _579_, 191-226. 856 Harauz, G., and van Heel, M. (1986). Exact Filters for General Geometry 3-Dimensional 857 Reconstruction. Optik _73_, 146-156. 858 Henderson, R. (2013). Avoiding the pitfalls of single particle cryo-electron microscopy: Einstein 859 from noise. Proc Natl Acad Sci U S A _110_, 18037-18041. 860 Hohn, M., Tang, G., Goodyear, G., Baldwin, P.R., Huang, Z., Penczek, P.A., Yang, C., Glaeser, 861 R.M., Adams, P.D., and Ludtke, S.J. (2007). SPARX, a new environment for Cryo-EM image 862 processing. J Struct Biol _157_, 47-55. 863 Iudin, A., Korir, P.K., Salavert-Torres, J., Kleywegt, G.J., and Patwardhan, A. (2016). EMPIAR: 864 a public archive for raw electron microscopy image data. Nat Methods _13_, 387-388. 865 Kimanius, D., Forsberg, B.O., Scheres, S.H., and Lindahl, E. (2016). Accelerated cryo-EM 866 structure determination with parallelisation using GPUs in RELION-2. Elife _5_ . 867 Lander, G.C., Stagg, S.M., Voss, N.R., Cheng, A., Fellmann, D., Pulokas, J., Yoshioka, C., 868 Irving, C., Mulder, A., Lau, P.W. _, et al._ (2009). Appion: an integrated, database-driven pipeline 869 to facilitate EM image processing. J Struct Biol _166_, 95-102. 870 Loveland, A.B., Demo, G., Grigorieff, N., and Korostelev, A.A. (2017). Ensemble cryo-EM 871 elucidates the mechanism of translation fidelity. Nature _546_, 113-117. 872 Lyumkis, D., Brilot, A.F., Theobald, D.L., and Grigorieff, N. (2013). Likelihood-based 873 classification of cryo-EM images using FREALIGN. J Struct Biol _183_, 377-388. 874 Mastronarde, D.N., and Held, S.R. (2017). Automated tilt series alignment and tomographic 875 reconstruction in IMOD. J Struct Biol _197_, 102-113. 876 Matthews, B.W. (1968). Solvent content of protein crystals. J Mol Biol _33_, 491-497. 877 McDonough, R.N., and Whalen, A.D. (1995). Detection of Signals in Noise, 2nd edn (San 878 Diego: Academic Press). 879 McMullan, G., Faruqi, A.R., and Henderson, R. (2016). Direct Electron Detectors. Methods 880 Enzymol _579_, 1-17. 881 McMullan, G., Vinothkumar, K.R., and Henderson, R. (2015). Thon rings from amorphous ice 882 and implications of beam-induced Brownian motion in single particle electron cryo-microscopy. 883 Ultramicroscopy _158_, 26-32. 884 Mindell, J.A., and Grigorieff, N. (2003). Accurate determination of local defocus and specimen 885 tilt in electron microscopy. J Struct Biol _142_, 334-347. 886 Moriya, T., Saur, M., Stabrin, M., Merino, F., Voicu, H., Huang, Z., Penczek, P.A., Raunser, S., 887 and Gatsogiannis, C. (2017). High-resolution Single Particle Analysis from Electron Cryo 888 microscopy Images Using SPHIRE. J Vis Exp. 889 Oldham, M.L., Grigorieff, N., and Chen, J. (2016). Structure of the transporter associated with 890 antigen processing trapped by herpes simplex virus. Elife _5_ . 891 Penczek, P.A., Fang, J., Li, X., Cheng, Y., Loerke, J., and Spahn, C.M. (2014). CTER-rapid 892 estimation of CTF parameters with error assessment. Ultramicroscopy _140_, 9-19. 893 Punjani, A., Rubinstein, J.L., Fleet, D.J., and Brubaker, M.A. (2017). cryoSPARC: algorithms 894 for rapid unsupervised cryo-EM structure determination. Nat Methods _14_, 290-296. 895 Reboul, C.F., Eager, M., Elmlund, D., and Elmlund, H. (2018). Single-particle cryo-EM 896 Improved ab initio 3D reconstruction with SIMPLE/PRIME. Protein Sci _27_, 51-61. 897 Rohou, A., and Grigorieff, N. (2015). CTFFIND4: Fast and accurate defocus estimation from 898 electron micrographs. J Struct Biol _192_, 216-221. 899 Roseman, A.M. (2004). FindEM--a fast, efficient program for automatic selection of particles 900 from electron micrographs. J Struct Biol _145_, 91-99. 901 Rosenthal, P.B., and Henderson, R. (2003). Optimal determination of particle orientation, 902 absolute hand, and contrast loss in single-particle electron cryomicroscopy. J Mol Biol _333_, 721 903 745. 904 Scheres, S.H. (2012). RELION: implementation of a Bayesian approach to cryo-EM structure 905 determination. J Struct Biol _180_, 519-530. 906 Scheres, S.H. (2015). Semi-automated selection of cryo-EM particles in RELION-1.3. J Struct 907 Biol _189_, 114-122. 908 Scheres, S.H., and Chen, S. (2012). Prevention of overfitting in cryo-EM structure determination. 909 Nat Methods _9_, 853-854. 910 Scheres, S.H., Valle, M., Nunez, R., Sorzano, C.O., Marabini, R., Herman, G.T., and Carazo, 911 J.M. (2005). Maximum-likelihood multi-reference refinement for electron microscopy images. J 912 Mol Biol _348_, 139-149. 913 Sheth, L.K., Piotrowski, A.L., and Voss, N.R. (2015). Visualization and quality assessment of 914 the contrast transfer function estimation. J Struct Biol _192_, 222-234. 915 Sigworth, F.J. (2004). Classical detection theory and the cryo-EM particle selection problem. J 916 Struct Biol _145_, 111-122. 917 Sindelar, C.V., and Grigorieff, N. (2012). Optimal noise reduction in 3D reconstructions of 918 single particles using a volume-normalized filter. J Struct Biol _180_, 26-38. 919 Stewart, A., and Grigorieff, N. (2004). Noise bias in the refinement of structures derived from 920 single particles. Ultramicroscopy _102_, 67-84. 921 Subramaniam, S. (2013). Structure of trimeric HIV-1 envelope glycoproteins. Proc Natl Acad 922 Sci U S A _110_, E4172-4174. 923 Subramaniam, S., Earl, L.A., Falconieri, V., Milne, J.L., and Egelman, E.H. (2016). Resolution 924 advances in cryo-EM enable application to drug discovery. Curr Opin Struct Biol _41_, 194-202. 925 Tang, G., Peng, L., Baldwin, P.R., Mann, D.S., Jiang, W., Rees, I., and Ludtke, S.J. (2007). 926 EMAN2: an extensible image processing suite for electron microscopy. J Struct Biol _157_, 38-46. 927 Thon, F. (1966). Zur Defokussierungsabhängigkeit des Phasenkontrastes bei der 928 elektronenmikroskopischen Abbildung. Z Naturforschung _21a_, 476–478. 929 van Heel, M. (1982). Detection of Objects in Quantum-Noise-Limited Images. Ultramicroscopy 930 _7_, 331-341. 931 van Heel, M. (2013). Finding trimeric HIV-1 envelope glycoproteins in random noise. Proc Natl 932 Acad Sci U S A _110_, E4175-4177. 933 van Heel, M., Harauz, G., Orlova, E.V., Schmidt, R., and Schatz, M. (1996). A new generation 934 of the IMAGIC image processing system. J Struct Biol _116_, 17-24. 935 Voss, N.R., Yoshioka, C.K., Radermacher, M., Potter, C.S., and Carragher, B. (2009). DoG 936 Picker and TiltPicker: software tools to facilitate particle selection in single particle electron 937 microscopy. J Struct Biol _166_, 205-213. 938 Zhang, K. (2016). Gctf: Real-time CTF determination and correction. J Struct Biol _193_, 1-12. 939 Zhou, A., Rohou, A., Schep, D.G., Bason, J.V., Montgomery, M.G., Walker, J.E., Grigorieff, N., 940 and Rubinstein, J.L. (2015). Structure and conformational states of the bovine mitochondrial 941 ATP synthase by cryo-EM. Elife _4_, e10180. 942

섹션 본문 159문단 · 123,791자

(제목 없음)

1We have developed new open-source software called cisTEM (computational imaging system for transmission electron microscopy) for the processing of data for high-resolution electron cryo-microscopy and single-particle averaging. cisTEM features a graphical user interface that is used to submit jobs, monitor their progress, and display results. It implements a full processing pipeline including movie processing, image defocus determination, automatic particle picking, 2D classification, ab-initio 3D map generation from random parameters, 3D classification, and highresolution refinement and reconstruction. Some of these steps implement newly-developed algorithms; others were adapted from previously published algorithms. The software is optimized to enable processing of typical datasets (2000 micrographs, 200 k -300 k particles) on a high-end, CPU-based workstation in half a day or less, comparable to GPU-accelerated processing. Jobs can also be scheduled on large computer clusters using flexible run profiles that can be adapted for most computing environments. cisTEM is available for download from cistem.org.

Introduction

2The three-dimensional (3D) visualization of biological macromolecules and their assemblies by single-particle electron cryo-microscopy (cryo-EM) has become a prominent approach in the study of molecular mechanisms (Cheng et al., 2015;Subramaniam et al., 2016). Recent advances have been primarily due to the introduction of direct electron detectors (McMullan et al., 2016). With the improved data quality, there is increasing demand for advanced computational algorithms to extract signal from the noisy image data and reconstruct 3D density maps from them at the highest possible resolution. The promise of near-atomic resolution (3-4 Å ), where densities can be interpreted reliably with atomic models, has been realized by many software tools and suites (Frank et al., 1996;Hohn et al., 2007;Lyumkis et al., 2013;Punjani et al., 2017;Scheres, 2012;Tang et al., 2007;van Heel et al., 1996). Many of these tools implement a standard set of image processing steps that are now routinely performed in a single particle project. These typically include movie frame alignment, contrast transfer function (CTF) determination, particle picking, two-dimensional (2D) classification, 3D reconstruction, refinement and classification, and sharpening of the final reconstructions.

3We have written new software called cisTEM to implement a complete image processing pipeline for single-particle cryo-EM, including all these steps, accessible through an easy-to-use graphical user interface (GUI). Some of these steps implement newly-developed algorithms described below; others were adapted from previously published algorithms. cisTEM consists of a set of compiled programs and tools, as well as a wxWidgets-based GUI. The GUI launches programs and controls them by sending specific commands and receiving results via TCP/IP sockets. Each program can also be run manually, in which case it solicits user input on the command line. The design of cisTEM, therefore, allows users who would like to have more control over the different processing steps to design their own procedures outside the GUI. To adopt this new architecture, a number of previously existing Fortran-based programs were rewritten in C++, including Unblur and Summovie (Grant and Grigorieff, 2015b), mag_distortion_correct (Grant and Grigorieff, 2015a), CTFFIND4 , and Frealign (Lyumkis et al., 2013). Additionally, algorithms described previously were added for particle picking (Sigworth, 2004), 2D classification (Scheres et al., 2005) and ab-initio 3D reconstruction (Grigorieff, 2016), sometimes with modifications to optimize their performance. cisTEM is open-source and distributed under the Janelia Research Campus Software License (http://license.janelia.org/license/janelia_license_1_2.html).

4cisTEM currently does not support computation on graphical processing units (GPUs). Benchmarking of a hotspot identified in the global orientational search to determine particle alignment parameters showed that an NVIDIA K40 GPU performs approximately as well as 16 Xeon E5-2687W CPU cores after the code was carefully optimized for the respective hardware in both cases. Since CPU code is more easily maintained and more generally compatible with existing computer hardware, the potential benefit of GPU-adapted code is primarily the lower cost of a high-end GPU compared with a high-end CPU. We chose to focus on optimizing our code for CPUs.

Movie alignment and CTF determination

5Movie alignment and CTF determination are based on published algorithms previously implemented in Unblur and Summovie (Grant and Grigorieff, 2015b), and CTFFIND4 , respectively, and these are therefore only briefly described here. Unblur determines the translations of individual movie frames necessary to bring features (particles) visible in the frames into register. Each frame is aligned against a sum of all other frames that is iteratively updated until there is no further change in the translations. The trajectories along the x-and y-axes are smoothed using a Savitzky-Golay filter to reduce the possibility of spurious translations. Summovie uses the translations to calculate a final frame average with optional exposure filtering to take into account radiation damage of protein and maximize its signal in the final average. cisTEM combines the functionality of Unblur and Summovie into a single panel and exposes all relevant parameters to the user ( Figure 1). Both programs were originally written in Fortran and have been rewritten entirely in C++.

6CTFFIND4 fits a calculated two-dimensional CTF to Thon rings (Thon, 1966) visible in the power spectrum calculated from either images or movies. The fitted parameters include astigmatism and, optionally, phase shifts generated by phase plates. When computed from movies, the Thon rings are often more clearly visible compared to Thon rings calculated from images ( Figure 2; [Bartesaghi et al., 2014]). When selecting movies as inputs, the user can specify how many frames should be summed to calculate power spectra. An optimal value to amplify Thon rings would be to sum the number of frames that correspond to an exposure of about four electrons/Å 2 (McMullan et al., 2015).

7Since our original description of the CTFFFIND4 algorithm , several significant changes were introduced. (1) The initial exhaustive search over defocus values can now be performed using a one-dimensional version of the CTF (i.e. with only two parameters: defocus and phase shift) against a radial average of the amplitude spectrum. This search is much faster than the equivalent search over the 2D CTF parameters (i.e., four parameters: two for defocus, one for astigmatism angle and one for phase shift) and can be expected to perform well except in cases of very large astigmatism (Zhang, 2016). Once an initial estimate of the defocus parameter has been obtained, it is refined by a conjugate gradient minimizer against the 2D amplitude spectrum, as done previously. In cisTEM, the default behavior is to perform the initial search over the 1D amplitude spectrum, but the user can revert to previous behavior by setting a flag in the 'Expert Options' of the 'Find CTF' Action panel.

8(2) If the input micrograph's pixel size is smaller than 1.4 Å , the resampling and clipping of its 2D amplitude spectrum will be adjusted so as to give a final spectrum for fitting with an edge corresponding to 1/2.8 Å À1 , to avoid all of the Thon rings being located near the origin of the spectrum, where they can be very poorly sampled. (3) The computation of the quality of fit (CC fit -1 in ) is now computed over a moving window, similar to (Sheth et al., 2015), rather than at intervals delimited by nodes in the CTF. (4) Following background subtraction as described in Mindell and Grigorieff (2003), a radial, sine-edged mask is applied to the spectrum, and this masked version is used during search and refinement of defocus, astigmatism and phase shift parameters. The sine is 0.0 at the Fourier space origin, and 1.0 at a radius corresponding to 1/4 Å À1 , and serves to emphasize high-resolution Thon rings, which are less susceptible to artefacts caused by imperfect background subtraction. For all outputs from the program (diagnostic image of the amplitude spectrum, 1D plots, etc.), the background-subtracted, but non-masked, version of the amplitude spectrum is used. (5) Users receive a warning if the box size of the amplitude spectrum and the estimated defocus parameters suggest that significant CTF aliasing occurred (Penczek et al., 2014).

Particle picking

9Putative particles are found by matching to a soft-edged disk template, which is related to a convolution with Gaussians ) but uses additional statistics based on an algorithm originally described by Sigworth (2004). The use of a soft-edged disk template as opposed to structured templates has two main advantages. It greatly speeds up calculation, enabling picking in 'real time', and alleviates the problem of templates biasing the result of all subsequent processing towards those templates (Henderson, 2013;Subramaniam, 2013;van Heel, 2013). Any bias that is introduced will be towards a featureless 'blob' and will likely be obvious if present.

10Rather than fully describing the original algorithm by (Sigworth, 2004), we will emphasize here where we deviated from it. The user must specify three parameters: the radius of the template disk, the maximum radius of the particle, which sets the minimum distance between picks, and the detection threshold value, given as a number of standard deviations of the (Gaussian) distribution of scores expected if no particles were present in the input micrograph. Values of 1.0 to 6.0 for this threshold generally give acceptable results. All other parameters mentioned below can usually remain set to their default values. All Action panels provide background information on the operation they control, as well as a section with detailed explanations of all user-accessible parameters. All Action panels also have an Expert Options section that exposes additional parameters. DOI: https://doi.org/10. 7554/eLife.35383.002 Prior to matched filtering, micrographs are resampled by Fourier cropping to a pixel size of 15 Å (the user can override this by changing the 'Highest resolution used in picking' value from its default 30 Å ), and then filtered with a high-pass cosine-edged aperture to remove very low-frequency density ramps caused by variations in ice thickness or uneven illumination.

11The background noise spectrum of the micrograph is estimated by computing the average rotational power spectrum of 50 areas devoid of particles, and is then used to 'whiten' the background (shot +solvent) noise of the micrograph. Normalization, including CTF effects, and matched filtering are then performed as described (Sigworth, 2004), except using a single reference image and no principal components' decomposition. When particles are very densely packed on micrographs, this approach can significantly over-estimate the background noise power so that users may find they have to use lower thresholds for picking. It might also be expected that under those circumstances, micrographs with much lower particle density will suffer from a higher rate of false-positive picks.

12One difficulty in estimating the background noise spectrum of the micrograph is to locate areas devoid of particles without a priori knowledge of their locations. Our algorithm first computes a map of the local variance and local mean in the micrograph (computed over the area defined by the maximum radius given by the user [Roseman, 2004;Van Heel, 1982]) and the distribution of values of these mean and variance maps. The average radial power spectrum of the 50 areas of the micrograph with the lowest local variance is then used as an estimate of the background noise spectrum. Optionally, the user can set a different number of areas to be used for this estimate (for example if the density of particles is very high or very low) or use areas with local variances closest to the mode of the distribution of variances, which may also be expected to be devoid of particles.

13Matched-filter methods are susceptible to picking high-contrast features such as contaminating ice crystals or carbon films. (Sigworth, 2004) suggests subtracting matched references from the extracted boxes and examining the remainder in order to discriminate between real particles and false positives. In the interest of performance, we decided instead to pick using a single artificial reference (disk) and to forgo such subtraction approaches. To avoid picking these kinds of artifacts, the (Bartesaghi et al., 2015) used to benchmark cisTEM. The left pattern was calculated from the average of non-exposure filtered and aligned frames while the right pattern was calculated using the original movie with 3-frame sub-averages. The pattern calculated using the movie shows significantly stronger rings compared to the other pattern. DOI: https://doi.org/10.7554/eLife.35383.003 user can choose to ignore areas with abnormal local variance or local mean. We find that ignoring high-variance areas often helps avoid edges of problematic objects, e.g. ice crystals or carbon foils, and that avoiding high-and low-mean areas helps avoid picking from areas within them, e.g. the carbon foil itself or within an ice crystal ( Figure 3). The thresholds used are set to Mo þ 2 FWHM for the variance and Mo AE 2 FWHM for the mean, where Mo is the mode (i.e. the most-commonly-occurring value) and FWHM the full width at half-maximum of the distribution of the relevant statistic. For micrographs with additional phase plate phase shifts between 0.1 and 0.9 p, where much higher contrast is expected, the variance threshold is increased to Mo þ 8 FWHM. We have found that in favorable cases many erroneous picks can be avoided. Remaining false-positive picks are removed later during 2D classification.

14Because of our emphasis on performance, our algorithm can be run nearly instantaneously on a typical~4K image, using a single processor. In the Action panel, the user is presented with an 'Auto preview' mode to enable interactive adjustment of the picking parameters ( Figure 3). In this mode, the micrograph is displayed with optional and adjustable low-pass and high-pass filters, and the results of picking using the currently selected parameters are overlaid on top. Changing one or more of the parameters leads to a fast re-picking of the displayed micrograph, so that the parameters can be optimized in real-time. Once the three main parameters have been adjusted appropriately, the full complement of input micrographs can be picked, usually in a few seconds or minutes.

15A possible disadvantage of using a single disk template exists when the particles to be picked are non-uniform in size or shape (e.g. in the case of an elongated particle). In this case, it may be expected that a single template would have difficulty in picking all the different types and views of particles present, and that in this case using a number of different templates would lead to a more accurate picking. In practice, we found that with careful optimization of the parameters, elongated particles and particles with size variation (Figure 3) were picked adequately.

16The underlying implementation of the algorithm supports multiple references as well as reference rotation. These features may be exposed to the graphical user interface in future versions, for example enabling the use of 2D class averages as picking templates (Scheres, 2015).

2D classification

172D classification is a relatively quick and robust way to assess the quality of a single-particle dataset. cisTEM implements a maximum likelihood algorithm (Scheres et al., 2005) and generates fully CTFcorrected class averages that typically display clear high-resolution detail, such as secondary structure. Integration of the likelihood function is done by evaluating the function at defined angular steps da that are calculated according to

18where R is the resolution limit of the data and D is the diameter of the particle (twice the mask radius that is applied to the iteratively-refined class averages). cisTEM runs a user-defined number of iterations n defaulting to 20. To speed up convergence, the resolution limit is adjusted as a function of iteration cycle l (0 l <n):

19where R start and R finish are user-defined resolution limits at the first and last iteration, defaulting to 40 Å and 8 Å , respectively. The user also sets K, the number of classes to calculate. Depending on this number and the number of particles N in the dataset, only a percentage p of the particles are included in the calculation. These particles are randomly reselected for each iteration and p is typically small, for example 0.1, in the first 10 iterations (p 0À9 ), then increases to 0.3 for iteration 10 to 14 (p 10À14 ) and finishes with five iterations including all data (p 15À19 ):

20For example, for a dataset containing N ¼ 100; 000 particles, p 0À9 ¼ 0:15, that is, 15% of the data will be used to obtain K ¼ 50 classes. Apart from speeding up the calculation, the stepwise increase of the resolution limit and the random selection of subsets of the data also reduce the chance of overfitting (see also the calculation of ab-initio 3D reconstructions and 3D refinement below) and, therefore, increase the convergence radius of the 2D classification algorithm.

21For the calculation of the likelihood function, the particle images X i are noise-whitened by dividing their Fourier transforms F X i f g by the square root of the radially average noise power spectrum, NPS:

22where g is the 2D reciprocal space coordinate and g ¼ g j j its magnitude. The noise power spectrum is calculated from the boxed particle images using the area outside the circular mask set by the user according to the expected particle size. To increase accuracy, it is further averaged across 2000 randomly selected particles. The background (density outside the mask) is further normalized by adding a constant to each particle that yields a background average of zero.

23Finally, at the beginning of each iteration, noise features in the class averages A i are suppressed by resetting negative values below a threshold t i to the threshold:

24where j runs over all pixels in average A i .

3D refinement (FrealignX)

25The refinement of 3D reconstructions in cisTEM uses a version of Frealign (Lyumkis et al., 2013) that was specifically designed to work with cisTEM. Most of Frealign's control parameters are exposed to the user in the 'Manual Refine' Action panel ( Figure 4). The 'Auto Refine' and 'Ab-Initio' panels also use Frealign but manage many of the parameters automatically (see below). Frealign's algorithm was described previously (Grigorieff, 2007;Lyumkis et al., 2013) and this section will mostly cover important differences, including a new objective function used in the refinement, different particle weighting used in reconstructions, optional likelihood-based blurring, as well as new masking options.

Matched filter

26To make Frealign compatible with cisTEM's GUI, the code was completely rewritten in C++, and it will be referred to here as Frealign v10, or FrealignX. The new version makes use of a matched filter (McDonough and Whalen, 1995) to maximize the signal in cross correlation maps calculated between particle images and reference projections. This requires whitening of the noise present in the images and resolution-dependent scaling of the reference projections to match the signal in the noise-whitened images. Both can be achieved if the spectral signal-to-noise ratio (SSNR) of the data is known. As part of a 3D reconstruction, Frealign calculates the resolution-dependent PSSNR, the radially averaged SSNR present in the particle images before they are affected by the CTF Figure 4. Manual refinement panel with Expert Options exposed. Most of the parameters needed to run FrealignX can be accessed on this panel. The panel also allows application of a 3D mask, which can be imported as a Volume Asset. DOI: https://doi.org/10.7554/eLife.35383.005 (Sindelar and Grigorieff, 2012). Using PSSNR and the CTF determined for a particle, the SSNR in the particle image can be calculated as

27(as before, g is the 2D reciprocal space coordinate and g ¼ g j j). Here, SNR is defined as the ratio of the variance of the signal and the noise. The Fourier transform F X i n o of the noise-whitened particle image X i can then be calculated as

28where F X i f g is the Fourier transform of the original image X i , Á j j is the absolute value, and F X i f g j j 2 r is the radially averaged spectrum of the squared 2D Fourier transform amplitudes of image X i . To implement Equation (7), a particle image is first divided by its amplitude spectrum, which includes power from both signal and noise, and then multiplied by a term that amplifies the image amplitudes according to the signal strength in the image. The reference projection A i can be matched by calculating

29Equation (8) scales the variance of the signal in the reference to be proportional to the measured signal-to-noise ratio in the noise-whitened images. The main term in the objective function O f ð Þ maximized in FrealignX is therefore given by the cross-correlation function

30where f is a set of parameters describing the particle view, x,y position, magnification and defocus, Re Á ð Þ is the real part of a complex number, Á k k is the Euclidean norm, i.e. the square root of the sum of the squared pixel values, and F R1;R3 Á f g à is the conjugate complex value of the Fourier transform F R1;R3 Á f g. The subscripts R1 and R3 specify the low-and high-resolution limits of the Fourier transforms included in the calculation of Equation (9a), as specified by the user. To reduce noise overfitting, the user has the option to specify also a resolution range in which the absolute value of the cross terms in the numerator of Equation (9a) are used (Grigorieff, 2000;Stewart and Grigorieff, 2004), instead of the signed values (option 'Signed CC Resolution Limit' under 'Expert Options' in the 'Manual Refine' Action panel). In this case

31where R2 is specified by the 'Signed CC Resolution Limit.' The objective function also includes a term R fjQ ð Þ to restrain alignment parameters (Chen et al., 2009;Lyumkis et al., 2013;Sigworth, 2004), which currently only includes the x,y positions:

32where s is the standard deviation of the noise in the particle image and Q represents a set of model parameters including the average particle positions in a dataset, x À and y À , and the standard deviations of the x,y positions from the average values, s x and s y , and M is the number of pixels in the mask applied to the particle before alignment. The complete objective function is therefore

33The maximized values determined in a refinement are converted to particle scores by multiplication with 100.

CTF refinement

34FrealignX can refine the defocus assigned to each particle. Given typical imaging conditions with current instrumentation (300 kV, direct electron detector), this may be useful when particles have a size of about 400 kDa or larger. Depending on the quality of the sample and images, these particles may generate sufficient signal to yield per-particle defocus values that are more accurate than the average defocus values determined for whole micrographs by CTFFIND4 (see above). Refinement is achieved by a simple one-dimensional grid search of a defocus offset applied to both defocus values determined in the 2D CTF fit obtained by CTFFIND4. FrealignX applies this offset to the starting values in a refinement, typically determined by CTFFIND4, and evaluates the objective function, Equation (11), for each offset. The offset yielding the maximum is then used to assign refined defocus values. In a typical refinement, the defocus offset is searched in steps of 50 Å , in a range of ±500 Å . In the case of b-galactosidase (see below), a single round of defocus refinement changed the defocus on average by 60 Å ; the RMS change was 80 Å . For this refinement, the resolution for the signed cross terms equaled the overall refinement resolution limit (3.1 Å ), i.e. no unsigned cross terms were used. The refinement produced a marginal improvement of 0.05 Å in the Fourier Shell Correlation (FSC) threshold of 0.143, suggesting that the defocus values determined by CTFFIND4 were already close to optimal. In a different dataset of rotavirus double-layer particles, a single round of defocus refinement changed the defocus on average by 160 Å ; the RMS change was 220 Å . In this case, the refinement increased the resolution from~3.0 Å to~2.8 Å .

Masking

35FrealignX has a 3D masking function to help in the refinement of structures that contain significant disordered regions, such as micelles in detergent-solubilized membrane proteins. To apply a 3D mask, the user supplies a 3D volume that contains positive and negative values. cisTEM will binarize this volume by zeroing all voxels with values less than or equal to zero, and setting all other voxels to 1, indicating the region of the volume that is inside the mask. A soft cosine-shaped falloff of specified width (e.g. 10 Å ) is then applied to soften the edge of the masked region and avoid sharp edges when the mask is applied to a 3D reconstruction. The region of the reconstruction outside the mask can be set to zero (simple multiplication of the mask volume), or to a low-pass filtered version of the original density, optionally downweighted by multiplication by a scaling factor set by the user. At the edge of the mask, the low-pass filtered density is blended with the unfiltered density inside the mask to produce a smooth transition. Figure 5 shows the result of masking the reconstruction of an ABC transporter associated with antigen processing (TAP, [Oldham et al., 2016]). The mask was designed to contain only density corresponding to protein and the outside density was low-pass filtered at 30 Å resolution and kept with a weight of 100% in the final masked reconstruction. The combination of masking and low-pass filtering in this case keeps a low-pass filtered version of the density outside the mask in the reconstruction, including the detergent micelle. Detergent micelles can be a source of noise in the particle images because the density represents disordered material. However, at low, 20 to 30 Å resolution, micelles generate features in the images that can help in the alignment of the particles. In the case of TAP, this masking prevented noise overfitting in the detergent micelle and helped obtain a reconstruction at 4 Å resolution (Oldham et al., 2016).

3D reconstruction

36In Frealign, a 3D reconstruction V k of class average k and containing N images is calculated as (Lyumkis et al., 2013;Sindelar and Grigorieff, 2012)

37where q ik is the probability of particle i belonging to class k, s i is the standard deviation of the noise Figure 5 continued on next page in particle image i, f i are its alignment parameters, w ik the score-based weights (Equation (14), see below), CTF i the CTF of the particle image, R f i ; Á ð Þ the reconstruction operator merging data into a 3D volume according to alignment parameters f i , PSSNR the radially averaged particle SSNR derived from the FSC between half-maps (Sindelar and Grigorieff, 2012), X i the noise-whitened image i, and F À1 Á f g the inverse Fourier transform. For the calculation of the 3D reconstructions, as well as 3D classification (see below) the particle images are not whitened according to Equation (7). Instead, they are whitened using the radially-and particle-averaged power spectrum of the background around the particles:

38where B X i ð Þ is a masked version of image X i with the area inside a circular mask centered on the particle replaced with the average values at the edge of the mask, and scaled variance to produce an average pixel variance of 1 in the whitened image X i . Using the procedure in Equation (13) has the advantage that whitening does not depend on the knowledge of the SSNR of the data, and reconstructions can therefore be calculated even when the SSNR is not known.

Score-based weighting

39In previous versions of Frealign, resolution-dependent weighting was applied to the particle images during reconstruction (the Frealign parameter was called 'PBC', (Grigorieff, 2007)). The weighting function took the form of a B-factor dependent exponential that attenuates the image data at higher resolution. FrealignX still uses B-factor weighting but the weighting function is now derived from the particle scores (see above) as

40BSC2 converts the difference between a particle score and score2, the score average, into a B-factor. Setting BSC2 to zero will turn off score-based particle weighting. Scores typically vary by about 10, and values for BSC2 that produce reasonable discrimination between high-scoring and low-scoring particles are between 2 and 10 Å 2 , resulting in B-factor differences between particles of 20 to 100 Å 2 .

3D classification

41FrealignX uses a maximum-likelihood approach for 3D classification (Lyumkis et al., 2013). Assuming that all images were noise-whitened according to Equation (13), which scales the variance of each image such that the average standard deviation of the noise in a pixel is 1, the probability density function (PDF) of observing image X i , given alignment parameters f i and reconstruction V k , is calculated as (Lyumkis et al., 2013)

42As before, f ik are the alignment parameters (usually just Euler angles and x,y shifts) determined for image i with respect to class average k, } is the projection operator producing an aligned 2D projection of reconstruction V k according to parameters f ik ,

43is the sum of the squared pixel value differences between whitened image X i and the reference projection inside a circular mask defining the area of the particle with user-defined diameter, M is the number of Figure 5 continued regions outside the mask are low-pass filtered at 30 Å resolution to remove high-resolution noise from the disordered detergent micelle, but keeping its low-resolution signal to help particle alignment. DOI: https://doi.org/10.7554/eLife.35383.006 pixels inside this mask, and g f ik jQ k ð Þ is a hierarchical prior describing the probability of observing alignment parameters f ik given model parameters Q k (see Equation 10). Equation (15) does not include marginalization over alignment parameters. Marginalization could be added to improve classification when particle alignments suffer from significant errors. However, this is currently not implemented in cisTEM. Given the joint probability, Equation (15), determined in a refinement, the probability q ik of particle i belonging to class k can be updated as (Lyumkis et al., 2013)

44where the summation in the denominator is taken over all classes and the average probabilities p k Figure 6. 3D classification of a dataset of F 1 F O -ATPase, revealing different conformational states (reproduced from Figure 6A and B in Zhou et al., 2015). for a particle to belong to class k are given by the average values of q ik determined in a prior iteration, calculated for the entire dataset of N particles:

45An example of 3D classification is shown in Figure 6 for F 1 F O -ATPase, revealing different conformational states of the g subunit (Zhou et al., 2015).

Focused classification

463D classification can be improved by focusing on conformationally-or compositionally-variable regions of the map. To achieve this, a mask is applied to the particle images and reference projections, the area of which is defined as the projection of a sphere with user-specified center (within the 3D reconstruction) and radius. This 2D mask is therefore defined independently for each particle, as a function of its orientation. When using focused classification, M in Equation (15) is adjusted to the number of pixels inside the projected mask and the sum of the squared pixel value differences in Equation (15) is limited to the area of the 2D mask. By applying the same mask to image and reference, only variability inside the masked region is used for 3D classification. Other regions of the map are ignored, leading to a 'focusing' on the region of interest. The focused mask also excludes noise contained in the particle images outside the mask and therefore improves classification results that often depend on detecting small differences between particles and references. A typical application of a focused mask is in the classification of ribosome complexes that may exhibit localized conformational and/or compositional variability, for example the variable conformations of an IRES (Abeyrathne et al., 2016) or different states of tRNA accommodation (Loveland et al., 2017).

Likelihood-based blurring

47In some cases, the convergence radius of refinement can be improved by blurring the reconstruction according to a likelihood function. This procedure is similar to the maximization step in a maximum likelihood approach (Scheres, 2012). The likelihood-blurred reconstruction is given by

48where, in the case of FrealignX, f axy only includes the x,y particle positions and in-plane rotation angle a, which are a subset of the alignment parameters f i , and V nÀ1 k is the reconstruction from an earlier refinement iteration. As before, G X i jf i ; V nÀ1 k À Á is the probability of observing image i, given alignment parameters f i and reconstruction V nÀ1 k . Integration over these three parameters can be efficiently implemented and, therefore, does not produce a significant additional computational burden.

Resolution assessment

49The resolution of reconstructions generated by FrealignX is assessed using the FSC criterion (Harauz and van Heel, 1986) using the 0.143 threshold (Rosenthal and Henderson, 2003). FSC curves in cisTEM are calculated using two reconstructions ('half-maps') calculated either from the even-numbered and odd-numbered particles, or by dividing the dataset into 100 equal subsets and using the even-and odd-numbered subsets to calculate the two reconstructions (in the cisTEM GUI, the latter is always used). The latter method has the advantage that accidental duplication of particles in a stack is less likely to affect the FSC calculation. All particles are refined against a single reference and, therefore, the calculated FSC values may be biased towards higher values (Grigorieff, 2000;Stewart and Grigorieff, 2004). This bias extends slightly beyond the resolution limit imposed during refinement, by approximately 2=D mask , where D mask is the mask radius used to mask the reconstructions (see above). During auto-refinement (see below), the resolution limit imposed during refinement is carefully adjusted to stay well below the estimated resolution of the reconstruction and the resolution estimate is therefore unbiased (Scheres and Chen, 2012). However, users have full control over all parameters during manual refinement and will have to make sure that they do not bias the resolution estimate by choosing a resolution limit that is close to, or higher than, the estimated resolution of the final reconstruction. Calculated FSC curves are smoothed using a Savitzky-Golay cubic polynomial that reduces the noise often affecting FSC curves at the high-resolution end.

50The FSC calculated between two density maps is dependent on the amount of solvent included inside the mask applied to the maps. A larger mask that includes more solvent background will yield lower FSC values than a tighter mask. To obtain an accurate resolution estimate in the region of the particle density, one possibility is to apply a tight mask that closely follows the boundary of the particle. This approach bears the risk of generating artifacts because the particle boundary is not always well defined, especially when the particle includes disordered domains that generate weak density in the reconstruction. The approach in Frealign avoids tight masking and instead calculates an FSC curve using generously masked density maps, corrected for the solvent content inside the mask (Sindelar and Grigorieff, 2012). The corrected FSC curve is referred to as Part FSC and is calculated from the uncorrected FSC uncor as (Oldham et al., 2016)

51where f is the ratio of mask volume to estimated particle volume. The particle volume can be estimated from its molecular mass M w as 3 0:81Da M w (Matthews, 1968). FSC curves obtained with the generous masking and subsequent solvent correction yield resolution estimates that are very close to those obtained with tight masking ( Figure 7C). Equation (19) assumes that both maps have similar SSNR values, as is normally the case for the two reconstructions calculated from two halves of the dataset, indicated by the subscript half À maps. If one of the maps does not contain noise from solvent background, for example when calculating the FSC between a reconstruction and a map derived from an atomic model, the solvent-corrected FSC is given as

Speed optimization

52FrealignX has been optimized for execution on multiple CPU cores. Apart from using optimized library functions for FFT calculation and vector multiplication (Intel Math Kernel Library), the processing speed is also increased by on-the-fly cropping in real and reciprocal space of particle images and 3D reference maps. Real-space cropping reduces the interpolation accuracy in reciprocal space and is therefore limited to global parameter searches that do not require the highest accuracy in the calculation of search projections. Reciprocal-space cropping is used whenever a resolution limit is specified by the user or in an automated refinement (ab-initio 3D reconstruction and auto-refinement).

53For the calculation of in-plane rotated references, reciprocal-space padding is used to increase the image size four-fold, allowing fast nearest-neighbor resampling in real space with sufficient accuracy to produce rotated images with high fidelity.

Ab-initio 3D reconstruction

54Ab-initio reconstruction offers a convenient way to proceed from single particle images to a 3D structure when a suitable reference is not available to initialize 3D reconstruction and refinement. Different ab-initio methods have been described (Hohn et al., 2007;Punjani et al., 2017;Reboul et al., 2018) and cisTEM's implementation follows a strategy published originally by (Grigorieff, 2016). It is based on the premise that iterative refinement of a reconstruction initialized with random angular parameters is likely to converge on the correct structure if overfitting is avoided and the refinement proceeds in small steps to reduce the chance of premature convergence onto an incorrect structure. The procedure is implemented as part of cisTEM's GUI and uses FrealignX to perform the refinements and reconstructions. After initialization with random angles, cisTEM performs a user-specified number of global alignment parameter searches, recalculating the reconstruction after each search and applying an automatic masking procedure to it before the next global search. Similar to 2D classification (see above), only a randomly selected subset of the data is used in each iteration and the resolution limit applied during the search is increased with every iteration. The number of iterations n defaults to 40, the starting and final resolution limits R start and R finish default to 20 Å and 8 Å , respectively, and the starting and final percentage of included particles in the reconstruction, p start and p finish default to 2500K=N and 10; 000K=N, respectively (results larger than one are reset to 1), with K the number of 3D classes to be calculated as specified by the user, and N the number of particles in the dataset. If symmetry is applied, N is replaced by NO sym where O sym is the number of asymmetric units present in one particle. The resolution limit is then updated in each iteration l as in Equation (2), and the percentage is updated as

55again resetting results larger than 1 to 1. cisTEM actually performs a global search for a percentage 3p of the particle stack, that is, three times as many particles as are included in the reconstructions for each iteration. The particles included in the reconstructions are then chosen to be those with the highest scores as calculated by FrealignX. The global alignment parameters are performed using the 'general' FrealignX procedure with the following changes. Firstly, the PSSNR is not directly estimated from the FSC calculated at each round. Instead, for the first three iterations, a default PSSNR is calculated based on the molecular weight. From the fourth iteration onwards, the PSSNR is calculated from the FSC, however if the calculated PSSNR is higher than the default PSSNR, the default PSSNR is taken instead. This is done in order to avoid some of the overfitting that will occur during refinement. Secondly, during a normal global search the top h (where h defaults to 20) results of the grid search are locally refined, and the best locally refined result is taken. In the ab-initio procedure, however, the result of the global search for a given particle image is taken randomly from all results that have a score which lies in the top 15% of the difference between the worst score and the best score.

56During the reconstruction steps, the calculated s for each particle is reset to 1 prior to 3D reconstruction and score weighting is disabled. This is done because the s and score values are not meaningful until an approximately correct solution is obtained.

57The reconstructions are automatically masked before each new refinement iteration to suppress noise features that could otherwise be amplified in subsequent iterations. The same masking procedure is also applied during auto-refinement (see below). It starts by calculating the density average À of the reconstruction and resetting all voxel values below À to À . This thresholded reconstruction is then low-pass filtered at 50 Å resolution and turned into a binary mask by setting densities equal or below a given threshold t to zero and all others to 1. The threshold is calculated as

58where À filtered is the density average of the low-pass filtered map and À max 500 is the average of the 500 highest values in the filtered map. The largest contiguous volume in this binarized map is then identified and used as a mask for the original thresholded reconstruction, such that all voxels outside of this mask will be set to À . Finally, a spherical mask, centered in the reconstruction box, is applied by resetting all densities outside the mask to zero.

59The user has the option to repeat the ab-initio procedure multiple times using the result from the previous run as the starting map in each new run, to increase the convergence radius if necessary. In the case of symmetric particles, the default behavior is to perform the first 2/3 rds of the iterations without applying symmetry. The non-symmetrized map is then aligned to the expected symmetry axes and the final 1/3 rd of the iterations are carried out with the symmetry applied. This default behavior can be changed by the user such that symmetry is always applied, or is never applied. Alignment of the model to the symmetry axes is achieved using the following process. A brute force grid search over rotations around the x, y and z axes is set up. At each position on the grid the 3D map is rotated using the current x, y and z parameters, and then its projection along Euler angle (0, 0, 0) is calculated. All of the symmetry-related projections are then also calculated, and for each one a cross-correlation map is calculated using the original projection as a reference, and the peak within this map is found. The sum of all peaks from all symmetry-related directions is taken and the x,y,z rotation that most closely aligns the original 3D map along the symmetry axes should provide the highest peak sum. To improve robustness, this process is repeated for two additional angles (À45,-45, À45 and 15, 70,-15) that were chosen with the aim of including different-looking areas when the map to be aligned is unusual in some way. The x,y,z rotation that results in the largest sum of all peaks, over all three angles, is taken as the final rotation result. Shifts for this rotation are then calculated based on the found 2D x,y shifts between the initial and symmetry-related projections, with the z shift being set to 0 for C symmetries. The symmetry alignment is also included as a command-line program, which can be used to align a volume to the symmetry axis when the ab-initio is carried out in C1 only, or when using a reference obtained by some other means.

Automatic refinement

60Like ab-initio 3D reconstruction, auto-refinement makes use of randomly selected subsets of the data and of an increasing resolution limit as refinement proceeds. However, unlike the ab-initio procedure, the percentage of particles p l and the resolution limit R l used in iteration l depend on the resolution of the reconstructions estimated in iteration l À 1. When the estimated resolution improved in the previous cycle,

61where K is the number of 3D classes to be calculated and N the number of particles in the dataset. As before, if the particle has symmetry, N is replaced by NO sym where O sym is the number of asymmetric units present in one particle. If the calculated p l exceeds 1, it is reset to 1. The resolution limit is estimated as

62where FSC 0:5 is the point at which the FSC, unadjusted for the solvent within the mask (see above) crosses the 0.5 threshold and D mask is the user-specified diameter of the spherical mask applied to the 3D reference at the beginning of each iteration, and to the half-maps used to calculate the FSC. The term 2=D mask accounts for correlations between the two half-maps due to the masking (see above). When the resolution did not improve in the previous iteration,

63(reset to one if resulting in a value larger than 1). At least five refinement iterations are run and refinement stops when p l reaches 1 (all particles are included) and there was no improvement in the estimated resolution for the last three iterations. If multiple classes are refined, the resolution limit in Equation (25) is set independently for each class, however the highest resolution used for classification is fixed at 8 Å . At least nine iterations are run and refinement stops when p l reaches 1, the average change in the particle occupancy in the last cycle was 1% or less, and there was no improvement in the estimated resolution for the last three iterations.

64In a similar manner to the ab-initio procedure, s values for each particle are set to one and score weighting is turned off. This is done until the refinement resolution is better than 7 Å , at which point it is assumed the model is of a reasonable quality.

Map sharpening

65Most single-particle reconstructions require some degree of sharpening that is usually achieved by applying a negative B-factor to the map. cisTEM includes a map sharpening tool that allows the application of an arbitrary B-factor. Additionally, maps can be sharpened by whitening the power spectrum of the reconstruction beyond a user-specified resolution (the default is 8 Å ). The whitening amplifies terms at higher resolution similar to a negative B-factor but avoids the over-amplification at the high-resolution end of the spectrum that sometimes occurs with the B-factor method due to its exponential behavior. Whitening is applied after masking of the map, either with a hollow spherical mask of defined inner and outer radius, or with a user-defined mask supplied as a separate 3D volume. The masking removes background noise and makes the whitening of the particle density more accurate. Both methods can be combined in cisTEM, together with a resolution limit imposed on the final reconstruction. The whitened and B-factor-sharpened map can optionally be filtered with a figure-of-merit curve calculated using the FSC determined for the reconstruction (Rosenthal and Henderson, 2003;Sindelar and Grigorieff, 2012).

GUI design and workflow

66cisTEM's GUI required extensive development because it is an integral part of the processing pipeline. GUIs have become more commonplace in cryo-EM software tools to make them more accessible to users (Conesa Mingo et al., 2018;Desfosses et al., 2014;Moriya et al., 2017;Punjani et al., 2017;Scheres, 2012;Tang et al., 2007). Many of the interfaces are designed as socalled wrappers of command-line driven tools, i.e. they take user input and translate it into a command line that launches the tool. Feedback to the user takes place by checking output files, which are also the main repository of processing results, such as movie frame alignments, image defocus measurements and particle alignment parameters. As processing strategies become more complex and the number of users new to cryo-EM grows, the demands on the GUI increase in the quest for obtaining the best possible results. Useful GUI functions include guided user input (so-called wizards) that adjust to specific situations, graphical presentation of relevant results, user interaction with running processes to allow early intervention and make adjustments, tools to manipulate data (e.g. masking), implementation of higher-level procedures that combine more primitive processing steps to achieve specific goals, and a global searchable database that keeps track of all processing steps and result. While some of these functions can be or have been implemented in wrapper GUIs, the lack of control of these GUIs over the data and processes makes a reliable implementation more difficult. For example, keeping track of results from multiple processing steps, some of them perhaps repeated with different parameters or run many times during an iterative refinement, can become challenging if each step produces a separate results file. Communicating with running processes via files can be slow and is sometimes unreliable due to file system caching. Communication via files may complicate the implementation of higher-level procedures, which rely on the parsing of results from the more primitive processing steps.

67The cisTEM GUI is more than a wrapper as it implements some of the new algorithms in the processing pipeline directly, adjusting the input of running jobs as the refinement proceeds. It enables more complex data processing strategies by tracking all results in a single searchable database. All processing steps are run and controlled by the GUI, which communicates with master and slave processes through TCP/IP. cisTEM uses an SQL database, similar to Appion (Lander et al., 2009), to store all results (except image files), offers input functions that guide the user or set appropriate defaults, and implements more complex procedures to automate processing where possible. cis-TEM's design is flexible to allow execution in many different environments, including single workstations, multiple networked workstations and large computer clusters.

68User input and the display of results is organized into different panels that make up cisTEM's GUI, each panel dedicated to specific processing steps (for examples, see Figures 1, 3 and 4). This design guides users through a standard workflow that most single particle projects follow: movie alignment, CTF determination, particle picking, 2D classification, 3D reconstruction, refinement and classification, and sharpening of the final reconstructions. Three types of panels exist, dealing with Assets, Actions and Results. Assets are mostly data that can be used in processing steps called Actions. They include Movies, Images, Particle Positions and Volumes. One type of Asset, a Refinement Package, defines the data and parameters necessary to carry out refinement of a 3D structure (or a set of structures if 3D classification is done), it contains a particle stack, as well as information about the sample (e.g. particle size and molecular weight) along with parameters for each particle (e.g. orientations and defocus values). Actions comprise the above mentioned workflow steps, with additional options for ab-initio 3D reconstruction, as well as automatic and manual 3D refinement to enable users to obtain the best possible results from their data. The results of most of these Actions are stored in the database and can be viewed in the related Results panels, which display relevant data necessary to evaluate the success of each processing step. The option to sort and select results by a number of different metrics is available in the movie alignment and CTF estimation Results panels. For example images can be sorted/selected based on the CTF fit resolution . Movie alignment, 3D refinement and reconstruction also produce new Image and Volume Assets, respectively. Importing or generating new Assets is accomplished by wizards that solicit the necessary user input and perform checks were possible to avoid nonsensical input. In the more complex case of creating a new Refinement Package Asset, the wizard allows the specification of input data, for example based on particle picking results or the selection of 2D and 3D classes. Once an Action has been launched, results are displayed as soon as they become available, together with an overall progress bar, giving users an estimate of how long a processing step will take and of whether the results are as expected. If desired, an Action can be aborted and restarted with a different set of parameters, or the Action can be run again after regular termination to test different parameters. In the latter case, all prior results remain accessible and users can specify those to be used for the next step in the workflow. This provides users with the flexibility to pick and choose the best results in cases where different parts of a dataset require different settings to yield optimal results. Parallelization cisTEM uses a home-grown scheme to accelerate processing in parallel environments. Image processing of single-particle data is an embarrassingly parallel problem, i.e. the parallelization of most tasks can be achieved simply by dividing the data to be processed into smaller chunks that are each processed by a separate program thread, without the need for inter-process communication. Only certain steps require merging of data, such as the calculation of a 3D reconstruction from the entire dataset. cisTEM parallelizes processing steps by running multiple instances of the same program, each dealing with a subset of the data, then directly communicating with the launched processes over TCP/IP sockets. This enables the cisTEM GUI to distribute jobs and receive results in real time. Communication is directed through a 'manager' process, which enables jobs to be run on a cluster, while the GUI itself can run on a local workstation.

69How each copy of the program is run is specified by the user by setting up a 'Run Profile'. This profile is a user defined command, or script that will be run to launch the job, and is designed to be flexible to enable the user to set up parallelization in many different environments. For example, users can design profiles to run on multiple machines via SSH, or to submit to a cluster (e.g. using qsub) etc., or even merge the two in a single profile. One disadvantage of this system is that it may be difficult to create profiles for clusters that require many jobs to be submitted using one command.

70Another advantage of using a home-grown scheme over existing schemes (e.g. MPI) occurs when jobs are run on a multi-node computing cluster. In this case, jobs will complete even if the full number of requested processors is not available. For example, if a user requests 300 CPUs for a processing step but only 100 are available, cisTEM launches 300 jobs of which 200 will remain in the job scheduler's queue. Data processing starts immediately with the 100 jobs that are allowed to run and will complete even if the remaining jobs never run. In such a scenario, an MPI-based job could only run when 300 CPUs become available, potentially delaying execution. In the few cases were a step requires merging of an entire dataset, for example in a 3D reconstruction, parallelization is achieved by calculating multiple intermediate 3D reconstructions for subsets of the data, dumping the intermediate reconstructions to disk and merging them after all reconstruction jobs have finished. It can therefore help to designate a fast disk as a scratch disk to allow rapid dumping and reading of the relatively large files (200 MB -5 GB).

Benchmarking with b-galactosidase

71A high-resolution dataset of b-galactosidase (Bartesaghi et al., 2015) was used to benchmark Relion 2 (Kimanius et al., 2016) and is also used here to illustrate the workflow of cisTEM and assess the time for the completion of different processing steps. The entire dataset was downloaded from the EMPIAR database (Iudin et al., 2016) and consists of 1539 movies containing 38 frames, recorded at super-resolution on a K2 Summit camera (Gatan, Inc., Pleasanton, CA) and stored locally as tif files using LZW compression (the conversion to tiff and compression was performed by mrc2tif (Mastronarde and Held, 2017)). The pixel size of the super-resolution frames was 0.3185 Å , and images were binned to a pixel size of 0.75 Å after movie processing. For 2D classification and ab-initio 3D reconstruction, particles were boxed using 384 Â 384 pixel boxes. For auto-and manual refinement, the particles were re-boxed into 648 Â 648 pixel boxes (boxing is part of the creation of Refinement Packages, see above). For all processing steps, a Dell Precision T7910 workstation (Bartesaghi et al., 2015) used to benchmark cisTEM. (A) Different stages of the ab-initio reconstruction procedure, starting from a reconstruction from randomly assigned Euler angles. The process takes less than an hour to complete on a high-end CPU-based workstation. (B) High-resolution detail of the refined b-galactosidase reconstruction with an average resolution of 2.2 Å , showing sidechain details for most amino acids. (C) FSC plots for the refined b-galactosidase reconstruction. The black curve was calculated using a tight mask Figure 7 continued on next page containing two E5-2699 v4 Xeon processors with a total of 44 cores was used. Processing parameters were left on default settings except for CTF determination, which was performed at 3.5 Å resolution using the movie averages instead of the frames, and particle picking, which used optimized parameters based on previewing a few selected images (Figure 3). The resolution limit during refinement (auto, manual and CTF) never exceeded 3.1 Å . The data were stored on a local SSD Raid 0 disk for fast access. Table 1 lists the timings of the different processing steps using all 44 CPU cores. Results obtained at different points in the workflow are shown in Figure 7.

Discussion

72The implementation of a complete image processing workflow in cisTEM offers users a uniform experience and guarantees smooth transitions between processing steps. It also helps developers maintain the software as all the tools and algorithms are developed in-house.

73The main focus of cisTEM is on the processing of single-particle cryo-EM data and high-resolution 3D reconstruction. Future releases of cisTEM may include on-the-fly processing of data as it is collected, particle-based movie alignment, support for helical particles, improved 3D masking tools, more reliable resolution and quality indicators, as well as miscellaneous tools such as the determination of the detective quantum efficiency of electron detectors.

74Since cisTEM does not rely on third-party libraries, such as Python, MPI or CUDA, that usually have to be installed and compiled separately on the target system, ready-to-run binaries can be made available for download that are optimized for different architectures. Using the wxWidgets library also means that cisTEM can be compiled for different operating systems, including Linux, Windows and OSX. Using a configure script, different options for the fast Fourier transforms (FFTs) can be specified, including the FFTW (http://www.fftw.org) and Intel MKL (http://software.intel.com/ en-us/mkl) libraries. The downloadable binaries are statically linked against the MKL library as this exhibits superior speeds compared to the FFTW library on Intel-based CPUs.

75While the lack of support for GPUs simplifies the installation and execution of cisTEM, it can also be a limitation on workstations that are optimized for GPU-accelerated code. These workstations often do not have many CPU cores and, therefore, cisTEM will run significantly more slowly than Figure 7 continued applied to the half maps (Masked_FSC). A correction for potential masking artifacts (Chen et al., 2013) did not lead to adjustments of this curve. The red curved was calculated with a more generous spherical mask and adjusted for the solvent background within that mask (Part_FSC, Equation (19)). The resolution limit of 3.1 Å , which was not exceeded during refinement, as well as the FSC = 0.143 threshold are indicated by lines. DOI: https://doi.org/10.7554/eLife.35383.008

76The following source data is available for figure 7:

77Source data 1. Source data for the curves shown in Figure 7C. DOI: https://doi.org/10.7554/eLife.35383.009 Table 1. Benchmarking of cisTEM using a high-resolution dataset of b-galactosidase (Bartesaghi et al., 2015). code that can take advantage of the GPU hardware. Users who would like to run both CPU and GPU-optimized software may therefore have to invest in both types of hardware.

Development of cisTEM

78The entire cisTEM image processing package was written in C++ using the wxWidgets toolkit (http://wxwidgets.org) to implement the GUI, as well as the libtiff library (http://www.libtiff.org) to support the tiff image format, the SQLite library (https://sqlite.org) to implement the SQL database, and Intel's MKL library (http://software.intel.com/en-us/mkl) for the calculation of Fourier transforms and vector products. Optionally, cisTEM can also be linked against the FFTW library (http://www. fftw.org) to replace the MKL library. The code was written and edited using Eclipse (http://www. eclipse.org), and GitHub (http://github.com) was used for version control. This code is available in Source code 1.

Benchmark dataset

79The performance of cisTEM was benchmarked using a cryo-EM dataset of b-galactosidase (Bartesaghi et al., 2015), entry EMPIAR-10061 in the EMPIAR database (Iudin et al., 2016).

Image and data formats

80cisTEM stores all image data using the MRC format (Crowther et al., 1996). Additionally, particle parameters can be imported from, and exported to Frealign (Grigorieff, 2016) and Relion (Scheres, 2012).

Introduction

81The three-dimensional (3D) visualization of biological macromolecules and their assemblies by single-particle electron cryo-microscopy (cryo-EM) has become a prominent approach in the study of molecular mechanisms (Cheng et al., 2015;Subramaniam et al., 2016). Recent advances have been primarily due to the introduction of direct electron detectors (McMullan et al., 2016). With the improved data quality, there is increasing demand for advanced computational algorithms to extract signal from the noisy image data and reconstruct 3D density maps from them at the highest possible resolution. The promise of near-atomic resolution (3-4 Å ), where densities can be interpreted reliably with atomic models, has been realized by many software tools and suites (Frank et al., 1996;Hohn et al., 2007;Lyumkis et al., 2013;Punjani et al., 2017;Scheres, 2012;Tang et al., 2007;van Heel et al., 1996). Many of these tools implement a standard set of image processing steps that are now routinely performed in a single particle project. These typically include movie frame alignment, contrast transfer function (CTF) determination, particle picking, two-dimensional (2D) classification, 3D reconstruction, refinement and classification, and sharpening of the final reconstructions.

82We have written new software called cisTEM to implement a complete image processing pipeline for single-particle cryo-EM, including all these steps, accessible through an easy-to-use graphical user interface (GUI). Some of these steps implement newly-developed algorithms described below; others were adapted from previously published algorithms. cisTEM consists of a set of compiled programs and tools, as well as a wxWidgets-based GUI. The GUI launches programs and controls them by sending specific commands and receiving results via TCP/IP sockets. Each program can also be run manually, in which case it solicits user input on the command line. The design of cisTEM, therefore, allows users who would like to have more control over the different processing steps to design their own procedures outside the GUI. To adopt this new architecture, a number of previously existing Fortran-based programs were rewritten in C++, including Unblur and Summovie (Grant and Grigorieff, 2015b), mag_distortion_correct (Grant and Grigorieff, 2015a), CTFFIND4 , and Frealign (Lyumkis et al., 2013). Additionally, algorithms described previously were added for particle picking (Sigworth, 2004), 2D classification (Scheres et al., 2005) and ab-initio 3D reconstruction (Grigorieff, 2016), sometimes with modifications to optimize their performance. cisTEM is open-source and distributed under the Janelia Research Campus Software License (http://license.janelia.org/license/janelia_license_1_2.html).

83cisTEM currently does not support computation on graphical processing units (GPUs). Benchmarking of a hotspot identified in the global orientational search to determine particle alignment parameters showed that an NVIDIA K40 GPU performs approximately as well as 16 Xeon E5-2687W CPU cores after the code was carefully optimized for the respective hardware in both cases. Since CPU code is more easily maintained and more generally compatible with existing computer hardware, the potential benefit of GPU-adapted code is primarily the lower cost of a high-end GPU compared with a high-end CPU. We chose to focus on optimizing our code for CPUs.

Movie alignment and CTF determination

84Movie alignment and CTF determination are based on published algorithms previously implemented in Unblur and Summovie (Grant and Grigorieff, 2015b), and CTFFIND4 , respectively, and these are therefore only briefly described here. Unblur determines the translations of individual movie frames necessary to bring features (particles) visible in the frames into register. Each frame is aligned against a sum of all other frames that is iteratively updated until there is no further change in the translations. The trajectories along the x-and y-axes are smoothed using a Savitzky-Golay filter to reduce the possibility of spurious translations. Summovie uses the translations to calculate a final frame average with optional exposure filtering to take into account radiation damage of protein and maximize its signal in the final average. cisTEM combines the functionality of Unblur and Summovie into a single panel and exposes all relevant parameters to the user ( Figure 1). Both programs were originally written in Fortran and have been rewritten entirely in C++.

85CTFFIND4 fits a calculated two-dimensional CTF to Thon rings (Thon, 1966) visible in the power spectrum calculated from either images or movies. The fitted parameters include astigmatism and, optionally, phase shifts generated by phase plates. When computed from movies, the Thon rings are often more clearly visible compared to Thon rings calculated from images ( Figure 2; [Bartesaghi et al., 2014]). When selecting movies as inputs, the user can specify how many frames should be summed to calculate power spectra. An optimal value to amplify Thon rings would be to sum the number of frames that correspond to an exposure of about four electrons/Å 2 (McMullan et al., 2015).

86Since our original description of the CTFFFIND4 algorithm , several significant changes were introduced. (1) The initial exhaustive search over defocus values can now be performed using a one-dimensional version of the CTF (i.e. with only two parameters: defocus and phase shift) against a radial average of the amplitude spectrum. This search is much faster than the equivalent search over the 2D CTF parameters (i.e., four parameters: two for defocus, one for astigmatism angle and one for phase shift) and can be expected to perform well except in cases of very large astigmatism (Zhang, 2016). Once an initial estimate of the defocus parameter has been obtained, it is refined by a conjugate gradient minimizer against the 2D amplitude spectrum, as done previously. In cisTEM, the default behavior is to perform the initial search over the 1D amplitude spectrum, but the user can revert to previous behavior by setting a flag in the 'Expert Options' of the 'Find CTF' Action panel.

87(2) If the input micrograph's pixel size is smaller than 1.4 Å , the resampling and clipping of its 2D amplitude spectrum will be adjusted so as to give a final spectrum for fitting with an edge corresponding to 1/2.8 Å À1 , to avoid all of the Thon rings being located near the origin of the spectrum, where they can be very poorly sampled. (3) The computation of the quality of fit (CC fit -1 in ) is now computed over a moving window, similar to (Sheth et al., 2015), rather than at intervals delimited by nodes in the CTF. (4) Following background subtraction as described in Mindell and Grigorieff (2003), a radial, sine-edged mask is applied to the spectrum, and this masked version is used during search and refinement of defocus, astigmatism and phase shift parameters. The sine is 0.0 at the Fourier space origin, and 1.0 at a radius corresponding to 1/4 Å À1 , and serves to emphasize high-resolution Thon rings, which are less susceptible to artefacts caused by imperfect background subtraction. For all outputs from the program (diagnostic image of the amplitude spectrum, 1D plots, etc.), the background-subtracted, but non-masked, version of the amplitude spectrum is used. (5) Users receive a warning if the box size of the amplitude spectrum and the estimated defocus parameters suggest that significant CTF aliasing occurred (Penczek et al., 2014).

Particle picking

88Putative particles are found by matching to a soft-edged disk template, which is related to a convolution with Gaussians ) but uses additional statistics based on an algorithm originally described by Sigworth (2004). The use of a soft-edged disk template as opposed to structured templates has two main advantages. It greatly speeds up calculation, enabling picking in 'real time', and alleviates the problem of templates biasing the result of all subsequent processing towards those templates (Henderson, 2013;Subramaniam, 2013;van Heel, 2013). Any bias that is introduced will be towards a featureless 'blob' and will likely be obvious if present.

89Rather than fully describing the original algorithm by (Sigworth, 2004), we will emphasize here where we deviated from it. The user must specify three parameters: the radius of the template disk, the maximum radius of the particle, which sets the minimum distance between picks, and the detection threshold value, given as a number of standard deviations of the (Gaussian) distribution of scores expected if no particles were present in the input micrograph. Values of 1.0 to 6.0 for this threshold generally give acceptable results. All other parameters mentioned below can usually remain set to their default values. All Action panels provide background information on the operation they control, as well as a section with detailed explanations of all user-accessible parameters. All Action panels also have an Expert Options section that exposes additional parameters. DOI: https://doi.org/10. 7554/eLife.35383.002 Prior to matched filtering, micrographs are resampled by Fourier cropping to a pixel size of 15 Å (the user can override this by changing the 'Highest resolution used in picking' value from its default 30 Å ), and then filtered with a high-pass cosine-edged aperture to remove very low-frequency density ramps caused by variations in ice thickness or uneven illumination.

90The background noise spectrum of the micrograph is estimated by computing the average rotational power spectrum of 50 areas devoid of particles, and is then used to 'whiten' the background (shot +solvent) noise of the micrograph. Normalization, including CTF effects, and matched filtering are then performed as described (Sigworth, 2004), except using a single reference image and no principal components' decomposition. When particles are very densely packed on micrographs, this approach can significantly over-estimate the background noise power so that users may find they have to use lower thresholds for picking. It might also be expected that under those circumstances, micrographs with much lower particle density will suffer from a higher rate of false-positive picks.

91One difficulty in estimating the background noise spectrum of the micrograph is to locate areas devoid of particles without a priori knowledge of their locations. Our algorithm first computes a map of the local variance and local mean in the micrograph (computed over the area defined by the maximum radius given by the user [Roseman, 2004;Van Heel, 1982]) and the distribution of values of these mean and variance maps. The average radial power spectrum of the 50 areas of the micrograph with the lowest local variance is then used as an estimate of the background noise spectrum. Optionally, the user can set a different number of areas to be used for this estimate (for example if the density of particles is very high or very low) or use areas with local variances closest to the mode of the distribution of variances, which may also be expected to be devoid of particles.

92Matched-filter methods are susceptible to picking high-contrast features such as contaminating ice crystals or carbon films. (Sigworth, 2004) suggests subtracting matched references from the extracted boxes and examining the remainder in order to discriminate between real particles and false positives. In the interest of performance, we decided instead to pick using a single artificial reference (disk) and to forgo such subtraction approaches. To avoid picking these kinds of artifacts, the (Bartesaghi et al., 2015) used to benchmark cisTEM. The left pattern was calculated from the average of non-exposure filtered and aligned frames while the right pattern was calculated using the original movie with 3-frame sub-averages. The pattern calculated using the movie shows significantly stronger rings compared to the other pattern. DOI: https://doi.org/10.7554/eLife.35383.003 user can choose to ignore areas with abnormal local variance or local mean. We find that ignoring high-variance areas often helps avoid edges of problematic objects, e.g. ice crystals or carbon foils, and that avoiding high-and low-mean areas helps avoid picking from areas within them, e.g. the carbon foil itself or within an ice crystal ( Figure 3). The thresholds used are set to Mo þ 2 FWHM for the variance and Mo AE 2 FWHM for the mean, where Mo is the mode (i.e. the most-commonly-occurring value) and FWHM the full width at half-maximum of the distribution of the relevant statistic. For micrographs with additional phase plate phase shifts between 0.1 and 0.9 p, where much higher contrast is expected, the variance threshold is increased to Mo þ 8 FWHM. We have found that in favorable cases many erroneous picks can be avoided. Remaining false-positive picks are removed later during 2D classification.

93Because of our emphasis on performance, our algorithm can be run nearly instantaneously on a typical~4K image, using a single processor. In the Action panel, the user is presented with an 'Auto preview' mode to enable interactive adjustment of the picking parameters ( Figure 3). In this mode, the micrograph is displayed with optional and adjustable low-pass and high-pass filters, and the results of picking using the currently selected parameters are overlaid on top. Changing one or more of the parameters leads to a fast re-picking of the displayed micrograph, so that the parameters can be optimized in real-time. Once the three main parameters have been adjusted appropriately, the full complement of input micrographs can be picked, usually in a few seconds or minutes.

94A possible disadvantage of using a single disk template exists when the particles to be picked are non-uniform in size or shape (e.g. in the case of an elongated particle). In this case, it may be expected that a single template would have difficulty in picking all the different types and views of particles present, and that in this case using a number of different templates would lead to a more accurate picking. In practice, we found that with careful optimization of the parameters, elongated particles and particles with size variation (Figure 3) were picked adequately.

95The underlying implementation of the algorithm supports multiple references as well as reference rotation. These features may be exposed to the graphical user interface in future versions, for example enabling the use of 2D class averages as picking templates (Scheres, 2015).

2D classification

962D classification is a relatively quick and robust way to assess the quality of a single-particle dataset. cisTEM implements a maximum likelihood algorithm (Scheres et al., 2005) and generates fully CTFcorrected class averages that typically display clear high-resolution detail, such as secondary structure. Integration of the likelihood function is done by evaluating the function at defined angular steps da that are calculated according to

97where R is the resolution limit of the data and D is the diameter of the particle (twice the mask radius that is applied to the iteratively-refined class averages). cisTEM runs a user-defined number of iterations n defaulting to 20. To speed up convergence, the resolution limit is adjusted as a function of iteration cycle l (0 l <n):

98where R start and R finish are user-defined resolution limits at the first and last iteration, defaulting to 40 Å and 8 Å , respectively. The user also sets K, the number of classes to calculate. Depending on this number and the number of particles N in the dataset, only a percentage p of the particles are included in the calculation. These particles are randomly reselected for each iteration and p is typically small, for example 0.1, in the first 10 iterations (p 0À9 ), then increases to 0.3 for iteration 10 to 14 (p 10À14 ) and finishes with five iterations including all data (p 15À19 ):

99For example, for a dataset containing N ¼ 100; 000 particles, p 0À9 ¼ 0:15, that is, 15% of the data will be used to obtain K ¼ 50 classes. Apart from speeding up the calculation, the stepwise increase of the resolution limit and the random selection of subsets of the data also reduce the chance of overfitting (see also the calculation of ab-initio 3D reconstructions and 3D refinement below) and, therefore, increase the convergence radius of the 2D classification algorithm.

100For the calculation of the likelihood function, the particle images X i are noise-whitened by dividing their Fourier transforms F X i f g by the square root of the radially average noise power spectrum, NPS:

101where g is the 2D reciprocal space coordinate and g ¼ g j j its magnitude. The noise power spectrum is calculated from the boxed particle images using the area outside the circular mask set by the user according to the expected particle size. To increase accuracy, it is further averaged across 2000 randomly selected particles. The background (density outside the mask) is further normalized by adding a constant to each particle that yields a background average of zero.

102Finally, at the beginning of each iteration, noise features in the class averages A i are suppressed by resetting negative values below a threshold t i to the threshold:

103where j runs over all pixels in average A i .

3D refinement (FrealignX)

104The refinement of 3D reconstructions in cisTEM uses a version of Frealign (Lyumkis et al., 2013) that was specifically designed to work with cisTEM. Most of Frealign's control parameters are exposed to the user in the 'Manual Refine' Action panel ( Figure 4). The 'Auto Refine' and 'Ab-Initio' panels also use Frealign but manage many of the parameters automatically (see below). Frealign's algorithm was described previously (Grigorieff, 2007;Lyumkis et al., 2013) and this section will mostly cover important differences, including a new objective function used in the refinement, different particle weighting used in reconstructions, optional likelihood-based blurring, as well as new masking options.

Matched filter

105To make Frealign compatible with cisTEM's GUI, the code was completely rewritten in C++, and it will be referred to here as Frealign v10, or FrealignX. The new version makes use of a matched filter (McDonough and Whalen, 1995) to maximize the signal in cross correlation maps calculated between particle images and reference projections. This requires whitening of the noise present in the images and resolution-dependent scaling of the reference projections to match the signal in the noise-whitened images. Both can be achieved if the spectral signal-to-noise ratio (SSNR) of the data is known. As part of a 3D reconstruction, Frealign calculates the resolution-dependent PSSNR, the radially averaged SSNR present in the particle images before they are affected by the CTF Figure 4. Manual refinement panel with Expert Options exposed. Most of the parameters needed to run FrealignX can be accessed on this panel. The panel also allows application of a 3D mask, which can be imported as a Volume Asset. DOI: https://doi.org/10.7554/eLife.35383.005 (Sindelar and Grigorieff, 2012). Using PSSNR and the CTF determined for a particle, the SSNR in the particle image can be calculated as

106(as before, g is the 2D reciprocal space coordinate and g ¼ g j j). Here, SNR is defined as the ratio of the variance of the signal and the noise. The Fourier transform F X i n o of the noise-whitened particle image X i can then be calculated as

107where F X i f g is the Fourier transform of the original image X i , Á j j is the absolute value, and F X i f g j j 2 r is the radially averaged spectrum of the squared 2D Fourier transform amplitudes of image X i . To implement Equation (7), a particle image is first divided by its amplitude spectrum, which includes power from both signal and noise, and then multiplied by a term that amplifies the image amplitudes according to the signal strength in the image. The reference projection A i can be matched by calculating

108Equation (8) scales the variance of the signal in the reference to be proportional to the measured signal-to-noise ratio in the noise-whitened images. The main term in the objective function O f ð Þ maximized in FrealignX is therefore given by the cross-correlation function

109where f is a set of parameters describing the particle view, x,y position, magnification and defocus, Re Á ð Þ is the real part of a complex number, Á k k is the Euclidean norm, i.e. the square root of the sum of the squared pixel values, and F R1;R3 Á f g à is the conjugate complex value of the Fourier transform F R1;R3 Á f g. The subscripts R1 and R3 specify the low-and high-resolution limits of the Fourier transforms included in the calculation of Equation (9a), as specified by the user. To reduce noise overfitting, the user has the option to specify also a resolution range in which the absolute value of the cross terms in the numerator of Equation (9a) are used (Grigorieff, 2000;Stewart and Grigorieff, 2004), instead of the signed values (option 'Signed CC Resolution Limit' under 'Expert Options' in the 'Manual Refine' Action panel). In this case

110where R2 is specified by the 'Signed CC Resolution Limit.' The objective function also includes a term R fjQ ð Þ to restrain alignment parameters (Chen et al., 2009;Lyumkis et al., 2013;Sigworth, 2004), which currently only includes the x,y positions:

111where s is the standard deviation of the noise in the particle image and Q represents a set of model parameters including the average particle positions in a dataset, x À and y À , and the standard deviations of the x,y positions from the average values, s x and s y , and M is the number of pixels in the mask applied to the particle before alignment. The complete objective function is therefore

112The maximized values determined in a refinement are converted to particle scores by multiplication with 100.

CTF refinement

113FrealignX can refine the defocus assigned to each particle. Given typical imaging conditions with current instrumentation (300 kV, direct electron detector), this may be useful when particles have a size of about 400 kDa or larger. Depending on the quality of the sample and images, these particles may generate sufficient signal to yield per-particle defocus values that are more accurate than the average defocus values determined for whole micrographs by CTFFIND4 (see above). Refinement is achieved by a simple one-dimensional grid search of a defocus offset applied to both defocus values determined in the 2D CTF fit obtained by CTFFIND4. FrealignX applies this offset to the starting values in a refinement, typically determined by CTFFIND4, and evaluates the objective function, Equation (11), for each offset. The offset yielding the maximum is then used to assign refined defocus values. In a typical refinement, the defocus offset is searched in steps of 50 Å , in a range of ±500 Å . In the case of b-galactosidase (see below), a single round of defocus refinement changed the defocus on average by 60 Å ; the RMS change was 80 Å . For this refinement, the resolution for the signed cross terms equaled the overall refinement resolution limit (3.1 Å ), i.e. no unsigned cross terms were used. The refinement produced a marginal improvement of 0.05 Å in the Fourier Shell Correlation (FSC) threshold of 0.143, suggesting that the defocus values determined by CTFFIND4 were already close to optimal. In a different dataset of rotavirus double-layer particles, a single round of defocus refinement changed the defocus on average by 160 Å ; the RMS change was 220 Å . In this case, the refinement increased the resolution from~3.0 Å to~2.8 Å .

Masking

114FrealignX has a 3D masking function to help in the refinement of structures that contain significant disordered regions, such as micelles in detergent-solubilized membrane proteins. To apply a 3D mask, the user supplies a 3D volume that contains positive and negative values. cisTEM will binarize this volume by zeroing all voxels with values less than or equal to zero, and setting all other voxels to 1, indicating the region of the volume that is inside the mask. A soft cosine-shaped falloff of specified width (e.g. 10 Å ) is then applied to soften the edge of the masked region and avoid sharp edges when the mask is applied to a 3D reconstruction. The region of the reconstruction outside the mask can be set to zero (simple multiplication of the mask volume), or to a low-pass filtered version of the original density, optionally downweighted by multiplication by a scaling factor set by the user. At the edge of the mask, the low-pass filtered density is blended with the unfiltered density inside the mask to produce a smooth transition. Figure 5 shows the result of masking the reconstruction of an ABC transporter associated with antigen processing (TAP, [Oldham et al., 2016]). The mask was designed to contain only density corresponding to protein and the outside density was low-pass filtered at 30 Å resolution and kept with a weight of 100% in the final masked reconstruction. The combination of masking and low-pass filtering in this case keeps a low-pass filtered version of the density outside the mask in the reconstruction, including the detergent micelle. Detergent micelles can be a source of noise in the particle images because the density represents disordered material. However, at low, 20 to 30 Å resolution, micelles generate features in the images that can help in the alignment of the particles. In the case of TAP, this masking prevented noise overfitting in the detergent micelle and helped obtain a reconstruction at 4 Å resolution (Oldham et al., 2016).

3D reconstruction

115In Frealign, a 3D reconstruction V k of class average k and containing N images is calculated as (Lyumkis et al., 2013;Sindelar and Grigorieff, 2012)

116where q ik is the probability of particle i belonging to class k, s i is the standard deviation of the noise Figure 5 continued on next page in particle image i, f i are its alignment parameters, w ik the score-based weights (Equation (14), see below), CTF i the CTF of the particle image, R f i ; Á ð Þ the reconstruction operator merging data into a 3D volume according to alignment parameters f i , PSSNR the radially averaged particle SSNR derived from the FSC between half-maps (Sindelar and Grigorieff, 2012), X i the noise-whitened image i, and F À1 Á f g the inverse Fourier transform. For the calculation of the 3D reconstructions, as well as 3D classification (see below) the particle images are not whitened according to Equation (7). Instead, they are whitened using the radially-and particle-averaged power spectrum of the background around the particles:

117where B X i ð Þ is a masked version of image X i with the area inside a circular mask centered on the particle replaced with the average values at the edge of the mask, and scaled variance to produce an average pixel variance of 1 in the whitened image X i . Using the procedure in Equation (13) has the advantage that whitening does not depend on the knowledge of the SSNR of the data, and reconstructions can therefore be calculated even when the SSNR is not known.

Score-based weighting

118In previous versions of Frealign, resolution-dependent weighting was applied to the particle images during reconstruction (the Frealign parameter was called 'PBC', (Grigorieff, 2007)). The weighting function took the form of a B-factor dependent exponential that attenuates the image data at higher resolution. FrealignX still uses B-factor weighting but the weighting function is now derived from the particle scores (see above) as

119BSC2 converts the difference between a particle score and score2, the score average, into a B-factor. Setting BSC2 to zero will turn off score-based particle weighting. Scores typically vary by about 10, and values for BSC2 that produce reasonable discrimination between high-scoring and low-scoring particles are between 2 and 10 Å 2 , resulting in B-factor differences between particles of 20 to 100 Å 2 .

3D classification

120FrealignX uses a maximum-likelihood approach for 3D classification (Lyumkis et al., 2013). Assuming that all images were noise-whitened according to Equation (13), which scales the variance of each image such that the average standard deviation of the noise in a pixel is 1, the probability density function (PDF) of observing image X i , given alignment parameters f i and reconstruction V k , is calculated as (Lyumkis et al., 2013)

121As before, f ik are the alignment parameters (usually just Euler angles and x,y shifts) determined for image i with respect to class average k, } is the projection operator producing an aligned 2D projection of reconstruction V k according to parameters f ik ,

122is the sum of the squared pixel value differences between whitened image X i and the reference projection inside a circular mask defining the area of the particle with user-defined diameter, M is the number of Figure 5 continued regions outside the mask are low-pass filtered at 30 Å resolution to remove high-resolution noise from the disordered detergent micelle, but keeping its low-resolution signal to help particle alignment. DOI: https://doi.org/10.7554/eLife.35383.006 pixels inside this mask, and g f ik jQ k ð Þ is a hierarchical prior describing the probability of observing alignment parameters f ik given model parameters Q k (see Equation 10). Equation (15) does not include marginalization over alignment parameters. Marginalization could be added to improve classification when particle alignments suffer from significant errors. However, this is currently not implemented in cisTEM. Given the joint probability, Equation (15), determined in a refinement, the probability q ik of particle i belonging to class k can be updated as (Lyumkis et al., 2013)

123where the summation in the denominator is taken over all classes and the average probabilities p k Figure 6. 3D classification of a dataset of F 1 F O -ATPase, revealing different conformational states (reproduced from Figure 6A and B in Zhou et al., 2015). for a particle to belong to class k are given by the average values of q ik determined in a prior iteration, calculated for the entire dataset of N particles:

124An example of 3D classification is shown in Figure 6 for F 1 F O -ATPase, revealing different conformational states of the g subunit (Zhou et al., 2015).

Focused classification

1253D classification can be improved by focusing on conformationally-or compositionally-variable regions of the map. To achieve this, a mask is applied to the particle images and reference projections, the area of which is defined as the projection of a sphere with user-specified center (within the 3D reconstruction) and radius. This 2D mask is therefore defined independently for each particle, as a function of its orientation. When using focused classification, M in Equation (15) is adjusted to the number of pixels inside the projected mask and the sum of the squared pixel value differences in Equation (15) is limited to the area of the 2D mask. By applying the same mask to image and reference, only variability inside the masked region is used for 3D classification. Other regions of the map are ignored, leading to a 'focusing' on the region of interest. The focused mask also excludes noise contained in the particle images outside the mask and therefore improves classification results that often depend on detecting small differences between particles and references. A typical application of a focused mask is in the classification of ribosome complexes that may exhibit localized conformational and/or compositional variability, for example the variable conformations of an IRES (Abeyrathne et al., 2016) or different states of tRNA accommodation (Loveland et al., 2017).

Likelihood-based blurring

126In some cases, the convergence radius of refinement can be improved by blurring the reconstruction according to a likelihood function. This procedure is similar to the maximization step in a maximum likelihood approach (Scheres, 2012). The likelihood-blurred reconstruction is given by

127where, in the case of FrealignX, f axy only includes the x,y particle positions and in-plane rotation angle a, which are a subset of the alignment parameters f i , and V nÀ1 k is the reconstruction from an earlier refinement iteration. As before, G X i jf i ; V nÀ1 k À Á is the probability of observing image i, given alignment parameters f i and reconstruction V nÀ1 k . Integration over these three parameters can be efficiently implemented and, therefore, does not produce a significant additional computational burden.

Resolution assessment

128The resolution of reconstructions generated by FrealignX is assessed using the FSC criterion (Harauz and van Heel, 1986) using the 0.143 threshold (Rosenthal and Henderson, 2003). FSC curves in cisTEM are calculated using two reconstructions ('half-maps') calculated either from the even-numbered and odd-numbered particles, or by dividing the dataset into 100 equal subsets and using the even-and odd-numbered subsets to calculate the two reconstructions (in the cisTEM GUI, the latter is always used). The latter method has the advantage that accidental duplication of particles in a stack is less likely to affect the FSC calculation. All particles are refined against a single reference and, therefore, the calculated FSC values may be biased towards higher values (Grigorieff, 2000;Stewart and Grigorieff, 2004). This bias extends slightly beyond the resolution limit imposed during refinement, by approximately 2=D mask , where D mask is the mask radius used to mask the reconstructions (see above). During auto-refinement (see below), the resolution limit imposed during refinement is carefully adjusted to stay well below the estimated resolution of the reconstruction and the resolution estimate is therefore unbiased (Scheres and Chen, 2012). However, users have full control over all parameters during manual refinement and will have to make sure that they do not bias the resolution estimate by choosing a resolution limit that is close to, or higher than, the estimated resolution of the final reconstruction. Calculated FSC curves are smoothed using a Savitzky-Golay cubic polynomial that reduces the noise often affecting FSC curves at the high-resolution end.

129The FSC calculated between two density maps is dependent on the amount of solvent included inside the mask applied to the maps. A larger mask that includes more solvent background will yield lower FSC values than a tighter mask. To obtain an accurate resolution estimate in the region of the particle density, one possibility is to apply a tight mask that closely follows the boundary of the particle. This approach bears the risk of generating artifacts because the particle boundary is not always well defined, especially when the particle includes disordered domains that generate weak density in the reconstruction. The approach in Frealign avoids tight masking and instead calculates an FSC curve using generously masked density maps, corrected for the solvent content inside the mask (Sindelar and Grigorieff, 2012). The corrected FSC curve is referred to as Part FSC and is calculated from the uncorrected FSC uncor as (Oldham et al., 2016)

130where f is the ratio of mask volume to estimated particle volume. The particle volume can be estimated from its molecular mass M w as 3 0:81Da M w (Matthews, 1968). FSC curves obtained with the generous masking and subsequent solvent correction yield resolution estimates that are very close to those obtained with tight masking ( Figure 7C). Equation (19) assumes that both maps have similar SSNR values, as is normally the case for the two reconstructions calculated from two halves of the dataset, indicated by the subscript half À maps. If one of the maps does not contain noise from solvent background, for example when calculating the FSC between a reconstruction and a map derived from an atomic model, the solvent-corrected FSC is given as

Speed optimization

131FrealignX has been optimized for execution on multiple CPU cores. Apart from using optimized library functions for FFT calculation and vector multiplication (Intel Math Kernel Library), the processing speed is also increased by on-the-fly cropping in real and reciprocal space of particle images and 3D reference maps. Real-space cropping reduces the interpolation accuracy in reciprocal space and is therefore limited to global parameter searches that do not require the highest accuracy in the calculation of search projections. Reciprocal-space cropping is used whenever a resolution limit is specified by the user or in an automated refinement (ab-initio 3D reconstruction and auto-refinement).

132For the calculation of in-plane rotated references, reciprocal-space padding is used to increase the image size four-fold, allowing fast nearest-neighbor resampling in real space with sufficient accuracy to produce rotated images with high fidelity.

Ab-initio 3D reconstruction

133Ab-initio reconstruction offers a convenient way to proceed from single particle images to a 3D structure when a suitable reference is not available to initialize 3D reconstruction and refinement. Different ab-initio methods have been described (Hohn et al., 2007;Punjani et al., 2017;Reboul et al., 2018) and cisTEM's implementation follows a strategy published originally by (Grigorieff, 2016). It is based on the premise that iterative refinement of a reconstruction initialized with random angular parameters is likely to converge on the correct structure if overfitting is avoided and the refinement proceeds in small steps to reduce the chance of premature convergence onto an incorrect structure. The procedure is implemented as part of cisTEM's GUI and uses FrealignX to perform the refinements and reconstructions. After initialization with random angles, cisTEM performs a user-specified number of global alignment parameter searches, recalculating the reconstruction after each search and applying an automatic masking procedure to it before the next global search. Similar to 2D classification (see above), only a randomly selected subset of the data is used in each iteration and the resolution limit applied during the search is increased with every iteration. The number of iterations n defaults to 40, the starting and final resolution limits R start and R finish default to 20 Å and 8 Å , respectively, and the starting and final percentage of included particles in the reconstruction, p start and p finish default to 2500K=N and 10; 000K=N, respectively (results larger than one are reset to 1), with K the number of 3D classes to be calculated as specified by the user, and N the number of particles in the dataset. If symmetry is applied, N is replaced by NO sym where O sym is the number of asymmetric units present in one particle. The resolution limit is then updated in each iteration l as in Equation (2), and the percentage is updated as

134again resetting results larger than 1 to 1. cisTEM actually performs a global search for a percentage 3p of the particle stack, that is, three times as many particles as are included in the reconstructions for each iteration. The particles included in the reconstructions are then chosen to be those with the highest scores as calculated by FrealignX. The global alignment parameters are performed using the 'general' FrealignX procedure with the following changes. Firstly, the PSSNR is not directly estimated from the FSC calculated at each round. Instead, for the first three iterations, a default PSSNR is calculated based on the molecular weight. From the fourth iteration onwards, the PSSNR is calculated from the FSC, however if the calculated PSSNR is higher than the default PSSNR, the default PSSNR is taken instead. This is done in order to avoid some of the overfitting that will occur during refinement. Secondly, during a normal global search the top h (where h defaults to 20) results of the grid search are locally refined, and the best locally refined result is taken. In the ab-initio procedure, however, the result of the global search for a given particle image is taken randomly from all results that have a score which lies in the top 15% of the difference between the worst score and the best score.

135During the reconstruction steps, the calculated s for each particle is reset to 1 prior to 3D reconstruction and score weighting is disabled. This is done because the s and score values are not meaningful until an approximately correct solution is obtained.

136The reconstructions are automatically masked before each new refinement iteration to suppress noise features that could otherwise be amplified in subsequent iterations. The same masking procedure is also applied during auto-refinement (see below). It starts by calculating the density average À of the reconstruction and resetting all voxel values below À to À . This thresholded reconstruction is then low-pass filtered at 50 Å resolution and turned into a binary mask by setting densities equal or below a given threshold t to zero and all others to 1. The threshold is calculated as

137where À filtered is the density average of the low-pass filtered map and À max 500 is the average of the 500 highest values in the filtered map. The largest contiguous volume in this binarized map is then identified and used as a mask for the original thresholded reconstruction, such that all voxels outside of this mask will be set to À . Finally, a spherical mask, centered in the reconstruction box, is applied by resetting all densities outside the mask to zero.

138The user has the option to repeat the ab-initio procedure multiple times using the result from the previous run as the starting map in each new run, to increase the convergence radius if necessary. In the case of symmetric particles, the default behavior is to perform the first 2/3 rds of the iterations without applying symmetry. The non-symmetrized map is then aligned to the expected symmetry axes and the final 1/3 rd of the iterations are carried out with the symmetry applied. This default behavior can be changed by the user such that symmetry is always applied, or is never applied. Alignment of the model to the symmetry axes is achieved using the following process. A brute force grid search over rotations around the x, y and z axes is set up. At each position on the grid the 3D map is rotated using the current x, y and z parameters, and then its projection along Euler angle (0, 0, 0) is calculated. All of the symmetry-related projections are then also calculated, and for each one a cross-correlation map is calculated using the original projection as a reference, and the peak within this map is found. The sum of all peaks from all symmetry-related directions is taken and the x,y,z rotation that most closely aligns the original 3D map along the symmetry axes should provide the highest peak sum. To improve robustness, this process is repeated for two additional angles (À45,-45, À45 and 15, 70,-15) that were chosen with the aim of including different-looking areas when the map to be aligned is unusual in some way. The x,y,z rotation that results in the largest sum of all peaks, over all three angles, is taken as the final rotation result. Shifts for this rotation are then calculated based on the found 2D x,y shifts between the initial and symmetry-related projections, with the z shift being set to 0 for C symmetries. The symmetry alignment is also included as a command-line program, which can be used to align a volume to the symmetry axis when the ab-initio is carried out in C1 only, or when using a reference obtained by some other means.

Automatic refinement

139Like ab-initio 3D reconstruction, auto-refinement makes use of randomly selected subsets of the data and of an increasing resolution limit as refinement proceeds. However, unlike the ab-initio procedure, the percentage of particles p l and the resolution limit R l used in iteration l depend on the resolution of the reconstructions estimated in iteration l À 1. When the estimated resolution improved in the previous cycle,

140where K is the number of 3D classes to be calculated and N the number of particles in the dataset. As before, if the particle has symmetry, N is replaced by NO sym where O sym is the number of asymmetric units present in one particle. If the calculated p l exceeds 1, it is reset to 1. The resolution limit is estimated as

141where FSC 0:5 is the point at which the FSC, unadjusted for the solvent within the mask (see above) crosses the 0.5 threshold and D mask is the user-specified diameter of the spherical mask applied to the 3D reference at the beginning of each iteration, and to the half-maps used to calculate the FSC. The term 2=D mask accounts for correlations between the two half-maps due to the masking (see above). When the resolution did not improve in the previous iteration,

142(reset to one if resulting in a value larger than 1). At least five refinement iterations are run and refinement stops when p l reaches 1 (all particles are included) and there was no improvement in the estimated resolution for the last three iterations. If multiple classes are refined, the resolution limit in Equation (25) is set independently for each class, however the highest resolution used for classification is fixed at 8 Å . At least nine iterations are run and refinement stops when p l reaches 1, the average change in the particle occupancy in the last cycle was 1% or less, and there was no improvement in the estimated resolution for the last three iterations.

143In a similar manner to the ab-initio procedure, s values for each particle are set to one and score weighting is turned off. This is done until the refinement resolution is better than 7 Å , at which point it is assumed the model is of a reasonable quality.

Map sharpening

144Most single-particle reconstructions require some degree of sharpening that is usually achieved by applying a negative B-factor to the map. cisTEM includes a map sharpening tool that allows the application of an arbitrary B-factor. Additionally, maps can be sharpened by whitening the power spectrum of the reconstruction beyond a user-specified resolution (the default is 8 Å ). The whitening amplifies terms at higher resolution similar to a negative B-factor but avoids the over-amplification at the high-resolution end of the spectrum that sometimes occurs with the B-factor method due to its exponential behavior. Whitening is applied after masking of the map, either with a hollow spherical mask of defined inner and outer radius, or with a user-defined mask supplied as a separate 3D volume. The masking removes background noise and makes the whitening of the particle density more accurate. Both methods can be combined in cisTEM, together with a resolution limit imposed on the final reconstruction. The whitened and B-factor-sharpened map can optionally be filtered with a figure-of-merit curve calculated using the FSC determined for the reconstruction (Rosenthal and Henderson, 2003;Sindelar and Grigorieff, 2012).

GUI design and workflow

145cisTEM's GUI required extensive development because it is an integral part of the processing pipeline. GUIs have become more commonplace in cryo-EM software tools to make them more accessible to users (Conesa Mingo et al., 2018;Desfosses et al., 2014;Moriya et al., 2017;Punjani et al., 2017;Scheres, 2012;Tang et al., 2007). Many of the interfaces are designed as socalled wrappers of command-line driven tools, i.e. they take user input and translate it into a command line that launches the tool. Feedback to the user takes place by checking output files, which are also the main repository of processing results, such as movie frame alignments, image defocus measurements and particle alignment parameters. As processing strategies become more complex and the number of users new to cryo-EM grows, the demands on the GUI increase in the quest for obtaining the best possible results. Useful GUI functions include guided user input (so-called wizards) that adjust to specific situations, graphical presentation of relevant results, user interaction with running processes to allow early intervention and make adjustments, tools to manipulate data (e.g. masking), implementation of higher-level procedures that combine more primitive processing steps to achieve specific goals, and a global searchable database that keeps track of all processing steps and result. While some of these functions can be or have been implemented in wrapper GUIs, the lack of control of these GUIs over the data and processes makes a reliable implementation more difficult. For example, keeping track of results from multiple processing steps, some of them perhaps repeated with different parameters or run many times during an iterative refinement, can become challenging if each step produces a separate results file. Communicating with running processes via files can be slow and is sometimes unreliable due to file system caching. Communication via files may complicate the implementation of higher-level procedures, which rely on the parsing of results from the more primitive processing steps.

146The cisTEM GUI is more than a wrapper as it implements some of the new algorithms in the processing pipeline directly, adjusting the input of running jobs as the refinement proceeds. It enables more complex data processing strategies by tracking all results in a single searchable database. All processing steps are run and controlled by the GUI, which communicates with master and slave processes through TCP/IP. cisTEM uses an SQL database, similar to Appion (Lander et al., 2009), to store all results (except image files), offers input functions that guide the user or set appropriate defaults, and implements more complex procedures to automate processing where possible. cis-TEM's design is flexible to allow execution in many different environments, including single workstations, multiple networked workstations and large computer clusters.

147User input and the display of results is organized into different panels that make up cisTEM's GUI, each panel dedicated to specific processing steps (for examples, see Figures 1, 3 and 4). This design guides users through a standard workflow that most single particle projects follow: movie alignment, CTF determination, particle picking, 2D classification, 3D reconstruction, refinement and classification, and sharpening of the final reconstructions. Three types of panels exist, dealing with Assets, Actions and Results. Assets are mostly data that can be used in processing steps called Actions. They include Movies, Images, Particle Positions and Volumes. One type of Asset, a Refinement Package, defines the data and parameters necessary to carry out refinement of a 3D structure (or a set of structures if 3D classification is done), it contains a particle stack, as well as information about the sample (e.g. particle size and molecular weight) along with parameters for each particle (e.g. orientations and defocus values). Actions comprise the above mentioned workflow steps, with additional options for ab-initio 3D reconstruction, as well as automatic and manual 3D refinement to enable users to obtain the best possible results from their data. The results of most of these Actions are stored in the database and can be viewed in the related Results panels, which display relevant data necessary to evaluate the success of each processing step. The option to sort and select results by a number of different metrics is available in the movie alignment and CTF estimation Results panels. For example images can be sorted/selected based on the CTF fit resolution . Movie alignment, 3D refinement and reconstruction also produce new Image and Volume Assets, respectively. Importing or generating new Assets is accomplished by wizards that solicit the necessary user input and perform checks were possible to avoid nonsensical input. In the more complex case of creating a new Refinement Package Asset, the wizard allows the specification of input data, for example based on particle picking results or the selection of 2D and 3D classes. Once an Action has been launched, results are displayed as soon as they become available, together with an overall progress bar, giving users an estimate of how long a processing step will take and of whether the results are as expected. If desired, an Action can be aborted and restarted with a different set of parameters, or the Action can be run again after regular termination to test different parameters. In the latter case, all prior results remain accessible and users can specify those to be used for the next step in the workflow. This provides users with the flexibility to pick and choose the best results in cases where different parts of a dataset require different settings to yield optimal results. Parallelization cisTEM uses a home-grown scheme to accelerate processing in parallel environments. Image processing of single-particle data is an embarrassingly parallel problem, i.e. the parallelization of most tasks can be achieved simply by dividing the data to be processed into smaller chunks that are each processed by a separate program thread, without the need for inter-process communication. Only certain steps require merging of data, such as the calculation of a 3D reconstruction from the entire dataset. cisTEM parallelizes processing steps by running multiple instances of the same program, each dealing with a subset of the data, then directly communicating with the launched processes over TCP/IP sockets. This enables the cisTEM GUI to distribute jobs and receive results in real time. Communication is directed through a 'manager' process, which enables jobs to be run on a cluster, while the GUI itself can run on a local workstation.

148How each copy of the program is run is specified by the user by setting up a 'Run Profile'. This profile is a user defined command, or script that will be run to launch the job, and is designed to be flexible to enable the user to set up parallelization in many different environments. For example, users can design profiles to run on multiple machines via SSH, or to submit to a cluster (e.g. using qsub) etc., or even merge the two in a single profile. One disadvantage of this system is that it may be difficult to create profiles for clusters that require many jobs to be submitted using one command.

149Another advantage of using a home-grown scheme over existing schemes (e.g. MPI) occurs when jobs are run on a multi-node computing cluster. In this case, jobs will complete even if the full number of requested processors is not available. For example, if a user requests 300 CPUs for a processing step but only 100 are available, cisTEM launches 300 jobs of which 200 will remain in the job scheduler's queue. Data processing starts immediately with the 100 jobs that are allowed to run and will complete even if the remaining jobs never run. In such a scenario, an MPI-based job could only run when 300 CPUs become available, potentially delaying execution. In the few cases were a step requires merging of an entire dataset, for example in a 3D reconstruction, parallelization is achieved by calculating multiple intermediate 3D reconstructions for subsets of the data, dumping the intermediate reconstructions to disk and merging them after all reconstruction jobs have finished. It can therefore help to designate a fast disk as a scratch disk to allow rapid dumping and reading of the relatively large files (200 MB -5 GB).

Benchmarking with b-galactosidase

150A high-resolution dataset of b-galactosidase (Bartesaghi et al., 2015) was used to benchmark Relion 2 (Kimanius et al., 2016) and is also used here to illustrate the workflow of cisTEM and assess the time for the completion of different processing steps. The entire dataset was downloaded from the EMPIAR database (Iudin et al., 2016) and consists of 1539 movies containing 38 frames, recorded at super-resolution on a K2 Summit camera (Gatan, Inc., Pleasanton, CA) and stored locally as tif files using LZW compression (the conversion to tiff and compression was performed by mrc2tif (Mastronarde and Held, 2017)). The pixel size of the super-resolution frames was 0.3185 Å , and images were binned to a pixel size of 0.75 Å after movie processing. For 2D classification and ab-initio 3D reconstruction, particles were boxed using 384 Â 384 pixel boxes. For auto-and manual refinement, the particles were re-boxed into 648 Â 648 pixel boxes (boxing is part of the creation of Refinement Packages, see above). For all processing steps, a Dell Precision T7910 workstation (Bartesaghi et al., 2015) used to benchmark cisTEM. (A) Different stages of the ab-initio reconstruction procedure, starting from a reconstruction from randomly assigned Euler angles. The process takes less than an hour to complete on a high-end CPU-based workstation. (B) High-resolution detail of the refined b-galactosidase reconstruction with an average resolution of 2.2 Å , showing sidechain details for most amino acids. (C) FSC plots for the refined b-galactosidase reconstruction. The black curve was calculated using a tight mask Figure 7 continued on next page containing two E5-2699 v4 Xeon processors with a total of 44 cores was used. Processing parameters were left on default settings except for CTF determination, which was performed at 3.5 Å resolution using the movie averages instead of the frames, and particle picking, which used optimized parameters based on previewing a few selected images (Figure 3). The resolution limit during refinement (auto, manual and CTF) never exceeded 3.1 Å . The data were stored on a local SSD Raid 0 disk for fast access. Table 1 lists the timings of the different processing steps using all 44 CPU cores. Results obtained at different points in the workflow are shown in Figure 7.

Discussion

151The implementation of a complete image processing workflow in cisTEM offers users a uniform experience and guarantees smooth transitions between processing steps. It also helps developers maintain the software as all the tools and algorithms are developed in-house.

152The main focus of cisTEM is on the processing of single-particle cryo-EM data and high-resolution 3D reconstruction. Future releases of cisTEM may include on-the-fly processing of data as it is collected, particle-based movie alignment, support for helical particles, improved 3D masking tools, more reliable resolution and quality indicators, as well as miscellaneous tools such as the determination of the detective quantum efficiency of electron detectors.

153Since cisTEM does not rely on third-party libraries, such as Python, MPI or CUDA, that usually have to be installed and compiled separately on the target system, ready-to-run binaries can be made available for download that are optimized for different architectures. Using the wxWidgets library also means that cisTEM can be compiled for different operating systems, including Linux, Windows and OSX. Using a configure script, different options for the fast Fourier transforms (FFTs) can be specified, including the FFTW (http://www.fftw.org) and Intel MKL (http://software.intel.com/ en-us/mkl) libraries. The downloadable binaries are statically linked against the MKL library as this exhibits superior speeds compared to the FFTW library on Intel-based CPUs.

154While the lack of support for GPUs simplifies the installation and execution of cisTEM, it can also be a limitation on workstations that are optimized for GPU-accelerated code. These workstations often do not have many CPU cores and, therefore, cisTEM will run significantly more slowly than Figure 7 continued applied to the half maps (Masked_FSC). A correction for potential masking artifacts (Chen et al., 2013) did not lead to adjustments of this curve. The red curved was calculated with a more generous spherical mask and adjusted for the solvent background within that mask (Part_FSC, Equation (19)). The resolution limit of 3.1 Å , which was not exceeded during refinement, as well as the FSC = 0.143 threshold are indicated by lines. DOI: https://doi.org/10.7554/eLife.35383.008

155The following source data is available for figure 7:

156Source data 1. Source data for the curves shown in Figure 7C. DOI: https://doi.org/10.7554/eLife.35383.009 Table 1. Benchmarking of cisTEM using a high-resolution dataset of b-galactosidase (Bartesaghi et al., 2015). code that can take advantage of the GPU hardware. Users who would like to run both CPU and GPU-optimized software may therefore have to invest in both types of hardware.

Development of cisTEM

157The entire cisTEM image processing package was written in C++ using the wxWidgets toolkit (http://wxwidgets.org) to implement the GUI, as well as the libtiff library (http://www.libtiff.org) to support the tiff image format, the SQLite library (https://sqlite.org) to implement the SQL database, and Intel's MKL library (http://software.intel.com/en-us/mkl) for the calculation of Fourier transforms and vector products. Optionally, cisTEM can also be linked against the FFTW library (http://www. fftw.org) to replace the MKL library. The code was written and edited using Eclipse (http://www. eclipse.org), and GitHub (http://github.com) was used for version control. This code is available in Source code 1.

Benchmark dataset

158The performance of cisTEM was benchmarked using a cryo-EM dataset of b-galactosidase (Bartesaghi et al., 2015), entry EMPIAR-10061 in the EMPIAR database (Iudin et al., 2016).

Image and data formats

159cisTEM stores all image data using the MRC format (Crowther et al., 1996). Additionally, particle parameters can be imported from, and exported to Frealign (Grigorieff, 2016) and Relion (Scheres, 2012).

참고문헌 56건

  1. Exact filters for general geometry three dimensional reconstruction Optik · Elsevier BV · 1986
  2. Thon rings from amorphous ice and implications of beam-induced Brownian motion in single particle electron cryo-microscopy Ultramicroscopy · Elsevier BV · 2015 10.1016/j.ultramic.2015.05.017
  3. Visualization and quality assessment of the contrast transfer function estimation Journal of Structural Biology · Elsevier BV · 2015 10.1016/j.jsb.2015.06.012
  4. Automatic estimation and correction of anisotropic magnification distortion in electron microscopes Journal of Structural Biology · Elsevier BV · 2015 10.1016/j.jsb.2015.08.006
  5. Detection of signals in noise 1971
  6. Detection of objects in quantum-noise-limited images Ultramicroscopy · Elsevier BV · 1982 10.1016/0304-3991(82)90258-3
  7. 2.2 Å resolution cryo-EM structure of β-galactosidase in complex with a cell-permeant inhibitor Science · American Association for the Advancement of Science · 2015 10.1126/science.aab1576
  8. Classical detection theory and the cryo-EM particle selection problem Journal of Structural Biology · Elsevier BV · 2003 10.1016/j.jsb.2003.10.025
  9. MRC Image Processing Programs Journal of Structural Biology · Elsevier BV · 1996 10.1006/jsbi.1996.0003
  10. CTER—Rapid estimation of CTF parameters with error assessment Ultramicroscopy · Elsevier BV · 2014 10.1016/j.ultramic.2014.01.009
  11. Optimal noise reduction in 3D reconstructions of single particles using a volume-normalized filter Journal of Structural Biology · Elsevier BV · 2012 10.1016/j.jsb.2012.05.005
  12. Noise bias in the refinement of structures derived from single particles Ultramicroscopy · Elsevier BV · 2004 10.1016/j.ultramic.2004.08.008
  13. Structure of β-galactosidase at 3.2-Å resolution obtained by cryo-electron microscopy Proceedings of the National Academy of Sciences · National Academy of Sciences · 2014 10.1073/pnas.1402809111
  14. Semi-automated selection of cryo-EM particles in RELION-1.3 Journal of Structural Biology · Elsevier BV · 2014 10.1016/j.jsb.2014.11.010
  15. A Primer to Single-Particle Cryo-Electron Microscopy Cell · Cell Press · 2015 10.1016/j.cell.2015.03.050
  16. FindEM—a fast, efficient program for automatic selection of particles from electron micrographs Journal of Structural Biology · Elsevier BV · 2003 10.1016/j.jsb.2003.11.007
  17. Maximum-likelihood Multi-reference Refinement for Electron Microscopy Images Journal of Molecular Biology · Elsevier BV · 2005 10.1016/j.jmb.2005.02.031
  18. Solvent content of protein crystals Journal of Molecular Biology · Elsevier BV · 1968 10.1016/0022-2836(68)90205-2
  19. DoG Picker and TiltPicker: Software tools to facilitate particle selection in single particle electron microscopy Journal of Structural Biology · Elsevier BV · 2009 10.1016/j.jsb.2009.01.004
  20. Molecular interactions in rotavirus assembly and uncoating seen by high-resolution cryo-EM Proceedings of the National Academy of Sciences · National Academy of Sciences · 2009 10.1073/pnas.0904024106
  21. FREALIGN: High-resolution refinement of single particle structures Journal of Structural Biology · Elsevier BV · 2006 10.1016/j.jsb.2006.05.004
  22. SPIDER and WEB: Processing and Visualization of Images in 3D Electron Microscopy and Related Fields Journal of Structural Biology · Elsevier BV · 1996 10.1006/jsbi.1996.0030
  23. High-resolution noise substitution to measure overfitting and validate resolution in 3D structure determination by single particle electron cryomicroscopy Ultramicroscopy · Elsevier BV · 2013 10.1016/j.ultramic.2013.06.004
  24. A New Generation of the IMAGIC Image Processing System Journal of Structural Biology · Elsevier BV · 1996 10.1006/jsbi.1996.0004
  25. Notizen: Zur Defokussierungsabhängigkeit des Phasenkontrastes bei der elektronenmikroskopischen Abbildung Zeitschrift für Naturforschung A · De Gruyter · 1966 10.1515/zna-1966-0417
  26. Accurate determination of local defocus and specimen tilt in electron microscopy Journal of Structural Biology · Elsevier BV · 2003 10.1016/s1047-8477(03)00069-8
  27. Prevention of overfitting in cryo-EM structure determination Nature Methods · Nature Portfolio · 2012 10.1038/nmeth.2115
  28. Avoiding the pitfalls of single particle cryo-electron microscopy: Einstein from noise Proceedings of the National Academy of Sciences · National Academy of Sciences · 2013 10.1073/pnas.1314449110
  29. Resolution measurement in structures derived from single particles Acta Crystallographica Section D Biological Crystallography · Wiley · 2000 10.1107/s0907444900009549
  30. Structure of trimeric HIV-1 envelope glycoproteins Proceedings of the National Academy of Sciences · National Academy of Sciences · 2013 10.1073/pnas.1313802110
  31. EMAN2: An extensible image processing suite for electron microscopy Journal of Structural Biology · Elsevier BV · 2006 10.1016/j.jsb.2006.05.009
  32. RELION: Implementation of a Bayesian approach to cryo-EM structure determination Journal of Structural Biology · Elsevier BV · 2012 10.1016/j.jsb.2012.09.006
  33. Likelihood-based classification of cryo-EM images using FREALIGN Journal of Structural Biology · Elsevier BV · 2013 10.1016/j.jsb.2013.07.005
  34. Finding trimeric HIV-1 envelope glycoproteins in random noise Proceedings of the National Academy of Sciences · National Academy of Sciences · 2013 10.1073/pnas.1314353110
  35. SPARX, a new environment for Cryo-EM image processing Journal of Structural Biology · Elsevier BV · 2006 10.1016/j.jsb.2006.07.003
  36. Measuring the optimal exposure for single particle cryo-EM using a 2.6 Å reconstruction of rotavirus VP6 eLife · eLife Sciences Publications Ltd · 2015 10.7554/elife.06980
  37. Optimal Determination of Particle Orientation, Absolute Hand, and Contrast Loss in Single-particle Electron Cryomicroscopy Journal of Molecular Biology · Elsevier BV · 2003 10.1016/j.jmb.2003.07.013
  38. Appion: An integrated, database-driven pipeline to facilitate EM image processing Journal of Structural Biology · Elsevier BV · 2009 10.1016/j.jsb.2009.01.002
  39. SPRING – An image processing package for single-particle based helical reconstruction from electron cryomicrographs Journal of Structural Biology · Elsevier BV · 2013 10.1016/j.jsb.2013.11.003
  40. Structure and conformational states of the bovine mitochondrial ATP synthase by cryo-EM eLife · eLife Sciences Publications Ltd · 2015 10.7554/elife.10180
  41. EMPIAR: a public archive for raw electron microscopy image data Nature Methods · Nature Portfolio · 2016 10.1038/nmeth.3806
  42. Ensemble cryo-EM uncovers inchworm-like translocation of a viral IRES through the ribosome eLife · eLife Sciences Publications Ltd · 2016 10.7554/elife.14874
  43. Frealign Methods in enzymology on CD-ROM/Methods in enzymology · Academic Press · 2016 10.1016/bs.mie.2016.04.013
  44. Accelerated cryo-EM structure determination with parallelisation using GPUs in RELION-2 eLife · eLife Sciences Publications Ltd · 2016 10.7554/elife.18722
  45. Automated tilt series alignment and tomographic reconstruction in IMOD Journal of Structural Biology · Elsevier BV · 2016 10.1016/j.jsb.2016.07.011
  46. Resolution advances in cryo-EM enable application to drug discovery Current Opinion in Structural Biology · Elsevier BV · 2016 10.1016/j.sbi.2016.07.009
  47. Structure of the transporter associated with antigen processing trapped by herpes simplex virus eLife · eLife Sciences Publications Ltd · 2016 10.7554/elife.21829
  48. cryoSPARC: algorithms for rapid unsupervised cryo-EM structure determination Nature Methods · Nature Portfolio · 2017 10.1038/nmeth.4169
  49. High-resolution Single Particle Analysis from Electron Cryo-microscopy Images Using SPHIRE Journal of Visualized Experiments · MyJOVE · 2017 10.3791/55448
  50. Ensemble cryo-EM elucidates the mechanism of translation fidelity Nature · Nature Portfolio · 2017 10.1038/nature22397
  51. Single‐particle cryo‐EM—Improved <i>ab initio</i> 3D reconstruction with SIMPLE/PRIME Protein Science · Wiley · 2017 10.1002/pro.3266
  52. Scipion web tools: Easy to use cryo‐EM image processing over the web Protein Science · Wiley · 2017 10.1002/pro.3315
  53. Gctf: Real-time CTF determination and correction Journal of Structural Biology · Elsevier BV · 2015 10.1016/j.jsb.2015.11.003
  54. CTFFIND4: Fast and accurate defocus estimation from electron micrographs Journal of Structural Biology · Elsevier BV · 2015 10.1016/j.jsb.2015.08.008
  55. Direct Electron Detectors Methods in enzymology on CD-ROM/Methods in enzymology · Academic Press · 2016 10.1016/bs.mie.2016.05.056
  56. Detection of Signals in Noise Elsevier eBooks · Elsevier BV · 1971 10.1016/c2013-0-07634-7