Cryo-EM structure of the bifunctional secretin complex of Thermus thermophilus

Secretins form multimeric channels across the outer membrane of Gram-negative bacteria that mediate the import or export of substrates and/or extrusion of type IV pili. The secretin complex of Thermus thermophilus is an oligomer of the 757-residue PilQ protein, essential for DNA uptake and pilus extrusion. Here, we present the cryo-EM structure of this bifunctional complex at a resolution of ~7 Å using a new reconstruction protocol. Thirteen protomers form a large periplasmic domain of six stacked rings and a secretin domain in the outer membrane. A homology model of the PilQ protein was fitted into the cryo-EM map. A crown-like structure outside the outer membrane capping the secretin was found not to be part of PilQ. Mutations in the secretin domain disrupted the crown and abolished DNA uptake, suggesting a central role of the crown in natural transformation.


Introduction
Natural transformation is a major mode of horizontal gene transfer (Blokesch, 2017;Mell and Redfield, 2014), by which bacteria take up DNA directly from their environment. In this way, bacteria gain novel genetic information, for example metabolic traits, pathogenicity determinants and resistance genes as a driving force for bacterial adaptation and evolution. By enabling pathogenic bacteria to adapt to the human host, natural transformation is clinically relevant.
Natural transformation is a complex process mediated by multi-component transport machineries consisting of so-called competence proteins, which are highly conserved throughout the bacterial world (Averhoff, 2009;Chen et al., 2005;Koomey, 1998). In Gram-negative bacteria this machinery spans the entire periplasm and connects the inner (IM) and outer membranes (OM), mediating DNA binding on the cell surface and subsequent translocation through the periplasm into the cell.
Many conserved proteins of the bacterial DNA uptake machineries are similar to components of protein secretion and type IV pilus biogenesis systems and often play a dual role (Hobbs and Mattick, 1993). Members of the secretin protein family are conserved key components of natural transformation systems in Gram-negative bacteria, and also play important roles in protein secretion, type IV pilus extrusion and the assembly and extrusion of filamentous bacteriophages (Ayers et al., 2010;Korotkov et al., 2011). The OM-embedded C-terminal secretin domain likely provides an aperture for DNA and protein translocation through the OM, connecting the periplasm to the extracellular environment. The members of the secretin family form homo-oligomers consisting of 12 to 19 subunits surrounding a central channel (Bayan et al., 2006;Costa et al., 2015;Jain et al., 2011). The size of the complex, its oligomeric state and the structures of its periplasmic N-terminal domains vary considerably between organisms. Koo et al. (Koo et al., 2016) showed the overall structure of the secretin domain of PilQ from Pseudomonas aeruginosa at intermediate resolution.
Moreover, atomic models from cryo-EM structures of type 2 (T2SS) (Yan et al., 2017) and type 3 (T3SS) secretion systems (Worrall et al., 2016) revealed the conserved architecture of the secretin domain as a double b-barrel ('barrel-in-barrel' structure) forming the inner gate and the external scaffold. The N-terminal domains of secretins consist of copies of stacked rings which form a periplasmic channel that connects to IM-associated proteins, forming a multi-component secretion system. Structural information on the N domains is scarce, and the N0 domain is usually missing or disordered (Berry et al., 2012;Koo et al., 2016;Worrall et al., 2016;Yan et al., 2017).
In previous studies we discovered a unique secretin (PilQ) complex in the thermophilic bacterium Thermus thermophilus, which is essential for natural transformation and extrusion of type IV pili (Friedrich et al., 2002;Schwarzenlander et al., 2009). We showed that T. thermophilus PilQ contains a thermostable C-terminal secretin domain and an exceptionally long N-terminal tail of six stacked rings (N0-N5) (Burkhardt et al., 2011;Salzer et al., 2016). Furthermore, we determined the in situ structure of the entire T4PS machinery by cryo-electron tomography (cryo-ET) in the piliated and unpiliated state, revealing conformational changes of the N-terminal ring-forming domains (Gold et al., 2015).
We now report a 7 Å resolution cryo-EM structure of the 13-fold symmetric PilQ complex revealing unique molecular architecture. We used a novel image processing tool, REcenter Particles (REP), and state-of-the-art remote homology detection and modeling methods to determine the structure of the large and flexible PilQ complex. A crown-like density outside the OM was unaccounted for by the molecular model of PilQ and represents an unidentified DNA translocator component essential for the function of the secretin in natural transformation.

