Introduction

Magnetotaxis couples the biomineralization of ferrimagnetic nanoparticles in organelles called magnetosomes, to a complex system of aero-chemotaxis for guiding the locomotion of magnetotactic bacteria (MTB) parallel to the Earth’s magnetic field lines [1]. This function is particularly well described in a group of freshwater MTB of the Alphaproteobacteria class represented by the Magnetospirillum genus (MTBMag). Magnetotaxis is assumed to facilitate vertical navigation toward their optimal niches located at the oxic-anoxic transition zone [2]. Our knowledge of the genetic basis, ecology and biophysical processes involved in magnetite magnetosome biogenesis was built mainly from the study of two model strains, Magnetospirillum gryphiswaldense strain MSR-1 [3] and Magnetospirillum magneticum strain AMB-1 [4,5,6]. Since their first observation, numerous other spirilla were isolated and affiliated to the same group based on phenotypic, physiological and morphological features, among which the ability to form magnetosomes [7,8,9,10,11]. As for many prokaryotes, the increasing biodiversity assessment and the development of molecular typing revealed the polyphyletism of magnetotaxis in freshwater Rhodospirillaceae (Alphaproteobacteria) [8, 12]. Members of two genera with different lifestyles: Phaeospirillum and Dechlorospirillum are actually more closely related to some Magnetospirillum lineages than what some Magnetospirillum lineages are to each other [7, 8, 12, 13]. The genus Phaeospirillum contains spiral-shaped, phototrophic, purple nonsulphur bacterial species [14], while Dechlorospirillum, now affiliated to the Magnetospirillum genus based on phylogenetic analyses, is represented by non-MTB only [15, 16].

The polyphyletism of magnetotaxis and the lack of a clear correlation between genetic clusters and ecology created some confusion in the classification of these organisms that remains partially resolved [17]. Today, we are still unable to state whether or not magnetotactic Magnetospirillum form their own genera [8, 18] because their specific ecological boundaries have not been identified yet and they do not form a monophyletic group [8, 12]. Current data support the existence of two genetically distinct groups represented by strains MSR-1 and AMB-1, respectively [8]. All magnetotactic strains affiliated to the Magnetospirillum genus fix carbon dioxide through the Calvin-Benson-Bassham cycle with the presence of a form II ribulose-1,5-bisphosphate carboxylase/oxygenase gene in their genome [8, 19], and all seem to fix atmospheric nitrogen [20, 21]. Other shared features of described magnetotactic Magnetospirillum species relate to biomineralization. They form a single chain of biomineralized cuboctahedral crystals of magnetite, have a bipolarly flagellated helical shape and a respiratory form of metabolism that uses organic acids as a source of carbon and electrons [3]. Moreover, the magnetite synthesis occurs only at very low levels of oxygen or under anaerobic conditions when nitrate is the alternative terminal electron acceptor to oxygen [22,23,24,25]. Their metabolic specificities are less obvious to pinpoint, maybe because some traits are variable within species or because they were insufficiently characterized. It seems that their requirement for energy source and carbon source may vary according to the strain. For example, while most species are facultative anaerobes that utilize nitrate as an alternative terminal electron acceptor to oxygen, M. magnetotacticum is an obligate microaerophile that requires oxygen even when growing with nitrate [22] and M. gryphiswaldense can grow autotrophically using reduced sulfur compounds as electron donor [26].

This high degree of phenotypic homogeneity of magnetic spirilla suggests an adaptation to similar environments that exert important constraints on their metabolism and magnetotaxis. From an evolutionary perspective, the common genetic determinism to all MTB indicates a single emergence of magnetotaxis in prokaryotes. Magnetosome biogenesis is encoded by unique genes (referred as the mam and/or mms genes) that are, for most of them, clustered into operons within a specific genomic region [27,28,29]. Compiling studies show both evidence of vertical inheritance of these genes [12, 30, 31] and multiple acquisitions by horizontal gene transfer (HGT) in some lineages in MTB of the Alphaproteobacteria class [32,33,34] with duplication events [34, 35]. These observations raise questions on the evolutionary mechanisms shaping the adaptation to this ecological niche and the phenotypic maintenance at such level of phylogenetic distance between two evolutionarily distinct lineages.

