Figure 3. Rooting the history of T3SS. (A) Representation of the three possible scenarios for the relative emergence of the flagellum and of the NF-T3SS. The numbers represent the percentage of each scenario in the bootstrap analysis of the ATPase family (out of 997 bootstrap trees where outgroup sequences were monophyletic, Figure S2, Protocol S1, Text S1). (B) The maximum likelihood tree of the ATPase family shows that the NF-T3SS derives from the flagellum. Support values are shown only for relationships important to discriminate between the three scenarios in the panel (A). They correspond to the occurrence of the splits in 1000 bootstrap replicates. The multiple alignment used to build this tree had 296 informative sites and is supplied in Dataset S1. doi:10.1371/journal.pgen.1002983.g003 (Figure 6A) hereafter referred as ‘‘NF-T3SS-like’’ secretins. The most parsimonious explanation for these results is that the last common ancestor of extant NF-T3SSs lacked a secretin. The secretin of Rhizo NF-T3SSs is encoded by two genes, rhcC1 and rhcC2 (Figure 6B) [104], and we show that they have distinct origins. The gene rhcC2 encodes a protein whose architecture is similar to the secretin of the Tad locus of Caulobacter crescentus CpaC (Figure 6B, Text S4), in agreement with its phylogenetic position within Tad loci (Figure 6A). It includes the ‘‘secretin’’ domain, absent from RhcC1, and an N-terminal ‘‘BON’’ domain [105]. The gene rhcC1 is found at a conserved position in Rhizo loci, among other NF-T3SS core genes (Figure 6C). The protein RhcC1 is homologous to the N-terminal part of the NF-T3SS-like secretins (Blast search with e-value,1023, Figure 6B, Text S4), which includes the first ‘‘N-domain’’ (PFAM PF03958) of these secretins (Figure 6B). This demonstrates that RhcC1 has a common origin with NF-T3SS-like secretins. Therefore, both protein domains analyses and phylogenetic analyses agree in suggesting the independent acquisition of the secretin in the ancestral Chlamy, and in the ancestor of all the other NF-T3SSs. According to this interpretation, the ancestral Rhizo system had originally an ‘‘NF-T3SS-like’’ secretin, RhcC1, and secondarily acquired the secretin RhcC2 from a Tad locus. The recruitment of this second secretin was accompanied by the deletion of a large C- terminal fraction of the original secretin, and is thus an example of a partial homologous gene replacement. Diversification of NF-T3SS and host interactions The association between the repertoire of NF-T3SS genes and the nature of the eukaryotic host maps well on the phylogenetic tree of the NF-T3SS (Figure 4, see Figure S4 and Text S2 for more details). Notably, there is a clear distinction between systems involved in interactions with animals or protozoa, on one hand, and plants and fungi on the other (Figure 4 and Figure S4). This is not necessarily expected because the phylogeny was based on Origins and Diversification of T3SS ubiquitous, highly conserved, core genes that are not expected to drive the ecological diversification of the NF-T3SS. Indeed, Chlamydia effectors can be recognized and exported by the very distant NF-T3SS of Shigella [106], and effectors of animal- associated NF-T3SS can be exported by plant-associated NF- T3SS [107]. Therefore, the specificity of the ecological interaction between the NF-T3SS and the eukaryotic cell is caused by the diversification of extracellular components such as the needle and the tip [26] (see the gene content panel on Figure S4). Hence, the clear separation of NF-T3SSs in terms of host cells in the phylogenetic tree of core genes likely reflects their genetic linkage to genes encoding the extracellular proteins of the NF-T3SS. The classification of the NF-T3SSs may help unravel unknown ecological interactions between free-living bacteria and eukaryotes (Figure 4, Figure S4). Shewanella spp. are free-living marine bacteria. They are not pathogenic for fish, but are a major cause of marine seafood spoilage [108]. Their NF-T3SS system, SPI2, is closely related to that found in Edwardsiella spp. which are true fish pathogens. We did not find any reports of specific interactions between M. mediterannea and eukaryotes, but this bacterium belongs to the microbiota of Posidonia oceania [109], a marine angiosperm, and encodes a plant-related NF-T3SS (Hrp1). In some cases the associations between the NF-T3SS type and the host seem less clear-cut. X. albilineans, unlike other Xanthomonas phytopathogens, has one SPI1 system, which does not seem to be involved in pathogenesis, even though this bacterium proliferates in the xylem of plants [110]. Salmonella enterica encodes animal-related NF- T3SSs that are necessary for the infection of both animals and plants by this bacterium [111]. Hahella chejuensis, a marine Gamma- proteobacterium, is a potential biological agent to fight algae [112] but it is also part of the goat milk microbiota [113], and encodes two Ysc NF-T3SSs of unknown function. Interestingly, such mismatches between NF-T3SS and eukaryotic host (Figure S4) are only present in animal-protozoa systems that are able to interact with plants. Their study might provide clues on the historical adaptation of the ancestral NF-T3SS, which encoded a needle, to a cell-wall adapted pilus that can interact with plants. These observations also suggest a certain degree of flexibility in the interactions of NF-T3SSs with plant and animal hosts. Discussion The phylogeny of the ATPase, the multiple recruitments of secretins and the finding of highly conserved basal NF-T3SSs qualitatively change our views on the evolution of the NF-T3SS. In this work we provide independent lines of evidence showing that the flagellum was primordial and that the NF-T3SS arose via exaptation. Firstly, the ATPase tree robustly roots the T3SS tree within flagella (Figure 3). Secondly, confirming prior results [93], the phylogenetic distribution of the flagellum is much broader than that of the NF-T3SS. Thirdly, our data suggests that the last common ancestor of the NF-T3SSs lacked a secretin. Hence, effector delivery into eukaryotic cells was probably not an ancestral trait of NF-T3SS. T3SS exaptation Our insights also allow us to propose a scenario for the evolution of the NF-T3SS (Figure 7). Initially, T3SS evolved to transport extracellular flagellar components [56]. The flagellar T3SS is not only an essential component of the flagellum but variants have also evolved to transport other proteins, e.g. virulence factors in Campylobacter jejuni and Y. enterocolitica [114,115]. In the endomu- tualist non-motile Buchnera spp., the locus encoding flagellum components is reduced to the basal body, which has been PLOS Genetics | www.plosgenetics.org 6 September 2012 | Volume 8 | Issue 9 | e1002983