Cryo-EM structure of PilQ
We used carbon-back-coated holey carbon films for cryo-EM sample preparation (Koo et al., 2016;Low et al., 2014;Reichow et al., 2010;Schraidt and Marlovits, 2011;Tosi et al., 2014;Yan et al., 2017) to ensure an even distribution of PilQ particles. By this procedure, a large majority of the particle images are side views (Figure 1). Top views were too rare to determine the stoichiometry of the complex reliably by two-dimensional (2D) classification. Top views were subjected to multivariate statistical analysis for an unbiased assessment of particle symmetry (see Materials and methods). This procedure indicated unambiguous 13-fold rotational symmetry of the PilQ complex (Figure 1-figure supplement 1).
The particle images on the grid and the 2D class averages (Figure 1) show the typical rod shape of T. thermophilus PilQ (Burkhardt et al., 2011;Salzer et al., 2016). The complex has a C-terminal secretin domain, which inserts into the OM, and six N-terminal domains that form six stacked rings N0 to N5, which were found to extend deeply into the periplasm (Burkhardt et al., 2011;Gold et al., 2015). Rings N1 to N5 consist of predicted -babba-folds whereas the N0 ring has an unusual -aababba-fold (Burkhardt et al., 2012;Salzer et al., 2016).
Although the secretin domain resists denaturation even at high temperatures in the presence of SDS (Burkhardt et al., 2011), the 2D class averages show clearly that the overall complex is flexible. The distances between cap and tail and between the rings vary and the cap module shows a distinct rocking movement around an apparent hinge at the interface between rings N4 and N5 ( Figure 1I, II,III,IV). Consequently, initial 3D reconstructions had a resolution of only~20 Å ( Figure 2F). To improve the map we split the structure into two modules at the N4 ring and reconstructed both parts separately by residual signal subtraction (RSS) . This resulted in a tail module, comprising rings N0-N4 and a cap module containing the secretin domain along with the N5 ring. 3D classification and auto-refinement improved the resolution of both maps to~15 Å . Residual signal subtraction improved the map especially in the secretin domain, but the alignment accuracy was poor, due to the low signal of the subtracted particles. Individual PilQ particles are clearly recognizable, either as frequent side-views (blue boxes) or less frequent top-views (green boxes). Insets show a selection of 2D class averages. Class I to IV were obtained by averaging 1096, 935, 728, and 691 particles respectively. Class II (2x magnification) shows the salient features of the PilQ complex with Gate 1 and 2 (blue lines), rings N5 to N0 (red lines) forming the tail (dark blue bracket) and the cap (pink bracket) containing the secretin domain (yellow bracket). Classes III and IV indicate a rocking motion of the cap and N5 ring relative to the long axis of PilQ, with a hinge at the N4 ring. Green arrow, detergent micelle (DDM). DOI: https://doi.org/10.7554/eLife.30483.002 The following figure supplement is available for figure 1: To improve the map further, we wrote the program REcenter Particles (REP) (Sanchez, 2017) based on the approach of Ilca et al. (2015) and Hou et al., 2017 (see the Appendix for a detailed description of the program). By this procedure the residual signal can be moved to any desired position in the box to maximize alignment precision, and the windows can be cropped to a smaller box size.
We applied the REP procedure to create four new particle data sets, one for each of the rigid parts of the PilQ structure, i.e. the secretin domain with the N5 ring, the N4 ring, and the N2N3 and N0N1 ring pairs ( Figure 2B-E,H). The new stacks of re-centered particles were reprocessed using featureless spheres and cylinders as initial references for the secretin-N5 ring and ring modules. This improved the accuracy of the rotational alignment from~12˚to 2˚, which doubled the resolution and revealed a wealth of new, interpretable map features ( Figure 2 and Figure 2-figure supplement 1). The final component maps have respective resolutions of 7.6 Å , 6.7 Å , 7.6 Å , 7.0 Å for the secretin-N5 ring, N4 ring, and the N2N3 and N0N1 ring pairs (Figure 2-figure supplement 1).