Selection contributes to divergent evolution and different ecological speciation in the presence of reproductive isolation [36]. However, similar environments in different locations may promote parallel or convergent evolution of traits and maintain a high degree of phenotypic similarity in independent and divergent populations [37]. Tracking the genetic parallelism involved in parallel ecological speciation may help to better understand the mechanisms of adaptive evolution. Because similar niches may exert the same degree of evolutionary constraint on traits, the same de novo beneficial mutations are likely to be repeatedly selected and fixed in populations [37,38,39]. In microorganisms, other evolutionary forces than mutation, like homologous recombination or orthologous replacement mediated by HGT generate genetic variation [40,41,42]. In prokaryotes, the contribution of these mechanisms in parallel evolution specifically has been less documented [43], although HGT and homologous recombination could promote the repeated exchange of beneficial alleles in genetically distant organisms, purge the genic variability to maintain phenotypic and ecological cohesiveness in an ecotype [44]. In laboratory-controlled experiments, recombination has been shown to alleviate clonal interference and accelerate adaptation of Escherichia coli populations under some circumstances [45]. In natura, two divergent populations inhabiting the same habitat are more likely to exhibit weaker barrier to gene flow than do different ecotypes, regardless the genetic distance [42, 46]. Our understanding of these processes leading to ecological differentiation in bacteria suffers from the lack of niches and habitats studied. Indeed, our vision has been built mainly from studies on pathogens [44]. But a broader investigation of environmental niches and ecotypes may help to map bacterial diversity onto ecology involving other traits than those related to cell surface, DNA binding and pathogenicity-related functions [47].

Here, we investigated the evolutionary mechanisms involved in the parallel evolution of magnetotaxis in two distinct groups of magnetotactic Magnetospirillum species. We particularly tested the hypothesis that recombination sensus lato could be involved in the maintenance of highly homogenous phenotypes in two divergent lineages keeping them adapted to very similar niches. We studied the biology and genome of newly isolated freshwater magnetotactic and nonmagnetotactic Magnetospirillum related species. By comparing gene contents and inferring phylogenies based on whole genomes and magnetosomes associated genes, we showed that ancestors of these groups exchanged their magnetosome gene clusters (MGCs) several times over the course of magnetotactic Magnetospirillum diversification, which might have been at the origin of the maintenance of a high degree of global genomic conservation and phenotypic similarity. Our results showed that repeated gene exchanges of entire operons involved in sensing and motility may contribute to the parallel evolution of species facing similar environmental constraints, which likely accelerate their adaptation to microoxic conditions.

Materials and methods

Genomes collection and growth of bacteria

Draft and closed genomes of all Rhodospirillaceae available in October 2017 were downloaded from the public repository database at NCBI and uploaded into the MicroScope platform for their automatic and manual annotation [48]. Sequencing and assembling of Magnetospirillum magneticum AMB-1 [49], M. gryphiswaldense MSR-1 [50], M. magnetotacticum MS-1 [51], M. caucaseum SO-1 [52], M. marisnigri SP-1, M. aberrantis SpK [53], M. bellicus VDY [54], Magnetospirillum sp. XM-1 [55], Magnetospirillum sp. ME-1 [56], P. fulvum MGU-K5 [57], and P. molischianum DSM120 [58] were described previously. Draft genome assemblies of nonmagnetotactic Magnetospirillum strains CP2, CP3, VDY, and WD, and those of Phaeospirillum strains DSM 114, DSM 115, DSM 117, and DSM 13234 were provided by the Joint Genome Institute (www.jgi.doe.gov) and described in supplementary Table S1. This list was completed with five genomes sequenced in this study. Genomes of magnetotactic strains LM-1, SS-4, UT-4, LM-5, and CP-1 were sequenced and assembled following the exact procedure described in [34] based on genomic DNA obtained from axenic cultures. Their sampling sites, the isolation procedure and culture medium were described in [8], with the exception of strain CP-1 reported here for the first time. Strain CP-1 was isolated using a similar procedure as previously described [8], from the freshwater river Couze Pavin, Auvergne, France (45°30′35.0″N, 2°54′12.6″E). Chemolithoautotrophic growth experiments were carried out on strains AMB-1, SS-4, CP-1, MSR-1, UT-4, LM-1, and LM-5 using a similar semisolid growth medium as previously described [8] but removing sodium acetate and sodium sulfide and adding after autoclave 3 ml of 40% sodium thiosulfate (Na2S2O3 · 5H2O). Thiosulfate was deemed positive for the support of growth if three conditions were met: (i) a band of cells formed in the tube, (ii) the band after growth was significantly thicker than the control containing no thiosulfate and (iii) cells continued to grow in the same medium in three successive transfers. The draft genome sequences partially annotated of LM-1, SS-4, UT-4, LM-5, and CP-1 were submitted to the European Nucleotide Archive and carry the accession numbers PRJEB35448, PRJEB35447, PRJEB35446, PRJEB35445, and PRJEB35444, respectively.

