recombination is one of the main mechanisms generating genetic variation . failure to properly account for recombination can seriously undermine the validity of molecular evolution studies.1
the need to account for recombination led to the development of a number of recombination detection programs ( see http://bioinf.man.ac.uk/recombination/ for a comprehensive list ) .
recombination detection algorithms can be separated into 4 main categories : distance - based , phylogenetic - based , compatibility - based , and substitution distribution - based.2 here , we concentrate on phylogenetic - based methods that detect discordant phylogenetic relationships along a sequence alignment .
the most sophisticated model - based recombination detection methods rely either on hidden markov models3 or on bayesian multiple change - point models.4 we chose to work with the bayesian dual multiple change - point ( dmcp ) model of minin et al,5 implemented in the java package dualbrothers , because this approach has been successfully used in a wide range of molecular evolution studies that include detecting recombination in rhodopsin genes in freshwater bacterioplankton,6 studying lateral gene transfer in prokaryotes,7 and selecting non - recombinant portions of genes for genealogical reconstruction in leavenworthia alabamica,8 to name a few .
moreover , dualbrothers proved to be more accurate in estimating recombination breakpoint locations relative to other competing approaches.2
the bayesian dmcp model detects recombination while accounting for changes both in tree topology and evolutionary rates across the nucleotides of aligned dna sequences .
the posterior distribution of the dmcp model is analytically intractable , so the model parameters are approximated by a markov chain monte carlo ( mcmc ) algorithm . as with many bayesian phylogenetic methods ,
the most challenging aspect of the mcmc in the context of the dmcp model is sampling over tree topologies that relate molecular sequences under study .
when the number of sequences exceeds 6 , it becomes computationally infeasible to explore all of the possible topologies during mcmc . to address this issue ,
dualbrothers restricts the search of the tree space to a pre - specified set of topologies . to produce a reasonable set of candidate trees we use a sliding window approach , repeatedly restricting attention to a subset of the alignment sites.9 our package , rbrothers , uses bionj , a neighbor joining tree reconstruction algorithm,10 to create a candidate tree from each sliding window that we shift along the alignment by a pre - specified number of sites .
the bionj - based phylogenetic reconstruction is repeated until we reach the end of the alignment .
for some data , each sliding window may not contain enough information to reconstruct a phylogeny with confidence , leading to omission of highly probable trees during the formation of the set of candidate trees . to overcome this difficulty ,
rbrothers includes a novel bootstrapping option , which instructs rbrothers to create a bootstrap sample of phylogenies estimated by the bionj method for each sliding window . as input ,
if the alignment contains less than 7 sequences , all possible unrooted phylogenetic topologies will be considered during the dmcp model - based recombination detection .
if there are more than 6 sequences , a window size and a step size are required in order to form a set of candidate trees .
after pre - prosessing steps that heavily rely on the r package ape,11 rbrothers calls dualbrothers via the rjava package to produce a mcmc sample approximating the posterior distribution of all model parameters . to monitor convergence and mixing of mcmc , rbrothers uses the coda package12 and provides a trace plot of the log likelihood along with an autocorrelation plot of the log likelihood via a single command . our package , rbrothers , makes use of rjava to interface with dualbrothers , allowing the package to be used on all major operating system platforms ( windows , mac osx , and linux ) .
the rbrothers source code and a companion web page ( http://evolmod.r-forge.r-project.org/ ) contain extensive documentation , a detailed tutorial reproducing 1 of the examples from minin et al,5 and 2 demo r scripts that can be run in r with the help of the demo ( ) command . to demonstrate the ease of use of rbrothers , we present an example of a novel recombination analysis of 2 salmonella fimbrial genes .
salmonella enterica subspecies enterica  a subspecies of salmonella enterica  contains a majority of the strains pathogenic to humans.13 uncovering mechanisms of pathadaptive evolution of these strains is important for understanding salmonella enterica pathogenicity .
a recent study demonstrated that point substitutions in a gene coding for the type 1 fimbrial adhesin , fimh , exhibit signatures of recent positive selection.14 however , it is likely that the evolution of fimh gene is shaped by both point substitutions and intragenic recombination .
therefore , we investigate the presence of recombination in the fimh gene . for comparison , we also examine fima that encodes the major structural subunit of the salmonella type 1 fimbriae .
we start with fimh and fima sequences from 8 salmonella strains representing 8 serovars : typhimurium strain lt2 ( tmlt 2 ) , paratyphi a strain atcc 9150 ( paraa 9150 ) , paratyphi b strain spb7 ( parabspb 7 ) , paratyphi c strain rks4594 ( parac 4594 ) , typhi strain ct18 ( typhict 18 ) , gallinarum strain 287/91 ( galli 28791 ) , newport strain sl254 ( newportsl 254 ) , and kentucky strain cvm29188 ( kentuc 29188 ) . since sequence divergence is very low in these 2 alignments ( average pair - wise sequence diversity  being 0.020  0.003 for fimh and 0.015  0.004 for fima ) , we set prior odds of at least 1 break - point to 1:1000 to avoid inferring spurious recombination events .
we choose to work with the low prior odds of at least 1 breakpoint because the posterior distribution of the number of break - points was highly sensitive to the prior .
the default dualbrothers s prior results in a large number of estimated recombination break - points , most of which are likely spurious . gradually decreasing the prior mean of the number of break - points corresponds to a gradual decrease in the number of estimated break - points , but after a certain point the posterior stops being sensitive to the prior , strongly supporting 2 break - points .
when we report only these 2 strongly supported break - points we are being very conservative in the sense that there are probably more recombination break - points supported by these data .
however , interpreting the posterior distribution of break - points with a more liberal prior on their average proved to be challenging .
the above analysis underscores the importance of prior sensitivity analysis when performing bayesian inference with complex models .
mcmc for the fimh alignment mixed with less success than mcmc for the fima data , prompting us to run the former markov chain for 51  10 iterations , discarding the first 10 iterations , and the latter chain for 2.1  10 iterations , discarding the first 10 iterations .
, the dmcp model produces strong evidence for at least two recombination break - points at sites 412 and 591 .
the corresponding bayesian credible intervals , computed according to the procedure described in minin et al,5 are ( 392 , 485 ) and ( 585 , 596 ) .
in contrast to the fimh analysis , rbrothers finds no sign of recombination in the fima alignment . in figure 1 , we plot the posterior probabilities of the phylogenetic tree topologies for each site in the 2 alignments , with corresponding trees shown below the probability plots .
we only plot trees whose posterior probabilities were above 0.5 at some sites of the sequence alignment .
the above results can be reproduced by running a corresponding demo example in the rbrothers package : 
 > library ( rbrothers)>demo ( salmonella_example , package = rbrothers ) > demo ( salmonella_example , package = rbrothers )
one of the advantages of having a dmcp model implementation available in r is the possibility of combining the results of this inferential framework with other phylogenetic analyses .
in fact , rbrothers already uses ape s excellent graphical facilities to display dmcp results seamlessly and intuitively.12 when the sequence alignment contains a small number of well estimated break - points , the dmcp framework provides an estimated segmentation of the alignment into blocks , each supporting a different phylogenetic tree , as shown in the salmonella example above .
this segmentation can be used further to map mutations onto corresponding phylogenies or to test hypotheses about relatedness of the sequences under study using existing r packages , such as ape and phangorn.11,15 a more rigorous approach , in which the downstream analyses would be integrated over the posterior distribution of alignment segmentations , is also possible and will be subject to future research and software development .
 phylogenetic recombination detection is a fundamental task in bioinformatics and evolutionary biology . 
 most of the computational tools developed to attack this important problem are not integrated into the growing suite of r packages for statistical analysis of molecular sequences . here , we present an r package , rbrothers , that makes a bayesian multiple change - point model , one of the most sophisticated model - based phylogenetic recombination tools , available to r users . moreover , we equip the bayesian change - point model with a set of pre- and post- processing routines that will broaden the application domain of this recombination detection framework . 
 specifically , we implement an algorithm that forms the set of input trees required by multiple change - point models . 
 we also provide functionality for checking markov chain monte carlo convergence and creating estimation result summaries and graphics . using rbrothers , we perform a comparative analysis of two salmonella enterica genes , fima and fimh , that encode major and adhesive subunits of the type 1 fimbriae , respectively . we believe that rbrothers , available at r - forge : http://evolmod.r-forge.r-project.org/ , will allow researchers to incorporate recombination detection into phylogenetic workflows already implemented in r. 
Introduction
Software Description
Two 
Using rbrothers within the R Package Ecosystem