The PilQ model
The higher-resolution component maps provided us with precise information on the position of each domain in the PilQ complex. By remote homology detection (see Materials and methods) we were able to find and align homologous 3D structures for all PilQ domains (Table 1; Figure 3-figure supplement 1). This provided us with starting templates and allowed us to build atomic models of the individual PilQ domains. C 13 symmetry was imposed on the ring domains and the symmetrized models were fitted to their map regions, followed by optimization with a flexible fitting procedure (see Materials and methods; Table 1). The linkers connecting the domains were then modeled and refined in a final round of molecular dynamics flexible fitting (MDFF) (Trabuco et al., 2008), resulting in a full-length atomic model of the PilQ complex ( Figure 3B-D). The C-terminal secretin domain of PilQ was modeled on the basis of the recently determined high-resolution cryo-EM structures of type 2 (Yan et al., 2017) and type 3 secretion systems (Worrall et al., 2016) and fills a substantial proportion of the secretin-N5 region. The remainder of the PilQ complex is formed by six rings that consist primarily of the N-domains. The rings of domains N1 to N5 show the conserved -babbamotif, typical of the N-terminal part of the secretion systems (Video 1). Domains N0 and N1 of T. thermophilus PilQ differ from other known N0 and N1 domain structures (Berry et al., 2012;Spreter et al., 2009)  Overall the independently reconstructed ring modules matched the corresponding C 13 atomic models reasonably well, as shown by computation of local cross-correlation (See Materials and methods; Figure 3E). The initial best fitted ring models are structurally close to the MDFF refined models (with small RMSD, Table 2).
Densities corresponding to linker regions between domains N0 and N1, N2 and N3, and N5 and secretin were resolved within the four independent, recentered EM maps ( Figure 2I,H). This made it possible to model the linker segments in a straightforward manner after an individual fit of the protomer domains (Figure 3-figure supplement 1). Densities for loops connecting N3 to N4 and N4 to N5 were not resolved. These linker segments were therefore modeled based on the arrangement of rings and their connections as seen in the homologous V. cholerae GspD (Video 2) (see Materials and methods).