Light and electron microscopy

Motility and magnetotactic behavior of the different Magnetospirillum strains were analysed and recorded under the light microscope Leica LMD6000 equipped with the camera Leica DMC 4500. Transmission electron microscopes (TEM) was used to analyse the ultrastructure of Magnetospirillum strains directly deposited onto TEM copper grids coated with a carbon film. Magnetosomes shape and organization were visualized with a Tecnai G2 BioTWIN (FEI Company, Eindhoven, Netherlands) equipped with a CCD camera (Megaview III, Olympus Soft imaging Solutions GmbH, Münster, Germany) with an accelerating voltage of 100 kV.

Comparative genomics

Evolutionary relationships between Magnetospirillum-related species and their closest members of the Rhodospirillaceae family were investigated using whole genome sequences. Clusters of orthologous were defined using the OrthoMCL clustering algorithm implemented in GET_HOMOLOGUES open-source software [59]. We considered any cluster of orthologous proteins for which pairwise BLASTP alignments had an expectation value E < 10−5 and a minimal protein coverage of 50%.

Genomes and encoded proteomes of Magnetospirillum species and their closest relatives were compared with several complementary algorithms to define sub-groups/species based on their nucleotidic/amino acid composition: (i) Average nucleotide identity (ANI) and average amino acid identity (AAI) values were calculated using the ANI/AAI-Matrix online service (http://enve-omics.ce.gatech.edu/g-matrix/) [60] using reciprocal best hits (http://enve-omics.ce.gatech.edu/), (ii) digital DNA-DNA hybridization (dDDH) values were determined using the Genome-to-Genome Distance Calculator (2.1; https://ggdc-test.dsmz.de/ggdc.php) using the recommended BLAST + alignment and formula 2 (identities/HSP length) [61] and (iii), percentages of conserved proteins (POCP) [62] were calculated using the script runPOCP.sh [63].

Metabolic pathways were predicted with the microscope platform [64] using the PathoLogic algorithm [65], which computes an initial set of pathways by comparing genome annotations to a collection of microbial Pathway/Genome Databases MicroCyc derived from the metabolic reference database MetaCyc [66]. For each MicroCyc pathway, the tool gives the completion value referring to the number of reactions in a given strain/total number of reactions in the same pathway defined in the MetaCyc database.

The presence of conjugative system was checked in all genomes using MacSyFinder software and the TXSScan module [67, 68], which uses HMM profiles for efficient genomic detection of bacterial secretion systems encountered in diderm-LPS bacteria, and their discrimination from homologous machineries.

Statistical analyses

Statistical analyses were performed in R version 3.5.1 [69]. Averages of AAI and POCP values estimated from the pairwise comparison of genomes sets were compared either by the Student’s t test or by the nonparametric Mann–Whitney U test (if the underlying assumptions of the first test were not satisfied). Differences were considered significant when P values were below 0.05.

A principal component analysis (PCA) was performed using the ade4 package [70] to compare metabolic pathways of the 23 Magnetospirillum relatives using a reduced matrix of MicroCyc pathway completion values generated with the MicroScope platform. The reduced matrix consisted of the 99 pathways whose completion was variable between groups among the 410 nonredundant pathways detected in at least one genome.

Phylogenetic analyses

For phylogenetic analyses, only clusters with single-copy sequences were taken into consideration and in-paralogs were excluded. All complete gene outliers were removed with Phylo-MCOA software [71]. For the species tree,7 amino acids (AA) sequences of 839 orthologous proteins were aligned independently using MAFFT [72] and alignments were trimmed using BMGE [73] setting block length to 3, and concatenated into a final alignment of 269,968 AA positions among which 151,377 were polymorphic. The maximum likelihood tree was built from the concatenated sequences with IQ-TREE [74] using a partition model; the substitution model for each protein was selected by ModelFinder [75] with the Bayesian Information Criterion. The statistical support of the branches was estimated by the ultrafast bootstrapping approach implemented in IQ-TREE applying 1000 replicates. A previous study suggesting that strain LM-1 was a new freshwater MTBMag genus [8], we included this strain in the external group for phylogenetics and comparative genomics.

Evolution of genes encoding for proteins involved in magnetosome biogenesis was studied by reconciling binary gene trees built from gene-by-gene alignments of mam genes or their concatenation with the nonbinary species tree under the duplication-transfer-loss (DTL) parsimony algorithm implemented in Notung 2.9 software [76]. The algorithm captures gene duplication (D), transfer (T) and loss (L) driving tree incongruence and infers all optimal solutions to finally report the complete and temporally feasible event histories giving the data.

Results

Species of magnetotactic Magnetospirillum do not form a monophyletic group at the whole genome level

We built a phylogenetic framework to study the evolution of magnetotaxis in MTBMag at the whole genome scale using draft genomes of freshwater magnetotactic and non-MTB close to Magnetospirillum gryphiswaldense MSR-1 or M. magneticum AMB-1 (Table S1). A first phylogenetic tree based on all proteins shared by strains representing the Rhodospirillaceae diversity and related other Alphaproteobacteria confirmed that all 23 Magnetospirillum relatives in this study cluster together at the genome level and positioned strain LM-1 as the closest freshwater strain of this group (Fig. S1). Based on this phylogeny and what we currently know about the biology of strain LM-1 [8], this strain represents a new genus. Whereas Magnetospirillum species exhibit a spirillum shape with flagella at both poles and synthesize cuboctahedral crystals, strain LM-1 displays a vibrio shape with a single polar flagellum and synthesizes elongated prismatic crystals resembling those of Magnetovibrio blakemorei strain MV-1 [8]. Despite these morphological similarities between MV-1 and LM-1, the proposed LM-1 genus is much closer to freshwater Rhodospirillaceae MTB than to marine Rhodospirillaceae MTB. Thus, we propose the name Candidatus Magneticavibrio boulderlitore (the magnetic vibrio isolated from the shore of boulder beach in Lake Mead) [8]. We further used strain LM-1 as a control and external outgroup to Magnetospirillum related taxa in this study.

The phylogeny of Magnetospirillum related species only was then reconstructed based on 839 orthologous proteins selected after all complete gene outliers were removed [71]. The tree topology was partially congruent with those of the trees built from 16S rRNA sequences of some strains in previous studies [8, 17]. For example here, the strain UT-4 clusters with the MSR-1 clade (Fig. 1a), while it was supposed to be ancestral to all MTBMag. The strain CP-1, isolated here from the Couze Pavin River, France, clusters with the ancestor of all AMB-1 related strains. Together, all Magnetospirillum related species form four monophyletic groups (namely SpK, MSR-1, MGU-K5, and AMB-1 clades), among which two: MSR-1 and AMB-1, are composed of MTB only. The nonmagnetotactic MGU-K5 clade (Phaeospirillum species) shares a more recent ancestor with the AMB-1 clade composed of strains ME-1, XM-1, SO-1, AMB-1, SS-4, SP-1, and CP-1. The SpK clade (formerly Dechlorospirillum including M. aberrantis) is composed of non-MTB only (CP2, CP3, VDY, WD, and SpK) and shares a more recent ancestor with the MSR-1 clade composed of magnetotactic strains LM-5, BB-1, MSR-1, and UT-4. These two polyphyletic groups regarding magnetotaxis relate to each other with a direct common ancestor.

Fig. 1: Genomic insight into the evolution and similarities of Magnetospirillum relatives.
figure 1

a Phylogeny of Magnetospirillum species rooted with strains representing other Rhodospirillaceae species (gray). The Maximum-likelihood tree was drawn to scale and branches length represents the number of base substitutions per site. Black circles represent nodes supported by 100% of the replicates. Names in bold represent MTB strains. Strains related by branches with the same color represented different clades distinguished here, and could be considered as different genera according to the average amino-acid identity (AAI) (Fig. S2) and their lifestyle. b Histograms drawn to scale showing the number of orthologous proteins specific to a group of bacteria that are shared by all members of this group (black bars represent 100 proteins). The first, second and third histograms give the number of proteins specific to (1) each clade, (2) the MSR-1/SpK group vs. AMB-1/Phaeospirillum group, and (3) MTB groups vs. non-MTB, respectively. c Pairwise comparison of percentages of conserved proteins (POCP) (Fig. S3) and average amino-acid identities (AAI) between the strains of the four groups ordered according to the phylogenetic tree presented in panel a. Circles and colors are proportional to the values that represent averages and standard errors calculated from the pairwise comparisons within each group. All the values are significantly different from each other (Student t test, n = 23, P < 0.05). d Principal component analysis of the metabolic networks of strains predicted with the MicroCyc resource implemented in MicroScope with the projection of ellipses and gravity centers of classes representing the phylogenetic groups.

Lifestyle and environment maintain genetic relatedness and phenotypic homogeneity in two divergent magnetotactic lineages

The intriguing polyphyletism of magnetotaxis in MTBMag and the high degree of phenotypic divergence of species of the MGU-K5 and SpK clades raised questions about the definition of Magnetospirillum as a genus. By calculating several indexes that are generally used to refine taxonomic boundaries for prokaryotes like the AAI, ANI, dDDH or POCP, we investigated the support of their classification at the genome level (Fig. S2S5). The comparison of genomes pairwise within and between monophyletic groups confirmed the existence of four clades for which AAI values ranged from 64 to 70% (Fig. 1c). These values justify a new genus description for each group according to previous large metadata analyses assuming a significant ecological differentiation [60]. Here, it was interesting to observe higher POCP values between all magnetotactic species than between these species and their genetically closer nonmagnetotactic species, which showed that MTB lifestyle fostered the maintenance of similar genome contents (Fig. 1c). On the basis of their phenotype, different magnetotactic species studied here and previously were difficult to distinguish using light and electron microscopy approaches [3, 4, 7,8,9,10,11, 26, 77]; they share all very similar magnetotactic behaviors, motilities, cell ultrastructures and magnetosome morphology/organization (Fig. S6). Experimental attempts to find a different physiology specific to one of the two groups failed too. According to the literature, chemolithoautophy with thiosulfate as electron donor was potentially the only difference between AMB-1 and MSR-1 [26].

We tested this hypothesis in silico by comparing whole genomes and noticed that some genes involved in the thiosulfate-oxidizing Sox enzyme system were specific to the MSR-1 clade (Table S2). Testing chemolithoautotrophy with thiosulfate as electron donor for strains of both clades, we showed that not all members of the MSR-1 group, such as strain LM-5, were able to use thiosulfate as energy source, while none of the cultured species tested of the AMB-1 group grow in such conditions. No other clear interpretation could be made about the biological differences between magnetotactic Magnetospirillum lineages. We thus looked for other genomic evidences of clear biological boundaries by reconstructing the metabolic pathways. PCA built from the matrix of pathway complementation (Fig. 1d, Table S3), confirmed that Phaeospirillum species do not cluster with the other lineages and that AMB-1 clade is metabolically closer to that of MSR-1, than MGU-K5 and SpK clades. Searching pathways that participate the most to the variability for both PCA axis, we confirmed that MGU-K5 relatives use light-harvesting complexes with the impossibility to denitrify, degrade alanine or produce vitamin B12. Differences between the three other groups were much less significant and were associated, for example, to creatinine degradation, cyclopropane fatty acids, spermidine and preQ0 metabolite biosynthesis. In the absence of significant ecological differentiation for the nonphotosynthetic clades, there is no support for the creation of two genera for AMB-1 and MSR-1 clades.

Conservation of mam genes composition and synteny supports magnetotaxis was functionally constrained by similar selective pressures

Draft versions of the MGCs were reconstructed for the new genomes, and despite the incompleteness of some operons, several observations were validated. First, the feoABm, mms6, mamGFDC, mamAB, and mamXY gene clusters encoding proteins involved in magnetosome biogenesis were found in all genomes with a very high degree of synteny conservation within operons (Fig. 2). Most of the strains carry an additional mamJOE-like gene cluster downstream mamV and mamW. If present, this cluster of paralogs was followed by several orthologous proteins localized upstream mamXY operon, among which some are specific to MTBMag. For instance, a homolog of the ferric uptake regulation protein Fur is often present in the magnetosomes gene cluster and in M. gryphiswaldense MSR-1, a homolog that was previously shown to affect magnetite biomineralization, is present outside the MGC [78]. With the exception of LM-5, whose MGC organization is almost identical to that of the AMB-1 cluster, strains of the MSR-1 group harbor a slightly different structure. The apparent global conservation of the MGC in Magnetospirillum spp. could support their orthology in freshwater MTBMag. However, we found several genomic features, typical of mobile regions and genomic islands that could be responsible for genomic instability, recombination and HGT. Transposases, integrases and recombinases (e.g., homologs to y4qJ, members of the IS110/IS3/IS407 family) were found in the vicinity or within the MGCs of several strains (e.g., AMB-1, ME-1, UT-4, MSR-1), some of which are phage-related or even involved in a functional conjugation system (e.g., virB6, virB8, virB9 of Type 4 Secretion System) [79, 80]. It should be noted the presence of two copies of mamJ in the mamAB operon of strain LM-1. Although the percentage of similarity of its encoded protein is low compared with MamJ copies of members of the Magnetospirillum genus, it shows that this gene is not restricted to the magnetotactic spirilla from freshwater. In strains MSR-1 and AMB-1, MamJ was shown to interact with MamK filament and thus involved in magnetosome chain formation [81, 82].

Fig. 2: Composition and gene synteny of the feoABm, mms6, mamGFDC, mamAB, and mamXY operons encoding for proteins involved in magnetosome biogenesis in magnetotactic Magnetospirillum species and other conserved genes and mam paralogs with putative function in magnetosome biogenesis.
figure 2

Sequences are organized according to species phylogeny. Homologous genes are symbolized by the same letters and their relative 5′-3′ orientation compared with each other’s is given by the bottom line color (red or black). A vertical blue dotted line between two genes symbolizes a truncation (contig edge) while a grey slash denotes that two genes are related through a continuous genomic region of one or more genes. Genes are next to each other if they are not separated by a slash. The additional paralogous mam genes (the mamJOE-like operon or a duplicated genes set of mms6, mmsF, mag1, and mag3 for example) are associated with a quotation mark. Paralogous mam genes were found on very short contigs outside the MGC in CP-1 and were not shown on this figure (mamOBQ and feoABm for example). Genes h1 to h4, m1 to m3, and furm represent unknown homologous genes conserved in many MGCs, the mag genes previously described [34] and a homolog of the ferric uptake regulator fur specific to the MGC, respectively. The accession number of these genes in the reference genome AMB-1 are BAE49759, BAE49764, BAE49812, BAE49814, BAE49823, BAE49824, BAE49825, and BAE4981, respectively.

Operons involved in magnetotaxis were acquired and lost repeatedly in the course of the Magnetospirillum evolution

The evolutionary history of magnetotaxis was investigated by reconstructing phylogenies based on known magnetosome-associated proteins described in MSR-1 and AMB-1 genomes that are shared by all strains used in this study. We checked the automatic annotation manually gene by gene for rare ambiguous cases. Gene orthology was then tested by comparing gene and species trees topologies. Trees reconstructed from each of the 31 mam genes/proteins conserved in all Magnetospirillum draft and closed genomes were consistent with each other within putative operons. However, some nodes were not always well statistically supported because some AA and DNA sequences were almost identical between genomes. Indeed, for numerous magnetosome-associated proteins, AA sequences identity percentage was up to 25% higher than the average AAI value. For example, MamH sequences were 100% identical between AMB-1, ME-1, and SP-1 while the AAI values of their genomes compared pairwise were between 75 and 87%. Unless a strong negative selection pressure purified polymorphism over Magnetospirillum speciation history, such result was congruent with allelic exchange. Trees topologies built from the concatenation of Mam proteins and genes were incongruent with that of the species evolutionary history (Fig. 3). They showed magnetotaxis has a common origin, but does not share the same ancestry in Magnetospirillum and has been regularly transferred between ancestors by homologous recombination and/or HGT events. The mms6/mamGFDC and mamAB operons had the same history (Fig. S7) so data were combined to build one tree (Fig. 3b). This history was different for the mamXY operon (including here the mag genes) (Fig. 3c). The feoAB evolution could not be totally resolved because the polymorphism was too low and the degree of site saturation too high (Fig. 3d). From these trees, the most obvious incongruences between the species tree and magnetotaxis trees were for the relationships between strains LM-5 and CP-1 with the rest of the lineages, even if conflicting signals were globally observed for all strains. Indeed, we confirmed at the whole genome level that although strain LM-5 belongs to the MSR-1 group, its magnetosome genes were most closely related to species of the AMB-1 group [8]. For strain CP-1, isolated in this study, it is the opposite; CP-1 belongs to the AMB-1 group but its MGC shared a more recent ancestry with bacteria of the MSR-1 group.

Fig. 3: Evolutionary history of proteins involved in magnetotaxis in Magnetospirillum relatives.
figure 3

a Species tree from Fig. 1a. Gene trees built from the concatenation of Mam proteins present in b mms6, mamGFDC and mamAB operons, c the mamXY operon (including here the mag1, 2, and 3 genes) and d the feoABm operon. Strains names and external branches are colored according to the subgroups of the first panel to facilitate the visualization of relationships in gene trees. Gene trees were rooted with the other magnetotactic Alphaproteobacteria of the Fig. 1a including strain LM-1.

To go further, we inferred the most parsimonious scenarios explaining such evolutionary histories of the magnetosome genes by reconciling these gene trees and the species tree under the DTL model implemented in Notung 2.9 software [83] (Fig. 4). Under such a model, the ancestor of the four monophyletic groups of magnetotactic and nonmagnetotactic species had a magnetotactic ancestor. Magnetotaxis was then lost in the SpK and MGU-K5 groups (Figs. 4 and S8). The MGCs of the UT-4 and CP-1 strains represent the most ancestral forms of the MGC in the MSR-1 group and AMB-1 group, respectively. However, an ancient HGT event replaced the whole MGC of the most recent MSR-1 group species by an ancestral form that has emerged anciently first in the AMB-1 clade. This event was followed by other similar events of orthologs replacement during the Magnetospirillum diversification within and between groups. Importantly, several paralogs of the mamQ, mamR, and mamB genes seem to have been horizontally transferred together with the mamAB operon during the AMB-1 clade diversification. These genes are identical or nearly identical in the closest lineages of the AMB-1 clade and have likely emerged recently. Further analyses using a larger dataset will be needed to test the evolutionary relationships of these paralogs with the mamJOE-like gene cluster. This later likely emerged from duplication of mamJOE in the ancestor of all Magnetospirillum spp. of AMB-1 group (Fig. 4). The mamQRB paralogs present in AMB-1 closest relatives seem to have emerged from a different and more recent duplication event than that linking the mamMOBQ paralogs in CP-1, SP-1, and SS-4.

Fig. 4: Most parsimonious scenario describing the evolutionary history of mms6, mamGFDC and mamAB operons along with the diversification of Magnetospirillum species.
figure 4

Events of gene duplication (D), loss (L) and transfer (T) were inferred using the duplication-transfer-loss (DTL) model of Notung 2.9 software [76] by reconciling the tree based on the concatenation of shared mam AA sequences (thin cladogram, Fig. 3) with the species tree (thick grey cladogram, Fig. 1). Colors symbolize divergent clades or lineages of the species tree. The color of the internal branches shows the ancestry of the genes encoding for magnetosome-associated proteins. For horizontal gene transfer events, the name of the donor lineage associated is given. The black solid lines represent the vertical inheritance of the genes while the black dotted lines represent their loss. D* denotes a putative duplication event that could have occurred in the ancestor of AMB-1 clade and led to the emergence of both ancestors of the mamJOE-like cluster.

Discussion

Determining the evolutionary forces shaping genomic polymorphism allows to identify key features involved in microbial adaptation and to resolve their evolutionary histories. In prokaryotes, genetic parallelism was identified by the detection of repeated emergences of the same de novo beneficial mutations [37,38,39]. Here, we showed that multiple allelic exchanges of whole operons mediated the parallel evolution of magnetotaxis in two evolutionarily distinct groups of bacteria. We thus provide evidence that another force than mutation can participate in the maintenance of highly similar phenotypes within a group of phylogenetically distant prokaryotes sharing the same ecological niche. Parallel evolution of distantly related populations is favored when they experience similar selection pressures [37, 43]. Freshwater magnetotactic species cluster into two genomic genera for which it was difficult, even impossible, to identify biological and ecological boundaries. Although, these two species clades represented by AMB-1 and MSR-1 strains, could represent two different genera and carry on different names, we thus believe that the absence of these boundaries impedes the amending of the Magnetospirillum genus name of either the AMB-1 or MSR-1 groups.

Here, these results raise several questions about the role of magnetotaxis with microbial adaptation to habitats at the oxic-anoxic interfaces of freshwater sediments. A part of MTBMag similarity could not be associated to phylogenetic inertia solely, but more likely to adaptation of similar environmental constraints [84]. Did magnetotaxis trigger the ecological cohesiveness of these divergent lineages? Indeed, magnetotaxis is known to optimize bacterial motility along with redox and chemical gradients [2, 85]. Repeated acquisition of beneficial alleles could thus speed up microbial adaptation to microoxic settings by optimizing the sensing or facilitating magnetosome formation in specific conditions. Instead, it is also possible that these narrow and unstable niches selected few specialized catabolic reactions on which magnetosome biogenesis depends on [86,87,88,89]. In that case, magnetotaxis selection would arise secondarily from divergent populations already ecologically cohesive that exploit the same redox reactions and carbon sources. According to the theory, this cohesiveness arises when few adaptive solutions exist to face the environment, which in turn fosters the genetic parallelism or even convergence [37]. Gene flow and allelic exchange are known to allow the recipient bacteria with pre-existing adaptations to invade a new niche. However, in this specific situation, it can also improve its performance in its current niche [90]. Given our data, this second scenario is the most parsimonious explanation, but in any case, they both support that magnetotaxis is an important adaptation to oxic-anoxic interfaces.

For years, studies compiled evidences of the MGC transferability between MTB and non-MTB. Adaptive transfer of genes is limited to those that can be transferred as a functional unit, provide a niche-transcending adaptation, and are compatible with the architecture and physiology of other organisms [42]. To make the exchange possible, genes must fit on a chromosomal segment short enough to be transferred or they must fit on a mobile extrachromosomal element [41]. The MGC totally fits with all these requirements. First, the heterologous expression of mam operons in foreign species with compatible physiology led to the formation of magnetosomes [91]. Then, these genes are surrounded by mobile elements from type IV secretion systems involved in conjugation, transposases with a high degree of conservation and phage elements [29, 92]. Interestingly, numerous similar mobile elements are surrounding the magnetosome islet, observed so far in the genome of M. Magneticum AMB-1 only [93, 94]. This genomic region harbors few mam genes homologs, whose acquisition has been related to an HGT event from the Ca. Etaproteobacteria strain MC-1. However, this scenario is unlikely because of their homology with Magnetospirillum mam genes. Data rather support that the AMB-1 islet is the remnant of one or several independent ancient events (including duplication and/or HGT) that occurred in the early time of Magnetospirillum groups emergence. Currently, the lack of sequence conservation and the dramatic evolutionary acceleration of Mam homologs in the islet could result from a neofunctionalization and prevent to fully resolve their history in the light of the current data.

So far, the contribution of gene flow and allelic exchange to magnetotaxis evolution was formally evidenced for ancestors of closely related bacterial genera only [34]. The current evolutionary scenario proposes that these forces did not contribute to magnetotaxis evolution at larger taxonomic scales [30, 31]. However, this unexpected scenario relies on big assumptions, which led to other authors to question it and to state that HGT contributed in the early steps of phyla emergences [33]. Only new genomes of deep branching lineages and proper analyses will resolve MTB evolution that very likely involve mutation, recombination and duplication events. The parallel evolution of magnetotaxis observed in the Magnetospirillum clades may have occurred at larger taxonomic scales between MTB donors and nonmagnetotactic recipient lineages with compatible physiologies and sharing the same ecological niches. The successful transformation of Rhodospirillum rubrum [91] with the MSR-1 MGC showed that such event is possible. In most aquatic habitats, oxic-anoxic interface niche represents a tiny layer of 100 µm in thickness where microaerophilic microorganisms thrive due to the overlap of reduced and oxidized chemical species. This layer is a very coveted zone and thus a hot spot for microorganismal adaptation where adaptive solutions may be reduced [95].

Multiple genome sequencing projects revealed years after years the multi-faceted evolution of magnetotaxis with evidences of both vertical and horizontal inheritance [17, 31,32,33,34]. Despite the polyphyletism of magnetotaxis at the phylum level, some authors argued for a vertical inheritance of the MGC followed by multiple and independent losses in non-MTB clades. Here, we showed further evidence that genetic exchanges may explain this polyphyletism at the genus level. Because our sample was limited to few strains collected worldwide over a large time scale, we undoubtedly underestimated the number of events, including potential duplications [35]. Repeated de novo mutation might have also contributed in some extent to the parallel evolution of the function, but our approach was not suitable to identify such events. In the case of magnetotaxis, recombination between distantly related bacteria could represent a more parsimonious and rapid solution for adaptation compared with independent and repeated de novo mutations. The reason comes from the MGCs architecture: magnetosome biogenesis relies on a set of operons involving tens of interacting proteins that certainly coevolved to optimize the function [5]. Thus, any mutation optimizing the function of a single gene would not necessarily optimize the function itself and could even decrease it if other beneficial mutations do not occur at the same time. Selection acting at the operon level rather than on genes individually, homologous recombination of entire operons could rapidly purge the diversity and spread the beneficial mutations in the population. It is important to further test these hypotheses using MTBMag and experimental evolution approaches. Such study would definitively quantify the relative role of gene flow compared with mutation in speeding up adaptation when this later involves large operons of interacting genes and functions as complex as biomineralization.