Author Summary Most motile bacteria use a flagellum to move. The extracellular components of flagella are secreted by their own Type 3 Secretion System (T3SS). The non-flagellar T3SS (NF-T3SS), also named injectisome, includes many proteins that are homologous to flagellar components. NF- T3SSs are employed by many plant and animal pathogens to deliver effectors to host cells, including toxins. NF-T3SSs are complex protein machineries with .15 components that connect bacterial cell envelopes to eukaryotic cell membranes, including the intervening extracellular space. In this study, we designed computational tools to distinguish flagella and NF-T3SSs from other bacterial protein sequences. We show that NF-T3SSs evolved from the flagellum by a series of genetic deletions, innovations, and recruitments of components from other cellular structures. Our evolutionary analysis suggests that NF- T3SSs then quickly adapted to different eukaryotic cells while maintaining a core structure that remains highly similar to the flagellum. This is an example of evolutionary tinkering where a complex structure arises by exaptation, the recruitment of elements that evolved initially for other functions in other cellular structures. its cytosol (Figure 1A). The basal body of the NF-T3SS provides a structural basis for the secretion machinery involved in protein delivery. The outer membrane component of the basal body is formed by a homo-polymeric ring of secretins (SctC) [22,23], whose inactivation leads to the accumulation of effectors in the periplasm [24]. This protein is part of a large family of pore- forming secretins, also found in Type IV pili (T4P), Type II Secretion Systems (T2SS), Flp pili encoded by the tight adherence (Tad) system and the extrusion machinery of filamentous phages Origins and Diversification of T3SS [25]. At the inner-membrane the basal body inner ring is composed of SctJ and SctD [22,26]. The needle of the NF- T3SS is connected to the basal body at the inner membrane and extends outward from the cell [27]. In Salmonella, Shigella and Yersinia the needle is made of a major subunit (SctF) [26,28,29]. Phytopathogens do not have a needle but a flexible pilus-like structure encoded by HrpA [30,31]. HrpA shares several traits with SctF and its pilus presumably represents an adaptation of the NF-T3SS to the thick plant cell wall [32]. The needle is capped by a tip (LcrV) involved in regulating secretion and in positioning the translocation pore in the host cell membrane [33,34]. When the system is in contact with a target cell and delivery is activated, the translocon (YopB and YopD) acts as a pore-former in the eukaryotic membrane [35]. A few highly conserved proteins underneath the basal body are essential for the function of the NF- T3SS. One is a member of the F-/V- ATPase family (SctN), with homologs in flagella and F0F1 proton-translocating ATPases [36– 39]. This ATPase functions in the recognition and unfolding of secreted proteins and possibly participates in energizing the process of secretion [40–43]. In S. enterica Typhimurium, a protein similar to the flagellum C-ring ‘‘sorting’’ platform (SctQ) was suggested to orchestrate the order of protein secretion in interaction with SctK and SctL [44]. The remaining highly conserved proteins (SctRSTUV) form the secretion apparatus. Their functions are poorly understood but they are thought to include substrate selection and molecular switching between modes of secretion [45,46]. In Salmonella, Shigella, and Yersinia, another protein of importance, SctP, controls the needle-length during its assembly [26,47,48]. In Yersinia, SctP and SctU are involved in substrate-switching [45,49], possibly by regulating the export of the inner rod protein (SctI) [49]. Two models were proposed for the initial stages of NF-T3SS assembly. In the outside-in model, inferred primarily from Yersinia Figure 1. Identification of T3SS core genes in complete genomes. (A) Representation of the proposed organization of a NF-T3SS system, inspired from the Salmonella system [139]. For consistency with the main text, nomenclature follows that of Yersinia for some genes (see Table S1 for equivalence). Genes in red have homologs in the flagellum (main text, Table S1). ‘‘Euka’’ stands for eukaryotic, ‘‘mb’’ stands for membrane, ‘‘IM’’ for inner membrane, and ‘‘OM’’ for outer membrane. (B) Distribution of the number of different protein profiles of the 9 core genes of NF-T3SS matched per replicon (i-evalue,1023). Bar colors discriminate between systems in flagella or NF-T3SSs and other systems including only a secretin (SctC) and/ or the ATPase (SctN). Numbers of replicons are indicated above the corresponding bars, with the number of uncharacterized cases (‘‘Others’’, colored in magenta in bars) in parenthesis if different from the total. ‘‘Nb’’ is an abbreviation for ‘‘Number’’. doi:10.1371/journal.pgen.1002983.g001 PLOS Genetics | www.plosgenetics.org 2 September 2012 | Volume 8 | Issue 9 | e1002983