Molecular architecture of the PilQ complex
The PilQ complex is 350 Å long and 125 Å wide ( Figure 3A). Thirteen PilQ protomers assemble to form a cylinder with a central channel that connects the outer membrane space with the periplasm. The DDM detergent micelle at the top of the secretin domain ( Figure 1I   Sequence alignment to secretins of known 3D structure indicated that PilQ lacks the lip domain that forms a cap on the extracellular side of the OM in some species (Yan et al., 2017). This feature is present in V. cholerae GspD, while it is absent in other characterized secretion systems like S. enterica InvG, E. coli K12 GspD and K. oxytoca PulD (Worrall et al., 2016) (Figure 4). Surprisingly, the PilQ complex has an additional density outside the OM, which we refer to as the 'crown' (Figure 3, Figure 5A, Video 1). The crown consists of 13 distinct spikes,~40 Å high, which make contact with the inner surface of the outer b-barrel of the transmembrane part of the secretin.
The top of the secretin domain has a~70 Å aperture, which leads to Gate 1 (Figure 3-figure supplement 2A). Gate 1 is located immediately below the membrane-embedded portion of the bbarrel and defines a~30 Å aperture. The aperture of Gate 1 is surrounded by multiple lever-like features that emerge from the inner barrel of the secretin domain ( Figure 3-figure supplement 2B, Video 1). The N5 ring below Gate 1 has an inner diameter of~70 Å . The N4 ring is situated below Figure 2 continued using the RSS procedure improves the resolution to 15 Å . (H) Combination of RSS and recentering after dividing the PilQ complex into four modules doubled the resolution to 7 Å . Images were realigned, classified and refined independently for the cap and N5 ring (1763 particles, orange), N4 ring (3888 particles, yellow), N2N3 ring pair (1585 particles, light green) and N0N1 ring pair (2685 particles, blue). Secondary structure features were resolved in all component maps, revealing the single-polypeptide chain connections between the N0N1 and N2N3 ring pairs. (I) The recentering procedure does not introduce overfitting, as independently aligned and refined modules (N0N1 and N2N3) display consistent features. Features of the N2 ring along with N1-N2 linker region from both modules (blue and green) show maximal overlap. The position of the outer membrane (OM) is indicated by a transparent grey bar. DOI: https://doi.org/10.7554/eLife.30483.004 The following figure supplement is available for figure 2:  Table 1. Modelling and fitting of PilQ domains. Sequences of PilQ domains aligned to their respective templates were used to create atomic models of each domain. Models with the best scores (lower DOPE scores [Sali and Blundell, 1993]) were fitted into the corresponding density maps and screened for best fit orientations (highest cross correlation coefficient).  Ring N4 is separated by~20 Å from the N2N3 pair. The connection between this ring pair and N4 is not resolved. Given that the linker between domains N3 and N4 is 17 residues long, it is possible that consecutive rings are offset by one or two domains along the circumference of the ring (

K728 and R730 residues stabilize the crown region of PilQ
The crown region of the PilQ complex outside the outer membrane is not accounted for by the PilQ sequence ( Figure 3). Our structural model identifies the region of the PilQ sequence that interacts with the crown ( Figure 5A). We exchanged two positively charged residues (K728 and R730) at the interface between the detergent belt and the crown module to alanine by site-directed mutagenesis (see Materials and methods). These PilQ variants were expressed in a pilQ negative T. thermophilus mutant (DpilQ:: bleo).
EM analysis of the PilQ K728A/R730A (PilQ-KR) variant revealed that it forms PilQ complexes lacking the crown region ( Figure 5B-C). To analyze the impact of these residues on PilQ complex stability or assembly, we harvested a T. thermophilus DpilQ mutant (DpilQ::bleo, negative control), a DpilQ mutant complemented with the pilQ wt gene (positive control) and a pilQ deletion mutant complemented with pilQ-KR in stationary phase and analyzed the PilQ complexes after boiling the membrane extracts for 30 min in SDS sample buffer ( Figure 6A). No PilQ complexes were detected in the DpilQ::bleo (negative control) mutant, while the pilQ mutant complemented with pilQ wt (positive control) and pilQ-K728A/R730A produced assembled PilQ complexes ( Figure 6B). We conclude that K728 and R730 are not essential for PilQ oligomerization or thermostability ( Figure 6B), but necessary for crown assembly.
Next, we investigated the overall structural arrangement of PilQ variants. The PilQ complex formed by PilQ-KR was purified from T. thermophilus cells and analyzed by negative-stain EM (see Materials and methods). A total of 2911 particles were manually picked with the boxer module in EMAN (Ludtke et al., 1999) and processed for 2D reference-free classification. This procedure identified 1066 particles (~36%) without crowns ( Figure 5B). In these particles the density close to the Homology models of the different PilQ domains were fitted into the respective ring module maps. Each domain was initially placed within the density maps in multiple orientations (n = 10,000), spanning the entire Euler angular space, and subjected to steepest descent local optimization. The resulting fits were clustered and ranked by their CC-scores with the corresponding density maps fits. The table lists the top-5 fits for each domain in the Euler-angle search, along with their CC-scores and the number of independent optimization runs ending in this cluster. The top-ranked fits were assessed for compatibility of the N-to-C-terminal domain orientations (bottom-to-top). The compatible orientations with the highest CC-value was selected as initial fit. Subsequent refinement using MDFF flexible fitting (Trabuco et al., 2008) further improved the fits with minimal structural change. OM is fuzzy ( Figure 5B), while the remaining complex appears unchanged. This observation suggests that the crown module in this PilQ variant has bound but is not properly folded. Interestingly no perceivable differences between the pilQ-K728A/R730A and WT-PilQ complex were observed in the remaining 64% of the particles ( Figure 5C). These observations illustrate that residues K728 and R730 are important for PilQ crown assembly or folding.
K728 and R730 play a role in functionality of PilQ in twitching motility and adherence and are essential for natural transformation To characterize the effect of PilQ-K728A/R730A mutation on the function of the PilQ complex, we quantified the twitching motility of T. thermophilus. The T. thermophilus strain containing WT PilQ-complex has a twitching zone of 2.2 cm after 3 days of incubation. This value was set to 100%. The DpilQ::bleo (negative control) was not motile ( Figure 6C). The pilQ-KR double mutant showed a twitching zone of 1.4 ± 0.3 cm, which was smaller than that of the WT strain (64% of the wild-type). Next, we measured the adherence of bacterial cells to plastic surfaces, which is mediated by type-IV pili (see Materials and methods). T. thermophilus HB27 was used as positive control and showed a ratio (570 nm/600 nm) of 3.9 ± 1.5 Â 10 À2 . The negative control (DpilQ::bleo) did not adhere at all. The pilQ-KR showed a ratio of 1.9 ± 1.3 Â 10 À2 . The pilQ-KR mutant therefore exhibited only 49% of the wild-type adherence. These findings suggest that the crown plays a role in type IV pilus-mediated adhesion and twitching motility.
To analyze the role of K728 and R730 in natural transformation, we quantified the natural transformation frequency of the pilQ-mutant complemented with PilQ-KR. The PilQ wildtype cells and the pilQ mutant were used as controls (see Materials and methods). The transformation frequency of the wild-type strain was 2.7 Â 10 À3 ± 4.9 x 10 À4 , while DpilQ::bleo (negative control) was not transformable. The transformability of the pilQ-KR mutant was reduced to 6% (frequency = 1.6 Â 10 À4 ± 5.4 Â 10 À5 ). This suggests that K728 and R730 play an essential, functional role in DNA uptake and natural transformation.

Discussion
The recentering protocol improves the resolution of flexible particles Achieving sub-nanometer resolution for this complex required a novel tool for image processing. By applying our new recentering procedure after residual signal subtraction , we were able to align and refine each rigid module of PilQ complex independently. It also enabled us to visualize the densities of the connecting loops between some of the N-terminal ring domains ( Figure 2I).
The overall alignment improved substantially (Figure 2 and Figure 2-figure supplement 1), compensating for the small number of available particles. The improvement is easily explained as follows: A small alignment error at the center of the box becomes more severe with increasing distance from the center of rotation. Moving the particles from the edge of the box therefore results in a significant enhancement in the accuracy of local particle alignment. This feature of our recentering procedure should be especially useful for large, flexible complexes with multiple components such as PilQ and other secretion systems (Worrall et al., 2016;Yan et al., 2017), respiratory supercomplexes (Sousa et al., 2016), spliceosomes (Nguyen et al., 2015), apoptosomes (Pang et al., 2015), or stressosomes (Marles-Wright et al., 2008). In case of our PilQ complex, this procedure improved the map resolution to~7 Å , whereas the conventional global alignment procedure limits the resolution to~20 Å ( Figure 2F-H).
The ease of implementing the recentering procedure and interfacing it with other cryo-EM software, combined with a substantial reduction in computational cost make it an attractive feature for processing cryo-EM images of large, flexible particles. Reducing the particle box size economizes on computation, particularly when using GPUs (Figure 2-figure supplement 1). Recentering requires only two inputs: the coordinates of the new center and the alignment parameters (see Appendix 1 for details).

Architecture of the PilQ complex
The structure of the T. thermophilus PilQ complex differs from that of other secretion systems (Figure 4). PilQ is evolutionarily related to other secretins and partly resembles T2SS ( Other known secretion systems feature a single gate in the OM (Gate 1) (Costa et al., 2015;Korotkov et al., 2011), which is a conserved feature amongst all secretins. PilQ from T. thermophilus has an additional gate (Gate 2) on the periplasmic side close to the platform apparatus, which connects PilQ to a still not yet identified channel in the inner membrane (Gold et al., 2015). Gate 2 is composed of long loops between the N0 and N1 ring (Figure 3-figure supplement 2). The unusual number of six N-terminal ring domains makes PilQ one of the largest secretion systems to have been characterized so far (Figure 4). The six rings enable the complex to span most of the wide periplasmic space of T. thermophilus (Burkhardt et al., 2011;Burkhardt et al., 2012). Different orientations of the individual domains and inter-protomer interactions account for slight changes in the diameter and height of individual rings. The N1 and N4 domains appear to be slightly tilted towards the inside, compared to the N2N3 pair ( Figure 3). This inward tilting reduces the inner diameter of rings N1 and N4. In combination with the N1 inward tilt and extended loops connecting the b1-a1 and b2-b3 of the N-terminal ring, the N1 domain fills additional density within the channel-forming Gate 2 (Video 1, Figure 3-figure supplement 2). The N0 ring is well resolved in the map, whereas in other secretins it was not visible, apparently due to its flexibility (Koo et al., 2016;Worrall et al., 2016;Yan et al., 2017).

Role of the crown module
Multiple sequence alignment of secretin domains ( Figure 4D) reveals a cap/lip segment in some species that forms a protrusion outside the OM (Koo et al., 2016;Worrall et al., 2016;Yan et al., 2017). T. thermophilus PilQ does not contain this sequence; however, our EM map shows a large crown module outside the OM (Video 1, Figure 3), which cannot be assigned to any part of the PilQ sequence ( Figure 5A) and thus must be another protein component of the complex. The crown module outside the OM is also visible in sub-tomogram averages of the piliated and the non-piliated complex in situ (Gold et al., 2015) (Figure 7). The crown module appears to be difficult to separate from the PilQ secretin domain and resists denaturation with SDS at high temperature  (Burkhardt et al., 2011), which indicates a very tight interaction. Negative stain EM showed that the PilQ-K728A/R730A mutation affects the structure of the PilQ complex and interferes with the crown folding or assembly ( Figure 5B-C). This mutation has a minor effect on motility and adherence of bacterial cells. However, the transformation efficiency of these cells is severely impaired. Our previous finding that PilQ is essential for DNA binding (Schwarzenlander et al., 2009) leads us to conclude that the crown structure is either directly or indirectly implicated in DNA binding and uptake. We speculate that it may be the extracellular switch that converts the pilus extrusion machinery into a DNA uptake system. Experiments to identify the crown module are currently in progress.
PilQ forms the core of the bifunctional T4PS/DNA uptake system and is suggested to interact with a number of periplasmic and outer and inner membrane anchored proteins (Friedrich et al., 2002;Rose et al., 2011;Rumszauer et al., 2006;Salzer et al., 2014;Schwarzenlander et al., 2009;Tsai and Tainer, 2016). Our structure provides a firm base for mechanistic investigations of the complex apparatus that enables natural transformation.
E. coli cultures were grown in LB medium using a similar protocol with appropriate kanamycin, ampicillin, and/or bleomycin were added. T. thermophilus strains were cultivated at 68˚C in TM + medium to stationary growth phase and cells were harvested. Membrane extracts containing PilQ complex were prepared as described (Salzer et al., 2016). The membrane extracts were boiled for 30 min in SDS sample buffer and separated by 3-12% SDS-PAGE. Proteins were transferred to a nitrocellulose membrane. Western blot analysis was performed with polyclonal PilQ antibodies using a dilution of 1:13000. K728A and R730A variants of PilQ were obtained through site directed mutagenesis. pDM12-pilQ-6his plasmid (Burkhardt et al., 2011) along with primers, SDM_KR-for GA TCGGCGAGCTGTTCGCCCAGGCCACGAACGAGAGCACCGACAAGG and SDM_KR-rev AGGGGA TGTCCATGAGGAGGGGCACC were used. The plasmids were sequenced to confirm the mutations and transformed into T. thermophilus DpilQ::bleo mutant. The resulting pilQ gene (pilQK728A/ R730A) was expressed from the plasmid pDM12 under the bc1 promoter (Salzer et al., 2014) in a DpilQ::bleo mutant.
Twitching motility, adherence and transformation assay T. thermophilus strains were grown for 3 days on minimal medium containing 1% BSA. The plates were subsequently stained with Coomassie Blue. T. thermophilus cells were detached from the agar and the twitching zones. After decantation of the cell suspension, colorless regions are visible, where the cells attach. This region (diameter in cm) is defined as the twitching zone. This is made visible as a dark zone by contrast inversion.
Adhesion of bacterial cells, which is mediated by type-IV pili, was quantified using the microtiter adhesion assay (Burkhardt et al., 2012). Cells were inoculated to an optical density of 0.05 (at 600 nm) and incubated for 3 days at 55˚C, 64˚C, or 72˚C. After incubation, the optical density (600 nm) was measured again, followed by a washing step to remove non-sessile cells. Remaining adherent cells were stained with 0.1% crystal violet solution. Excess staining solution was removed by washing three times with water. Crystal violet from the adhering cells was then dissolved in ethanol, and its absorbance was measured at 570 nm. Adherence was quantified as a ratio of absorbance at 570 nm to 600 nm.
Transformation efficiency of WT and mutant cells was analyzed by performing transformations at 68˚C on TM + agar medium using 5 mg of genomic DNA of a spontaneous streptomycin-resistant T. thermophilus HB27 mutant (Friedrich et al., 2001). The transformation frequency was calculated as number of transformants per living count. All transformation assays were performed in triplicate.

Negative stain EM of PilQ-KR mutants
We used 2% ammonium molybdate for negative staining of a PilQ-KR mutant sample diluted to a final concentration of 0.01 mg/ml (Salzer et al., 2016). Micrographs were recorded in an FEI Tecnai G2 Spirit operated at 120 kV, at a nominal magnification of 29,000, yielding a pixel size at the specimen level of 4.2 Å . 2D classification was carried out using Xmipp 3.1 using the classification algorithm CL2D (Sorzano et al., 2010).

Cryo-EM data collection
Three ml of wt PilQ sample (concentration = 1.5 mg/ml) was applied to freshly glow-discharged (at 15 mA for 25 s) Quantifoil R1.3/1.2 holey carbon grids (Quantifoil Micro Tools, Germany) backcoated with a thin carbon layer. The grids were vitrified in an FEI Vitrobot Mark IV plunge-freezer at 70% humidity and 10˚C after blotting for 8-10 s. Cryo-EM images were collected in a JEOL 3200 FSC electron microscope operating at 300 kV, after coma free alignment, equipped with an in-column energy filter at a slit width of 18 eV. Images were recorded manually at a nominal magnification of 20,000x, yielding a calibrated pixel size of 1.63 Å , on a K2 direct electron detector (Gatan) operating in counting mode. Dose-fractionated 9 s movies of 45 frames were recorded with an electron dose of 0.75 e -/Å 2 /frame at a defocus of 1.2-3.4 mm.

Cryo-EM image processing
A total of 932 micrographs was collected. Whole-image drift correction of each movie was performed using MotionCorr (Li et al., 2013). A second round of whole-image drift correction was performed using Unblur (Grant and Grigorieff, 2015) and the aligned movies were summed and exposure-filtered using the program Summovie (Grant and Grigorieff, 2015). The CTF was determined using CTFFIND4 (Rohou and Grigorieff, 2015) in the RELION workflow (Scheres, 2012). A dataset containing 11,457 particle images manually picked with EMAN boxer (Ludtke et al., 1999) (324 pixels x 324 pixels) was subjected to 2D reference-free classification in RELION (Scheres, 2012) to check the quality of the particle images. To assess the symmetry of the particles, 363 top-views were separately picked and extracted with a smaller box size (168 Â 168). Top views were subjected to reference-free classification, but the 2D class averages did not display reliable features because of the low number of particles and the attractiveness effect of the maximum likelihood approach (Sorzano et al., 2010). To assess the symmetry of 2D class averages, the eigenimages were evaluated after multivariate statistical analysis (MSA) (Bö ttcher et al., 2015;Dube et al., 1993) in IMAGIC (van Heel et al., 1996). From a class average obtained in RELION, a clear top view was selected and 50 randomly rotated copies were produced with the ROTATE-RANDOMLY command, realigned translationally, and subjected to a single round of MSA with the MSA-RUN command. This procedure was repeated with 10 other top views to assess the reproducibility. The eigenimages clearly indicated 13-fold cyclic symmetry (Figure 1-figure supplement 1).
Next a consensus 3D refinement was performed with all particles. As a starting reference a featureless cylinder was generated in Xmipp 3.1 (Sorzano et al., 2010) with the module xmipp_trans-form_mask with -create_mask -mask cylinder options. After the consensus refinement, the resulting map was used as a starting reference for 3D classification with local angular search. The same map was also used as a template for obtaining a soft-edge shaped mask with the relion_mask_create module in RELION. Several runs of 3D classification were conducted, varying the number of classes in order to assess the consistency of the results. Different symmetries (C 9 to C 18 ) were tested, but only C 13 provided consistent reconstructions in terms of interpretable features. Local angular search was performed with 1.875˚± 10˚and then 0.9˚± 3˚respectively. A dataset of 2646 particle images was obtained after combining the classes displaying the best interpretable features ,which was then subjected to the 3D auto-refinement procedure in RELION with only local angular search using the best alignment parameters obtained at the end of 3D classification. This led to two maps with a resolution of~20 Å . To account for the observed flexibility of the PilQ complex, the map was divided into two parts: the cap, consisting of the secretin domain and the N5 ring, and the tail containing rings N0-N4. A residual signal subtraction (RSS) procedure  was applied to both parts, subtracting the signal for the other part from the aligned images, yielding two new datasets of particle images for cap and tail regions (Figure 2,G). Each dataset was then subjected again to a global alignment through a consensus refinement, 3D classification and auto-refinement with only local alignment as described above for the complete complex. Although some new features were partially resolved, the global alignment of the subtracted particles was poor. To resolve this problem, we used our in-house program REP (see the appendix for a detailed explanation) to re-center the residual signal of the particles within a smaller box size. This allowed us to subdivide the PilQ complex into four modules incorporating all the particles of the initial dataset with different box sizes: secretin-N5 domains (160 Â 160), N4 ring (120 Â 120), N2N3 ring pairs (150 Â 150) and N0N1 ring pairs (160 Â 160). These new datasets were reprocessed with FREALIGN (Grigorieff, 2007), first in a global alignment cycle (mode 3) and followed by three iterations of local alignments (mode 1) using featureless spheres and cylinders as initial references for the cap and N-terminal ring modules. Subsequently each module was subjected to 3D classification in mode 1, refining the angles every three iterations and performing the classification with 3 to 9 classes in order to test reproducibility. Alternatively, RELION 1.4 (Scheres, 2012) was used to accurately estimate rotational alignment accuracy as function of the box size. After post-processing, maps of the cap, N4 ring, N2N3 and N0N1 ring pairs had a resolution of 7.6, 6.7, 7.0, and 7.6 Å , respectively. Before visualization all density maps were corrected for the modulation transfer function (MTF) of the K2 direct detector. Maps were sharpened by applying a B-factor of À250 Å 2 .

PilQ modeling
To model the structure of PilQ we first identified homologous proteins with known structure by performing a BLAST search (Altschul et al., 1990) of the PilQ Uniprot sequence (Q72IW4) against the protein data bank (PDB). Hits were filtered by query coverage of 70% and an E-value cut-off of 3.0. The resulting template PDB structures for each of the PilQ domains were pruned by structural resolution and realigned with their respective templates using the 3D-Coffee algorithm (Taly et al., 2011) to maximize alignment quality and coverage. N1 and secretin domains were realigned with their respective template sequences using HHPred (Sö ding et al., 2005). These alignments were then used for generating homology models for all the individual domains using Modeller (Sali and Blundell, 1993;Webb and Sali, 2014). The modelling procedure is summarized in Table 1.
Fitting homology models to the cryo-EM density map From a series of domain deletion mutants of PilQ, we deduced that individual consecutive domains form discrete stacked ring-like density segments and are arranged with the N-terminal N0 domain at the bottom end and the C-terminal secretin domain at the top end (Salzer et al., 2016). This analysis enabled us to assign all domains in the low-resolution map of the complete PilQ assembly. Further reprocessing of EM images by recentering subdomains provided us with four better-resolved density maps corresponding to (a) secretin domain and N5 domain, (b) N4 domain, (c) N3 and N2 domains, and (d) N1 and N0 domains, respectively. The homology models of individual domains were then fitted into masked ring-like densities, first as individual protomers using the fit-in-map tool of Chimera (Pettersen et al., 2004). The best-fit protomer orientations of individual domains were identified from the 15 top scoring orientations with high cross-correlation coefficients. The best models were analyzed to ensure correct arrangements of domain boundaries for each domain within the ring structures, that is, N terminus towards the base (tail) and C terminus towards the top (cap). Connecting linker segments between domains N0N1, N2N3 and, N5-secretin were modeled using the Modeller loop modeling protocol with DOPE scoring (Sali and Blundell, 1993) at higher precision. C 13 symmetry-related chains (A to M) corresponding to modeled protomer fragments were added to make C 13 -symmetric rings of PilQ domains/fragments, followed by an exhaustive 6D rigid body search to fit into the corresponding localized density regions with an angular sampling of 20 degrees using Colores (Lasker et al., 2010). To account for the flexibility and conformational dynamics of the entire PilQ oligomeric complex, we optimized the 13-mer fragment rigid-body fits using a molecular dynamics flexible fitting (MDFF) procedure (Trabuco et al., 2008). MDFF adds biasing forces proportional to the observed EM density gradients. MDFF runs were set up using VMD (Humphrey et al., 1996) and used the CHARMM36m force field (Huang et al., 2017). Simulations were carried out using NAMD (Phillips et al., 2005) in vacuum at a temperature of 300K for 500 ps. Forces corresponding to EM density gradients were coupled using an MDFF scaling factor x of 0.3. The MDFF runs were followed by short energy minimization runs for 10000 steps with x of 10. Restraints to preserve secondary structure, chirality, and trans-peptide bond geometry were employed. The loop segments within the N0 and N1 domains are longer and more disordered than in the top-scoring template structures. To model these flexible regions, ten loop conformations were modeled and filtered to identify the model exhibiting maximum overlap with the corresponding density regions in the N0N1-masked map. Four successive MDFF runs were performed for the N0N1 domains, each for 500,000 steps, using increasing values of the scaling factor, x = 0.3, 0.5, 1.0, and 3.0, respectively. All MDFF runs were monitored by measuring the evolution of the backbone RMSD and the cross-correlation coefficient changes with the target density maps. To optimize the atomic model of the fully assembled complex, a complete high-resolution EM map for the entire PilQ complex was built by stacking the individually processed ring density maps, guided by a low resolution template map of the whole PilQ complex. The four optimized C 13 symmetric models were fitted into corresponding density regions, followed by modeling of missing loop segments between N1-N2 rings, N3-N4 rings, and N4-N5 rings using Modeller (Sali and Blundell, 1993;Webb and Sali, 2014) to preserve the domain connectivity as in V. cholerae GspD. To prevent overfitting, the C 13 symmetry-related oligomer was used for flexible fitting of the tridecameric PilQ model into the complete EM map.

Validation of initial fits
We first generated individual domain maps of the entire PilQ protein. The initial homology domain models for all PilQ domains were then subjected to extensive sampling (n = 10000) of complete Euler angular space (F 2 [0, 2p]; q 2 [0, p]; É 2 [0, 2p]) to obtain initial orientation ensemble for placing the respective domains within their corresponding EM maps. Following local steepest descent optimization, we obtained several unique solutions for each domain. These unique fits were characterized by their fitted-orientation, local CC and the number of runs converging into these solutions. The top best fit solutions were ranked by their local cross correlation values computed with the corresponding domain density maps using colores from the Situs package (Lasker et al., 2010). The previously obtained initial best fit orientations for each PilQ domain were re-evaluated by comparing them with top scoring solutions before and after MDFF refinement (Figure 3-figure supplements  4, 5).

Model/map correspondence
The initial best fitted C 13 homology models before refinement were used to generate EM maps at the same corresponding nominal resolution of the recentered EM maps. Subsequently the model-generated maps were used to compute per voxel local cross-correlation (using the vop localCorrelation module of UCSF Chimera) against the experimental ring-module EM maps to show model/map correspondence. This showed overall good agreement between the initial C 13 homology models and the EM maps. Regions that were not resolved in the EM maps, corresponding to linker segments and domain termini connecting individual domains, were subsequently refined using MDFF.

Additional information
Competing interests Werner Kü hlbrandt: Reviewing Editor, eLife. The other authors declare that no competing interests exist.

Funder
Grant reference number Author The funders had no role in study design, data collection and interpretation, or the decision to submit the work for publication.