<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article
  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article" dtd-version="3.0" xml:lang="EN">
  <front>
    <journal-meta><journal-id journal-id-type="nlm-ta">PLoS ONE</journal-id><journal-id journal-id-type="publisher-id">plos</journal-id><journal-id journal-id-type="pmc">plosone</journal-id><!--===== Grouping journal title elements =====--><journal-title-group><journal-title>PLoS ONE</journal-title></journal-title-group><issn pub-type="epub">1932-6203</issn><publisher>
        <publisher-name>Public Library of Science</publisher-name>
        <publisher-loc>San Francisco, USA</publisher-loc>
      </publisher></journal-meta>
    <article-meta><article-id pub-id-type="publisher-id">PONE-D-12-00060</article-id><article-id pub-id-type="doi">10.1371/journal.pone.0034572</article-id><article-categories>
        <subj-group subj-group-type="heading">
          <subject>Research Article</subject>
        </subj-group>
        <subj-group subj-group-type="Discipline-v2">
          <subject>Biology</subject>
          <subj-group>
            <subject>Computational biology</subject>
            <subj-group>
              <subject>Genomics</subject>
              <subj-group>
                <subject>Comparative genomics</subject>
                <subject>Genome analysis tools</subject>
                <subject>Genome evolution</subject>
              </subj-group>
            </subj-group>
            <subj-group>
              <subject>Evolutionary modeling</subject>
            </subj-group>
          </subj-group>
          <subj-group>
            <subject>Evolutionary biology</subject>
            <subj-group>
              <subject>Evolutionary processes</subject>
              <subj-group>
                <subject>Mutation</subject>
              </subj-group>
            </subj-group>
            <subj-group>
              <subject>Evolutionary systematics</subject>
              <subj-group>
                <subject>Phylogenetics</subject>
              </subj-group>
            </subj-group>
            <subj-group>
              <subject>Genomic evolution</subject>
            </subj-group>
          </subj-group>
          <subj-group>
            <subject>Proteomics</subject>
            <subj-group>
              <subject>Sequence analysis</subject>
            </subj-group>
          </subj-group>
          <subj-group>
            <subject>Zoology</subject>
            <subj-group>
              <subject>Animal phylogenetics</subject>
            </subj-group>
          </subj-group>
        </subj-group>
        <subj-group subj-group-type="Discipline-v2">
          <subject>Computer science</subject>
          <subj-group>
            <subject>Computer modeling</subject>
          </subj-group>
          <subj-group>
            <subject>Computerized simulations</subject>
          </subj-group>
        </subj-group>
        <subj-group subj-group-type="Discipline">
          <subject>Genetics and Genomics</subject>
          <subject>Computational Biology</subject>
          <subject>Computer Science</subject>
          <subject>Evolutionary Biology</subject>
          <subject>Biochemistry</subject>
        </subj-group>
      </article-categories><title-group><article-title>Accurate Reconstruction of Insertion-Deletion Histories by Statistical Phylogenetics</article-title><alt-title alt-title-type="running-head">Insertion-Deletion Phylogenetics</alt-title></title-group><contrib-group>
        <contrib contrib-type="author" xlink:type="simple">
          <name name-style="western">
            <surname>Westesson</surname>
            <given-names>Oscar</given-names>
          </name>
          <xref ref-type="aff" rid="aff1">
            <sup>1</sup>
          </xref>
        </contrib>
        <contrib contrib-type="author" xlink:type="simple">
          <name name-style="western">
            <surname>Lunter</surname>
            <given-names>Gerton</given-names>
          </name>
          <xref ref-type="aff" rid="aff2">
            <sup>2</sup>
          </xref>
        </contrib>
        <contrib contrib-type="author" xlink:type="simple">
          <name name-style="western">
            <surname>Paten</surname>
            <given-names>Benedict</given-names>
          </name>
          <xref ref-type="aff" rid="aff3">
            <sup>3</sup>
          </xref>
        </contrib>
        <contrib contrib-type="author" xlink:type="simple">
          <name name-style="western">
            <surname>Holmes</surname>
            <given-names>Ian</given-names>
          </name>
          <xref ref-type="aff" rid="aff1">
            <sup>1</sup>
          </xref>
          <xref ref-type="corresp" rid="cor1">
            <sup>*</sup>
          </xref>
        </contrib>
      </contrib-group><aff id="aff1"><label>1</label><addr-line>University of California Berkeley and University of California San Francisco Graduate Program in Bioengineering, University of California, Berkeley, California, United States of America</addr-line>       </aff><aff id="aff2"><label>2</label><addr-line>Wellcome Trust Center for Human Genetics, Oxford, Oxford, United Kingdom</addr-line>       </aff><aff id="aff3"><label>3</label><addr-line>Baskin School of Engineering, University of California Santa Cruz, Santa Cruz, California, United States of America</addr-line>       </aff><contrib-group>
        <contrib contrib-type="editor" xlink:type="simple">
          <name name-style="western">
            <surname>Poon</surname>
            <given-names>Art F. Y.</given-names>
          </name>
          <role>Editor</role>
          <xref ref-type="aff" rid="edit1"/>
        </contrib>
      </contrib-group><aff id="edit1">British Columbia Centre for Excellence in HIV/AIDS, Canada</aff><author-notes>
        <corresp id="cor1">* E-mail: <email xlink:type="simple">protpal@postbox.biowiki.org</email></corresp>
        <fn fn-type="con">
          <p>Conceived and designed the experiments: OW IHH. Performed the experiments: OW. Analyzed the data: OW. Contributed reagents/materials/analysis tools: OW IHH. Wrote the paper: OW IHH. Made substantial intellectual contributions to the development of the method: BP GL.</p>
        </fn>
      <fn fn-type="conflict">
        <p>The authors have declared that no competing interests exist.</p>
      </fn></author-notes><pub-date pub-type="collection">
        <year>2012</year>
      </pub-date><pub-date pub-type="epub">
        <day>20</day>
        <month>4</month>
        <year>2012</year>
      </pub-date><volume>7</volume><issue>4</issue><elocation-id>e34572</elocation-id><history>
        <date date-type="received">
          <day>1</day>
          <month>1</month>
          <year>2012</year>
        </date>
        <date date-type="accepted">
          <day>5</day>
          <month>3</month>
          <year>2012</year>
        </date>
      </history><!--===== Grouping copyright info into permissions =====--><permissions><copyright-year>2012</copyright-year><copyright-holder>Westesson et al</copyright-holder><license><license-p>This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.</license-p></license></permissions><abstract>
        <p>The Multiple Sequence Alignment (MSA) is a computational abstraction that represents a partial summary either of indel history, or of structural similarity. Taking the former view (indel history), it is possible to use formal automata theory to generalize the phylogenetic likelihood framework for finite substitution models (Dayhoff's probability matrices and Felsenstein's pruning algorithm) to arbitrary-length sequences. In this paper, we report results of a simulation-based benchmark of several methods for reconstruction of indel history. The methods tested include a relatively new algorithm for statistical marginalization of MSAs that sums over a stochastically-sampled ensemble of the most probable evolutionary histories. For mammalian evolutionary parameters on several different trees, the single most likely history sampled by our algorithm appears less biased than histories reconstructed by other MSA methods. The algorithm can also be used for alignment-free inference, where the MSA is explicitly summed out of the analysis. As an illustration of our method, we discuss reconstruction of the evolutionary histories of human protein-coding genes.</p>
      </abstract><funding-group><funding-statement>Authors OW and IHH were supported by National Institutes of Health/National Human Genome Research Institute grant R01-GM076705. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.</funding-statement></funding-group><counts>
        <page-count count="12"/>
      </counts></article-meta>
  </front>
  <body>
    <sec id="s1">
      <title>Introduction</title>
      <p>The Multiple Sequence Alignment (MSA), indispensable to computational sequence analysis, represents a hypothetical claim about the homology beteen sequences. MSAs have many different uses, but the underlying hypothesis can often be classified as a claim either of <italic>structural</italic> homology (the 3D structures align in a particular way) or of <italic>evolutionary</italic> homology (the sequences are related by a particular history on a given phylogenetic tree). These types of hypothesis are similar, but with subtle (and important) distinctions: at the residue level, a claim of evolutionary homology (direct shared descent) is far stronger than a claim of structural homology (same approximate fold). Furthermore, both types of MSA–evolutionary and structural–typically only represent <italic>summaries</italic> of the respective homologies: some fine detail is often omitted. For example, an evolutionary MSA may–or may not–include the ancestral sequences at internal nodes of the underlying tree.</p>
      <p>Structural and evolutionary MSAs are often conflated, but they have quite different applications. For example, a common use for a structural MSA is <italic>template-based structure prediction</italic>, where a query sequence is aligned to a target of known structure; the success of this prediction reflects the number of query-template residues correctly aligned <xref ref-type="bibr" rid="pone.0034572-Qu1">[1]</xref>. By way of contrast, a common application for an evolutionary MSA is to identify regions or sites under selection, the success of which depends on accurate reconstruction of the evolutionary history <xref ref-type="bibr" rid="pone.0034572-Moses1">[2]</xref>, <xref ref-type="bibr" rid="pone.0034572-Pollard1">[3]</xref>.</p>
      <p>Evaluation of alignment methods is typically done with implicit regard for the structural interpretation. Many benchmarks have used metrics based on the Sum of Pairs Score (SPS) <xref ref-type="bibr" rid="pone.0034572-Thompson1">[4]</xref>. In the situation that a query-template pairwise alignment is randomly picked out of the MSA, the SPS effectively estimates the proportion of homologous residues that are correctly identified. Several alignment methods attempt to maximize the posterior expectation of SPS or similar metrics. This appears to improve accuracy, particularly when measured with reference to structural homology. However, it does not automatically confer <italic>evolutionary</italic> accuracy – a correct reconstruction of the evolutionary history of the sequences.</p>
      <p>Several studies suggest that multiple alignment for evolutionary purposes is still a highly uncertain procedure <xref ref-type="bibr" rid="pone.0034572-Wong1">[5]</xref>, and that errors therein may significantly bias analyses of evolutionary effects <xref ref-type="bibr" rid="pone.0034572-Lytynoja1">[6]</xref>–<xref ref-type="bibr" rid="pone.0034572-Bradley1">[11]</xref>. A useful component of these studies is simulation of genetic sequence evolution <xref ref-type="bibr" rid="pone.0034572-Lytynoja1">[6]</xref>, which appears to better indicate evolutionary accuracy than benchmarks derived from protein structure alignments. Simulations can be made quite realistic given the abundance of comparative sequence data <xref ref-type="bibr" rid="pone.0034572-Strope1">[12]</xref>.</p>
      <p>The current state-of-the-art in phylogenetic alignment software is a choice between (on the one hand) programs that lack explicit models of the underlying evolutionary process, and so are not framed as statistical inference problems <xref ref-type="bibr" rid="pone.0034572-Lytynoja1">[6]</xref>, and (on the other hand) Bayesian Markov chain Monte Carlo (MCMC) methods, which are statistically exact but prohibitively slow <xref ref-type="bibr" rid="pone.0034572-Holmes1">[13]</xref>,<xref ref-type="bibr" rid="pone.0034572-Suchard1">[14]</xref>.</p>
      <p>A telling observation is that while substitution rate is routinely measured from MSAs and used as an indicator of natural selection, there is relatively little analogous use of indel rate. As we report here, it seems highly likely that even if indel rate is a useful evolutionary signal (which is eminently plausible), the present alignment methods distort measurements of this rate so far as to make it meaningless (<xref ref-type="fig" rid="pone-0034572-g001">Figure 1</xref> and <xref ref-type="fig" rid="pone-0034572-g002">Figure 2</xref>).</p>
      <fig id="pone-0034572-g001" position="float">
        <object-id pub-id-type="doi">10.1371/journal.pone.0034572.g001</object-id>
        <label>Figure 1</label>
        <caption>
          <title>ProtPal's estimates of insertion and deletion rates are the most accurate of any program tested, as measured by the RMSE of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e001" xlink:type="simple"/></inline-formula> values aggregated over all substitution/indel rate categories.</title>
          <p>Quantiles containing 90% of the data are shown as a bolded portion of the <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e002" xlink:type="simple"/></inline-formula>-axis, and RMSE is shown to the right of each distribution, the latter computed as described in 1 Equation 1. No aligner approaches the accuracy of the rates estimated with the true alignment, though ProtPal, PRANK, and ProbCons are the top three, with ProtPal as the most accurate over all. Many aligners, particularly MUSCLE, CLUSTALW, and MAFFT, significantly underestimate insertion rates and overestimate deletion rates. ProtPal and PRANK perform their own ancestral reconstruction and other alignment programs were augmented with a most-recent-common-ancestor (MRCA) parsimony as described in <xref ref-type="bibr" rid="pone.0034572-Sinha1">[55]</xref>.</p>
        </caption>
        <graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.g001" xlink:type="simple"/>
      </fig>
      <fig id="pone-0034572-g002" position="float">
        <object-id pub-id-type="doi">10.1371/journal.pone.0034572.g002</object-id>
        <label>Figure 2</label>
        <caption>
          <title>Rate estimation accuracy is highly dependent on the simulated indel rate.</title>
          <p>For instance, PRANK is more accurate at lower indel rates, ProbCons is more accurate at higher rates. ProtPal is more accurate than PRANK in all but one rate (0.005) and equal or more accurate than ProbCons in all but one rate (0.08). The drift towards <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e003" xlink:type="simple"/></inline-formula> exhibited by most programs indicates that most programs infer proportionally fewer indels as rates are increased, likely due to various forms of gap attraction. Color-coded 90% quantiles and RMSEs are shown underneath and to the right of each group of distributions, respectively. RMSE is computed as described in 1 Equation 1.</p>
        </caption>
        <graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.g002" xlink:type="simple"/>
      </fig>
      <p>In this paper, we frame phylogenetic sequence alignment as an approximate maximum likelihood (ML) inference. Our inference algorithm assumes that the tree is known, requiring a separate tree estimation protocol. While this is a strong assumption, it is in principle shared among all progressive aligners (e.g. PRANK <xref ref-type="bibr" rid="pone.0034572-Lytynoja2">[15]</xref>, Muscle <xref ref-type="bibr" rid="pone.0034572-Edgar1">[16]</xref>, ClustalW <xref ref-type="bibr" rid="pone.0034572-Larkin1">[17]</xref>, MAFFT <xref ref-type="bibr" rid="pone.0034572-Katoh1">[18]</xref>). The alignment-marginalized likelihoods reported by our algorithm allow for statistical tests between alternative trees, and the functionality to estimate an initial alignment and guide tree from unaligned sequences exists elsewhere in the DART package. Our framing uses automata-theoretic methods from computational linguistics to unify several previously-disjoint areas of bioinformatics: Felsenstein's pruning algorithm for the phylogenetic likelihood function <xref ref-type="bibr" rid="pone.0034572-Felsenstein1">[19]</xref>, progressive multiple sequence alignment <xref ref-type="bibr" rid="pone.0034572-Higgins1">[20]</xref>, and alignment ensemble representation using partial order graphs <xref ref-type="bibr" rid="pone.0034572-Lee1">[21]</xref>. Our algorithm may be viewed as a stochastic generalization of pruning to infinite state spaces: it retains the linear time and memory complexity of pruning (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e004" xlink:type="simple"/></inline-formula> for <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e005" xlink:type="simple"/></inline-formula> sequences of length <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e006" xlink:type="simple"/></inline-formula>), while moderating the biasing effect of the MSA. The algorithmic details of our method are outlined briefly in the <xref ref-type="sec" rid="s4">Methods</xref>, and in more complete, mathematically precise terms (with a tutorial introduction) in a separately submitted work.</p>
      <p>Our software implementation of this algorithm is called ProtPal. We measured the accuracy of ProtPal relative to leading non-MCMC alignment/reconstruction protocols by simulating indels and substitutions on a known phylogeny, withholding the true history and attempting to reconstruct it from the sequences at the tips of the tree. The results show that all previous approaches to the reconstruction of ancestral sequences introduce significant biases, including systematic underestimation of insertions and overestimation of deletions. This contradicts previous claims that advances in the statistical foundations of alignment tools, supported by improvements in protein-structure benchmarks, necessarily improve the accuracy of evolutionary parameter estimates like the indel rate <xref ref-type="bibr" rid="pone.0034572-Lytynoja1">[6]</xref>, <xref ref-type="bibr" rid="pone.0034572-Cartwright1">[22]</xref>, <xref ref-type="bibr" rid="pone.0034572-Bradley2">[23]</xref>.</p>
      <p>ProtPal introduces less bias than any other methods we tested, including PRANK, the state-of-the-art phylogenetic progressive aligner <xref ref-type="bibr" rid="pone.0034572-Lytynoja1">[6]</xref>. Both PRANK and ProtPal treat insertions and deletions as phylogenetic events (<xref ref-type="fig" rid="pone-0034572-g003">Figure 3</xref>). Based on our tests, ProtPal appears to be the best choice for small to moderately-sized analyses, such as a reconstruction of the history of proteins at the inter-species level in human evolutionary history. Using ProtPal to estimate indel rates for <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e007" xlink:type="simple"/></inline-formula> human protein-coding gene families, we find that per-gene indel rates are approximately gamma-distributed, with 95% of genes experiencing a mean rate of less than 0.1 indel events per synonymous substitution event. We find that lengths of inserted and deleted sequences are comparably distributed, having medians 5 and 7, respectively. The human lineage appears to have experienced unusually many insertions since the human-mouse split. By mapping genes to Gene Ontology (GO) terms, we find that the 200 fastest-indel genes are enriched for regulatory and metabolic functions. Possible applications and extensions of our algorithm include phylogenetic placement, homology detection, and reconstruction of structured RNA.</p>
      <fig id="pone-0034572-g003" position="float">
        <object-id pub-id-type="doi">10.1371/journal.pone.0034572.g003</object-id>
        <label>Figure 3</label>
        <caption>
          <title><italic>Gap attraction</italic>, the canceling of nearby complementary indels, can affect insertion and deletion rates in various ways depending on the phylogenetic relationship of the sequences involved.</title>
          <p>All programs are, to some extent, sensitive to situations <bold>A</bold> and <bold>B</bold> whereas phylogenetic aligners can avoid situation <bold>C</bold>. An insertion at a leaf requires gaps at all other leaves - an understandably costly alignment move when gaps are added without regard to the phylogeny, resulting in <bold>multiple penalization</bold> for each insertion. Such a penalization would cause most non-phylogenetic aligners to prefer the “Inferred alignment” in case <bold>C</bold> where there are fewer total gaps. Aligners treating indels as phylogenetic events would penalize each of the implied multiple deletions and only penalize each insertion once, thus preferring the “True alignment” in case <bold>C</bold>.</p>
        </caption>
        <graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.g003" xlink:type="simple"/>
      </fig>
    </sec>
    <sec id="s2">
      <title>Results</title>
      <sec id="s2a">
        <title>Computational reconstruction of simulated histories</title>
        <p>We undertook to determine the ability of leading bioinformatics programs, including ProtPal, to characterize mutation event histories. We simulated indel histories on a tree, then attempted to reconstruct the MAP history, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e008" xlink:type="simple"/></inline-formula>, using only knowledge of the sequences <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e009" xlink:type="simple"/></inline-formula> and the phylogeny <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e010" xlink:type="simple"/></inline-formula> (but not the sequence alignment). The history <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e011" xlink:type="simple"/></inline-formula> is the aligned set of observed extant and predicted ancestral sequences, such that insertion, deletion, and substitution events can be pinpointed to specific tree branches (though not to specific time points on those branches).</p>
        <p>We then characterized the reconstruction quality both directly, by comparison of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e012" xlink:type="simple"/></inline-formula> to the true <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e013" xlink:type="simple"/></inline-formula>, and indirectly, by using <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e014" xlink:type="simple"/></inline-formula> to estimate <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e015" xlink:type="simple"/></inline-formula>, the evolutionary parameters:<disp-formula><graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.e016" xlink:type="simple"/><label>(1)</label></disp-formula>where the latter step assumes a flat prior, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e017" xlink:type="simple"/></inline-formula> We then compared the history-conditioned parameter estimate <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e018" xlink:type="simple"/></inline-formula> to the true <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e019" xlink:type="simple"/></inline-formula>.</p>
        <p>This statistic is not without its problems. For one thing, we use an initial guess of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e020" xlink:type="simple"/></inline-formula> to estimate <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e021" xlink:type="simple"/></inline-formula>. Furthermore, for an unbiased estimate, we should sum over all histories, rather than conditioning on the MAP reconstructed history. This summing over histories would, however, require multiple expensive calculations of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e022" xlink:type="simple"/></inline-formula>, where conditioning on <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e023" xlink:type="simple"/></inline-formula> requires only one such calculation. Furthermore, parameter estimation conditioned on a MAP-reconstructed history is the <italic>de facto</italic> method employed by large-scale genomics studies focusing on indels <xref ref-type="bibr" rid="pone.0034572-Kamneva1">[24]</xref>–<xref ref-type="bibr" rid="pone.0034572-GomezValero1">[27]</xref>.</p>
        <sec id="s2a1">
          <title>Simulation model parameters</title>
          <p>The model parameters are <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e024" xlink:type="simple"/></inline-formula>: the insertion and deletion rates (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e025" xlink:type="simple"/></inline-formula>), indel length distributions (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e026" xlink:type="simple"/></inline-formula>) and substitution rate matrix (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e027" xlink:type="simple"/></inline-formula>). Here we focus on the rates (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e028" xlink:type="simple"/></inline-formula>).</p>
          <p>As described in <xref ref-type="supplementary-material" rid="pone.0034572.s001">Text S1</xref>, we generated data using an external simulation tool, indel-seq-gen, varying insertion (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e029" xlink:type="simple"/></inline-formula>), deletion (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e030" xlink:type="simple"/></inline-formula>) and substitution rates (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e031" xlink:type="simple"/></inline-formula>) over a range representative of per-gene rates in <italic>Amniota</italic> evolution (<xref ref-type="fig" rid="pone-0034572-g004">Figure 4</xref>). We varied indel rates (with <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e032" xlink:type="simple"/></inline-formula>) between 0.005 and 0.08 expected indels per unit time, estimating that this range accounts for 95% of human gene families. We left the substitution model <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e033" xlink:type="simple"/></inline-formula> and indel length distributions <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e034" xlink:type="simple"/></inline-formula> fixed, employing indel-seq-gen's empirically-estimated values.</p>
          <fig id="pone-0034572-g004" position="float">
            <object-id pub-id-type="doi">10.1371/journal.pone.0034572.g004</object-id>
            <label>Figure 4</label>
            <caption>
              <title>Insertion and deletion rates in <italic>Amniota</italic> show similar distributions, with 95% of genes having rates less than approximately 0.1 indels per synonymous substitution.</title>
              <p>Insertion and deletion rates were estimated using reconstructions done with ProtPal from a set of approximately 7,500 protein-coding genes from the OPTIC amniote database <xref ref-type="bibr" rid="pone.0034572-Heger1">[30]</xref>. Indel rates were normalized by the synonymous substitution rate of each gene as computed with PAML <xref ref-type="bibr" rid="pone.0034572-Yang3">[53]</xref> so that the plotted rate represents the number of expected indels per synonymous substitution. Since these rates are conditioned on the MAP reconstructed history, there are many alignments whose inferred indel rates are zero (197, 174, and 54 for insertions, deletions, and both, respectively).</p>
            </caption>
            <graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.g004" xlink:type="simple"/>
          </fig>
          <p>We performed simulations on mammalian, amniote and fruitfly phylogenies, using the taxa in those clades for which genomic sequence is actually available. We found generally consistent results, with common trends that were most pronounced on the largest of the three trees that we used (the twelve sequenced <italic>Drosophila</italic> species <xref ref-type="bibr" rid="pone.0034572-Clark1">[28]</xref>). In discussing the trends, we will refer specifically to the results on this largest of the trees.</p>
        </sec>
      </sec>
      <sec id="s2b">
        <title>Indel rate estimates</title>
        <sec id="s2b1">
          <title>Overall most accurate</title>
          <p>We first set out to determine which program, when used to analyze a set of unaligned sequences, returns the indel rate estimate closest to the true rate.</p>
          <p>We report the ratio of inferred rate to true rate for insertions <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e035" xlink:type="simple"/></inline-formula> and deletions <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e036" xlink:type="simple"/></inline-formula> in <xref ref-type="fig" rid="pone-0034572-g001">Figure 1</xref>, with each <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e037" xlink:type="simple"/></inline-formula> defined as <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e038" xlink:type="simple"/></inline-formula> in Equation 1. No parameter estimate derived from a computationally reconstructed history approaches the level of accuracy achieved using the true history (labeled “True simulated history” in <xref ref-type="fig" rid="pone-0034572-g001">Figure 1</xref>).</p>
          <p>The results do not always concord with previous benchmarks that have measured accuracy using 3D structural alignments: for example, the FSA program, one of the most accurate aligners on structural benchmarks <xref ref-type="bibr" rid="pone.0034572-Bradley2">[23]</xref>, performs poorly here. This discordance may be due to the fundamental differences between evolutionary and structural homology, and the metrics used to assess each. For instance, consider a region with many nearby and overlapping insertions and deletions. The spatial and temporal location of these insertion and deletion events (in particular, the pinpointing of events to branches on the tree) defines what the “perfect” evolutionary reconstruction is. In contrast, even given perfect knowledge of the insertion/deletion history, a “perfect” structural alignment depends only on the proteins at the tips of the tree, and this alignment could differ from the true evolutionary reconstruction.</p>
          <p>Fundamentally, the difference between FSA and ProtPal is the underlying metric that is being optimized by each program: FSA attempts to maximize a metric (AMA = Alignment Metric Accuracy) which is essentially “structural” (in the sense that it predicts how many residues would be correctly aligned in a pairwise alignment of two leaf-node sequences, as might be used in structure prediction by target-template alignment), while ProtPal attempts to maximize a “phylogenetic” metric (the probability of a given evolutionary history). The metric we have used in our benchmark (which counts correct reconstruction of the number of indel events on branches of the tree) is also “phylogenetic”. When ranking the programs using the AMA metric, FSA perfoms well, with accuracy exceeding that of ProtPal in the highest indel rate category (<xref ref-type="supplementary-material" rid="pone.0034572.s001">Text S1</xref>). This suggests that the differences between our evolutionary benchmark and previous benchmarks are not due to the data, but rather the types of metrics that are used to measure alignment accuracy; similarly, the differences between the leading programs are primarily due to what types of benchmark they are explicitly trying to perform well at.</p>
          <p>All programs other than ProtPal display insertion- <italic>versus</italic>-deletion biases that are, to a varying degree, asymmetric. Typically, the asymmetry is that insertions are underrepresented and deletions overrepresented. ProtPal's bias, which is generally less than the other programs, is also the most symmetric: reconstructed insertions and deletions are roughly equally reliable, with both slightly underestimated. Over the distribution of human gene rates used by this benchmark, our phylogenetic likelihood approach, ProtPal, provides the most accurate reconstructions of both insertion and deletion counts. PRANK, which also uses a tree (but no likelihood), avoids insertion-deletion biases to a certain extent, although insertion rates are slightly underestimated relative to deletion rates. Since ProtPal's MAP history estimation appears similar to the optimization algorithm of PRANK, we suspect that ProtPal's marginally better performance is due primarily to its main difference in implementation: ProtPal tracks an <italic>ensemble</italic> of possible reconstructions during progressive tree traversal (Section), whereas PRANK uses a single “current best guess.”</p>
        </sec>
        <sec id="s2b2">
          <title>Effect of indel rate variation</title>
          <p>To investigate the effect of indel rate variation on estimation accuracy, we separate each program's error distributions by indel rate (<xref ref-type="fig" rid="pone-0034572-g002">Figure 2</xref>). We find that all programs' accuracy is strongly affected by the indel rate used in simulation. As the true indel rate increases, most programs' estimates drift towards <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e039" xlink:type="simple"/></inline-formula>. This is consistent with the so-called “gap attraction” effect, where indels that are nearby in sequence can be misinterpreted as substitution events <xref ref-type="bibr" rid="pone.0034572-Lunter1">[29]</xref>. Depending on the phylogenetic orientation of the events, estimated rates can be elevated or lowered, with different biases for insertion and deletion rates (<xref ref-type="fig" rid="pone-0034572-g003">Figure 3</xref>).</p>
          <p>Gap attraction and other biases operate simultaneously, and are sometimes opposed. MUSCLE over-estimates the deletion rate under most conditions, but (consistent with a trend where programs have lower <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e040" xlink:type="simple"/></inline-formula> at higher indel rates) gets the deletion rate roughly correct in the highest-indel-rate category of our benchmark. However, the alignments produced by MUSCLE at high indel rates are no more “accurate” by pairwise metrics (<xref ref-type="supplementary-material" rid="pone.0034572.s001">Text S1</xref>). We conjecture that multiple, contradictory types of gap attraction are at work, e.g. <xref ref-type="fig" rid="pone-0034572-g003">Figures 3B and 3C</xref>.</p>
          <p>After ProtPal, the two most accurate reconstruction methods are PRANK and ProbCons (the latter combined with a parsimonious indel reconstruction). ProbCons produces more reliable insertion estimates than PRANK in a broad range of benchmark categories, is tied with PRANK for deletion estimates, and appears robust to indel rate variation. PRANK performs slightly better than ProbCons in the slowest indel rate category we considered. ProtPal produces the most reliable estimates overall, outperforming ProbCons in all but the fastest indel rate category, and PRANK in all but the slowest.</p>
        </sec>
        <sec id="s2b3">
          <title>Sensitivity to substitution rate</title>
          <p>As compared to variation of simulated indel rate, variation of simulated substitution rate appears to have little effect on the accuracy of indel reconstruction (<xref ref-type="supplementary-material" rid="pone.0034572.s001">Text S1</xref>). One notable exception is FSA, which appears to be affected by the substitution rate more than the other programs. For example, when the simulated indel and substitution rates are both low, FSA is comparable to the most accurate of the other programs (ProtPal); but when the substitution rate is increased, FSA's error is greater than the least accurate program (CLUSTALW). Errors in estimating the substitution rate are comparable among the programs tested, and are similarly correlated with the simulation indel rate (<xref ref-type="supplementary-material" rid="pone.0034572.s001">Text S1</xref>).</p>
        </sec>
      </sec>
      <sec id="s2c">
        <title>Reconstructed indel histories of human genes</title>
        <p>We present here a comprehensive set of reconstructions accounting for the evolutionary history of individual codons in human genes. We used genes in the <bold>O</bold>rthologous and <bold>P</bold>aralogous <bold>T</bold>ranscripts in <bold>C</bold>lades (OPTIC) database's <italic>Amniota</italic> set, comprised of the 5 mammals H. <italic>sapiens</italic>, M. <italic>musculus</italic>, C. <italic>familiaris</italic>, M. <italic>domestica</italic>, O. <italic>anatinus</italic> and G. <italic>gallus</italic> as an outgroup <xref ref-type="bibr" rid="pone.0034572-Heger1">[30]</xref>. Considering only those families with one unique ortholog per species (approximately 7,500 families), we combined tree branch statistics across genes, using the species tree in <xref ref-type="supplementary-material" rid="pone.0034572.s001">Text S1</xref>. Our reconstructions are available at <ext-link ext-link-type="uri" xlink:href="http://biowiki.org/oscar/optic_reconstruction.tar" xlink:type="simple">http://biowiki.org/oscar/optic_reconstruction.tar</ext-link>, and we provide here various graphical summaries of <italic>Amniota</italic> evolutionary history. Several negative results stand in contrast to earlier-reported trends.</p>
        <sec id="s2c1">
          <title>Indel rates</title>
          <p>Insertion and deletion rates are approximately gamma-distributed (<xref ref-type="fig" rid="pone-0034572-g004">Figure 4</xref>). Roughly 95% of genes have indel rates <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e041" xlink:type="simple"/></inline-formula> indels per synonymous substitution.</p>
        </sec>
        <sec id="s2c2">
          <title>Phylogenetic origins</title>
          <p>In our simulations, ProtPal pinpoints residues' “branch of origin” more reliably than other tools, with a 93% accuracy rate (<xref ref-type="supplementary-material" rid="pone.0034572.s001">Text S1</xref>). Many codons appeared to have been inserted following the human-mouse split (<xref ref-type="supplementary-material" rid="pone.0034572.s001">Text S1</xref>)</p>
        </sec>
        <sec id="s2c3">
          <title>Branch-specific indel rates</title>
          <p>Using our reconstructions to estimate the rates of indel mutations along specific tree branches, we find evidence of an elevated insertion rate in the human (black) branch, as well as on the the <italic>Amniota - Australophenids</italic> (pink) branch (<xref ref-type="supplementary-material" rid="pone.0034572.s001">Text S1</xref>).</p>
        </sec>
        <sec id="s2c4">
          <title>Amino acid distributions</title>
          <p>Distributions over amino acids differ significantly between inserted, deleted and non-indel sequences (<xref ref-type="supplementary-material" rid="pone.0034572.s001">Text S1</xref>). In general, small residues are over-represented in insertions, in agreement with previous studies <xref ref-type="bibr" rid="pone.0034572-delaChaux1">[31]</xref>.</p>
        </sec>
        <sec id="s2c5">
          <title>Indel lengths</title>
          <p>We find, contrary to a previous study in <italic>Nematode</italic> <xref ref-type="bibr" rid="pone.0034572-Wang1">[32]</xref>, that length distributions in the Amniotes are nearly identical between insertions and deletions (<xref ref-type="supplementary-material" rid="pone.0034572.s001">Text S1</xref>). The previously-reported result may be attributable to the deletion-biased nature of the methods used, particularly CLUSTALW and MUSCLE <xref ref-type="bibr" rid="pone.0034572-Wang1">[32]</xref>.</p>
        </sec>
        <sec id="s2c6">
          <title>Indel position</title>
          <p>The position of indels within genes is highly biased towards the ends of genes, presumably in large part reflecting annotation error (<xref ref-type="supplementary-material" rid="pone.0034572.s001">Text S1</xref>). The bias is strongest for deletions at the N-terminus of the gene, but both insertions and deletions are enriched in both C- and N- termini.</p>
        </sec>
        <sec id="s2c7">
          <title>Evolutionary context of indel SNPs</title>
          <p>We find no general correlation between the indel rate for a gene and the number of indel polymorphisms recorded for that gene in dbSNP <xref ref-type="bibr" rid="pone.0034572-Saccone1">[33]</xref> (<xref ref-type="supplementary-material" rid="pone.0034572.s001">Text S1</xref>).</p>
        </sec>
        <sec id="s2c8">
          <title>Gene ontology indel rates</title>
          <p>No Gene Ontology (GO) categories stand out as having significantly lowered or heightened indel rates in any of the three ontologies, contrasting with the reported results of a 2007 study using a smaller number of genes <xref ref-type="bibr" rid="pone.0034572-delaChaux1">[31]</xref>. An enrichment analysis conducted with GOstat <xref ref-type="bibr" rid="pone.0034572-Beissbarth1">[34]</xref> showed that the 200 fastest evolving genes in our data are significantly enriched for regulatory and metabolic functions.</p>
        </sec>
      </sec>
    </sec>
    <sec id="s3">
      <title>Discussion</title>
      <p>We developed and analyzed a simulation benchmark that compares programs based on their reconstructions of evolutionary history, using instantaneous mutation rates representative of Amniote evolution. We tested several different tree topologies; results were similar on all trees, but most pronounced on the tree with the longest branch lengths. We find that most programs distort indel rate measurements, despite claims to the contrary. Moreover, the systematic bias varies significantly when the rates of substitutions and indels are varied within a biologically reasonable range. Many of the programs we rated have been ranked in the past, but using benchmarks that use protein structural alignments as a gold standard, rather than evolutionary simulations. Furthermore, these previous benchmarks have not directly assessed the reconstruction of evolutionary history (or summary statistics such as the indel rate), but have used other alignment accuracy metrics such as the <italic>Sum of Pairs Score</italic>. Alignment programs that perform weakly on our benchmark have apparently performed well on these previous benchmarks. We hypothesize that these benchmarks, compared to ours, are less directly predictive of a program's accuracy at historical reconstruction, although they may better reflect the program's suitability to assist in tasks relating more closely to folded structure, like prediction of a protein's 3D structure from a homologous template.</p>
      <p>We have introduced a new notation that describes a general, hidden Markov model-structured likelihood function for indel histories on a tree, as well as the structure of the corresponding inference algorithm. We have implemented the new method in a freely-available program, ProtPal, that allows, for the first time, phylogenetic reconstruction with accuracy over a broad range of indel rates. ProtPal is written in C++ as a part of the DART package: <ext-link ext-link-type="uri" xlink:href="http://www.biowiki.org/ProtPal" xlink:type="simple">www.biowiki.org/ProtPal</ext-link>. The evolutionary reconstructions ProtPal produces are, according to our simulated tests, the most accurate of any available tool, for a range of parameters typical of human genes.</p>
      <p>We applied ProtPal to the reconstruction of human gene indel history, using families of human gene orthologs from the OPTIC database. We find some patterns that agree with previous studies, such as the non-uniform distributions over amino acids seen in <xref ref-type="bibr" rid="pone.0034572-delaChaux1">[31]</xref>. Other results stand in contrast - a previous study found significantly different length distributions for insertions and deletions <xref ref-type="bibr" rid="pone.0034572-Wang1">[32]</xref>, whereas in our data they appear very similar. Another prediction of our reconstruction is an elevated rate of insertions on the human branch since the human-mouse split. This contrasts with a previous analysis <xref ref-type="bibr" rid="pone.0034572-Initial1">[35]</xref>, though the data therein was whole genomes, rather than individual protein-coding genes. In contrast to <xref ref-type="bibr" rid="pone.0034572-delaChaux1">[31]</xref>, we find no obvious predictive power of the Gene Ontology (GO) for indel rates; that is, the indel rate does not appear strongly correlated with the presence or absence of any particular GO term-gene association. However, enrichment analysis for GO terms using GOstat <xref ref-type="bibr" rid="pone.0034572-Beissbarth1">[34]</xref> showed that the 200 fastest-evolving genes are significantly enriched for regulatory and metabolic function. This apparent discrepancy might be explained by a group of regulatory and metabolic genes which have very high indel rates, but whose small number prevent them from skewing the average within their GO categories.</p>
      <p>Many applications which use a fixed-alignment phylogenetic likelihood could potentially benefit from ProtPal's reconstruction profiles. For example, phylogenetic placement algorithms estimate taxonomic distributions by evaluating the relative likelihoods of placing sequence reads on tree branches <xref ref-type="bibr" rid="pone.0034572-Matsen1">[36]</xref>. By using sequence profiles exported from ProtPal, these reads could be placed with greater attention to indels and a more realistic accounting for alignment uncertainty. Homology detection could be done in a similar way, thereby making use of the phylogenetic relationship of the sequences within the reference family. It has been observed that the detection of positive selection is highly sensitive to the alignment used <xref ref-type="bibr" rid="pone.0034572-MarkovaRaina1">[7]</xref>. ProtPal could be modified to detect selection using entire profiles rather than single alignments, potentially eliminating the bias brought on by an inaccurate alignment.</p>
      <p>In summary, multiple alignments are frequently constructed for use in downstream evolutionary analyses. However, except for our method and slow-performing MCMC methods, there are no software tools for reconstructing molecular evolutionary history that explicitly maximize a phylogenetic likelihood for indels. Our results strongly indicate that algorithms such as ProtPal (which use such a phylogenetic model) produce significantly more reliable estimates of evolutionary parameters, which we believe to be highly indicative of evolutionary accuracy. These results falsify previous assertions that existing, non-phylogenetic tools are well-suited to this purpose. Furthermore, we have demonstrated that it is possible to achieve such accuracy without sacrificing asymptotic guarantees on time/memory complexity, or resorting to expensive MCMC methods. ProtPal can reconstruct phylogenetic histories of entire databases on commodity hardware, enabling the large-scale study of evolutionary history in a consistent phylogenetic framework.</p>
    </sec>
    <sec id="s4" sec-type="methods">
      <title>Methods</title>
      <p>The details concerning generation and analysis of simulated data are contained in <xref ref-type="supplementary-material" rid="pone.0034572.s001">Text S1</xref>. A mathematically complete description of the alignment algorithm has been submitted as a separate work, and an early version has been made available online here: <ext-link ext-link-type="uri" xlink:href="http://arxiv.org/abs/1103.4347" xlink:type="simple">http://arxiv.org/abs/1103.4347</ext-link>.</p>
      <sec id="s4a">
        <title>Felsenstein's algorithm for indel models</title>
        <p>Our algorithm may be viewed as a generalization of Felsenstein's pruning recursion <xref ref-type="bibr" rid="pone.0034572-Felsenstein1">[19]</xref>, a widely-used algorithm in bioinformatics and molecular evolution. A few common applications of this algorithm include estimation of substitution rates <xref ref-type="bibr" rid="pone.0034572-Yang1">[37]</xref>; reconstruction of phylogenetic trees <xref ref-type="bibr" rid="pone.0034572-Rannala1">[38]</xref>; identification of conserved (slow-evolving) or recently-adapted (fast-evolving) elements in proteins and DNA <xref ref-type="bibr" rid="pone.0034572-Siepel1">[39]</xref>; detection of different substitution matrix “signatures” (e.g. purifying vs diversifying selection at synonymous codon positions <xref ref-type="bibr" rid="pone.0034572-Yang2">[40]</xref>, hydrophobic vs hydrophilic amino acid signatures <xref ref-type="bibr" rid="pone.0034572-Thorne1">[41]</xref>, CpG methylation in genomes <xref ref-type="bibr" rid="pone.0034572-Siepel2">[42]</xref>, or basepair covariation in RNA structures <xref ref-type="bibr" rid="pone.0034572-Knudsen1">[43]</xref>); annotation of structures in genomes <xref ref-type="bibr" rid="pone.0034572-Siepel3">[44]</xref>, <xref ref-type="bibr" rid="pone.0034572-Pedersen1">[45]</xref>; and placement of metagenomic reads on phylogenetic trees <xref ref-type="bibr" rid="pone.0034572-Matsen1">[36]</xref>.</p>
        <p>Felsenstein's algorithm computes <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e042" xlink:type="simple"/></inline-formula> for a substitution model by tabulating intermediate probability functions of the form <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e043" xlink:type="simple"/></inline-formula>, where <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e044" xlink:type="simple"/></inline-formula> represents the individual residue state of ancestral node <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e045" xlink:type="simple"/></inline-formula>, and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e046" xlink:type="simple"/></inline-formula> represents all the sequence data that is causally descended from node <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e047" xlink:type="simple"/></inline-formula> in the tree (i.e. the observed residues at the set of leaf nodes whose most recent common ancestor is node <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e048" xlink:type="simple"/></inline-formula>).</p>
        <p>The pruning recursion visits all nodes in postorder. Each <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e049" xlink:type="simple"/></inline-formula> function is computed in terms of the functions <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e050" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e051" xlink:type="simple"/></inline-formula> of its immediate left and right children (assuming a binary tree):<disp-formula><graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.e052" xlink:type="simple"/></disp-formula>where <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e053" xlink:type="simple"/></inline-formula> is the probability that node <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e054" xlink:type="simple"/></inline-formula> has state <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e055" xlink:type="simple"/></inline-formula>, given that its parent node <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e056" xlink:type="simple"/></inline-formula> has state <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e057" xlink:type="simple"/></inline-formula>; and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e058" xlink:type="simple"/></inline-formula> is a Kronecker delta function terminating the recursion at the leaf nodes of the tree. These <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e059" xlink:type="simple"/></inline-formula> functions are often referred to as “messages” in the machine-learning literature <xref ref-type="bibr" rid="pone.0034572-Kschischang1">[46]</xref>.</p>
        <p>Our new algorithm is algebraically equivalent to Felsenstein's algorithm, if the concept of a “substitution matrix” over a particular alphabet is extended to the countably-infinite set of all sequences over that alphabet. Our chosen class of “infinite substitution matrix” is one that has a finite representation: namely, the <italic>finite-state transducer</italic>, a probabilistic automaton that transforms an input sequence to an output sequence, and a familiar tool of statistical linguistics <xref ref-type="bibr" rid="pone.0034572-Mohri1">[47]</xref>.</p>
        <p>By generalizing the idea of matrix multiplication (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e060" xlink:type="simple"/></inline-formula>) to two transducers (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e061" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e062" xlink:type="simple"/></inline-formula>), and introducing a notation for feeding the same input sequence to two transducers in parallel (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e063" xlink:type="simple"/></inline-formula>), we are able to write Felsenstein's algorithm in a new form (see Section):<disp-formula><graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.e064" xlink:type="simple"/></disp-formula>where <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e065" xlink:type="simple"/></inline-formula> is the transducer equivalent of the Kronecker delta <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e066" xlink:type="simple"/></inline-formula>. The function <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e067" xlink:type="simple"/></inline-formula> is now encapsulated by a transducer “profile” of node <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e068" xlink:type="simple"/></inline-formula>.</p>
        <p>This representation has complexity <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e069" xlink:type="simple"/></inline-formula> for <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e070" xlink:type="simple"/></inline-formula> sequences of length <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e071" xlink:type="simple"/></inline-formula>, which we reduce to <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e072" xlink:type="simple"/></inline-formula> by stochastic approximation of the <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e073" xlink:type="simple"/></inline-formula>. This approximation relies on the <italic>alignment envelope</italic> <xref ref-type="bibr" rid="pone.0034572-Paten1">[48]</xref>, a data structure introduced by prior work on efficient alignment methods. The alignment envelope is a subset of all the possible histories in which most of the probability mass is concentrated. A related data structure is the <italic>partial order graph</italic> <xref ref-type="bibr" rid="pone.0034572-Lee1">[21]</xref>. Both these data structures can be viewed as ensembles of possible histories, in contrast to a single “best-guess” reconstruction of the history. <xref ref-type="fig" rid="pone-0034572-g005">Figure 5</xref> sampledGraph shows a state graph, with paths through it corresponding to histories relating the two sequences GL and GIV. The paths highlighted in blue form a partial order graph, corresponding to a subset of these histories generated by a stochastic traceback. At each progressive traversal step, we sample a high-probability subset of alignments of two sibling profiles in order to maintain a bound on the state space size. Note that if we sample only the most likely path at every internal node, we essentially recover the progressive algorithm of PRANK, and if we sample and store all solutions, we recover the machine <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e074" xlink:type="simple"/></inline-formula> with state space of size <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e075" xlink:type="simple"/></inline-formula>.</p>
        <fig id="pone-0034572-g005" position="float">
          <object-id pub-id-type="doi">10.1371/journal.pone.0034572.g005</object-id>
          <label>Figure 5</label>
          <caption>
            <title>Each path through this state graph represents a possible evolutionary history relating sequences GL and GIV.</title>
            <p>By using stochastic traceback algorithms (sampling paths proportional to their posterior probability, blue highlighted states and transitions), it is possible to select a high-probability subset of the full state graph. By constructing such a subset at each internal node, it is possible to maintain a bound on the state space size during progressive tree traversal while still retaining an ensemble of possible histories.</p>
          </caption>
          <graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.g005" xlink:type="simple"/>
        </fig>
      </sec>
      <sec id="s4b">
        <title>Transducer definitions and lemmas</title>
        <p>The definitions and lemmas are presented in a condensed form here, and expanded upon in <xref ref-type="bibr" rid="pone.0034572-Westesson1">[49]</xref>.</p>
        <p>A transducer is a tuple <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e076" xlink:type="simple"/></inline-formula> where <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e077" xlink:type="simple"/></inline-formula> is an input alphabet, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e078" xlink:type="simple"/></inline-formula> is an output alphabet, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e079" xlink:type="simple"/></inline-formula> is a set of states, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e080" xlink:type="simple"/></inline-formula> is the start state, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e081" xlink:type="simple"/></inline-formula> is the end state, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e082" xlink:type="simple"/></inline-formula> is the transition relation, and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e083" xlink:type="simple"/></inline-formula> is the transition weight function.</p>
        <p>Suppose that <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e084" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e085" xlink:type="simple"/></inline-formula> are transducers.</p>
        <p>Let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e086" xlink:type="simple"/></inline-formula> be the product of all transition weights along a state path <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e087" xlink:type="simple"/></inline-formula> and let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e088" xlink:type="simple"/></inline-formula> be the sum of such weights for all paths whose input labels, concatenated, yield the string <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e089" xlink:type="simple"/></inline-formula> and whose output labels yield <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e090" xlink:type="simple"/></inline-formula>.</p>
        <p><italic>Equivalence</italic>: If <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e091" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e092" xlink:type="simple"/></inline-formula> have the same input and output alphabets (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e093" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e094" xlink:type="simple"/></inline-formula>) and the same sequence weights <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e095" xlink:type="simple"/></inline-formula>, then we say the transducers are <italic>equivalent</italic>, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e096" xlink:type="simple"/></inline-formula>. Less formally, we will write <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e097" xlink:type="simple"/></inline-formula> if <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e098" xlink:type="simple"/></inline-formula>.</p>
        <p><italic>Moore transducers</italic>: The <italic>Moore normal form</italic> for transducers, named for Moore machines <xref ref-type="bibr" rid="pone.0034572-Moore1">[50]</xref>, associates input/output with three distinct types of state: <italic>Match</italic>, <italic>Insert</italic> and <italic>Delete</italic>. Paths through Moore transducers can be associated with (gapped) pairwise alignments of input and output sequences. For any transducer <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e099" xlink:type="simple"/></inline-formula>, there exists an equivalent Moore-normal form transducer <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e100" xlink:type="simple"/></inline-formula> with <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e101" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e102" xlink:type="simple"/></inline-formula>.</p>
        <p><italic>Composition</italic>: If <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e103" xlink:type="simple"/></inline-formula>'s output alphabet is the same as <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e104" xlink:type="simple"/></inline-formula>'s input alphabet (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e105" xlink:type="simple"/></inline-formula>), there exists a transducer, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e106" xlink:type="simple"/></inline-formula>, that unifies the output of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e107" xlink:type="simple"/></inline-formula> with the input of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e108" xlink:type="simple"/></inline-formula>, such that <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e109" xlink:type="simple"/></inline-formula>:<disp-formula><graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.e110" xlink:type="simple"/><label>(2)</label></disp-formula>If <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e111" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e112" xlink:type="simple"/></inline-formula> are in Moore form, then <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e113" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e114" xlink:type="simple"/></inline-formula>.</p>
        <p><italic>Intersection</italic>: If <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e115" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e116" xlink:type="simple"/></inline-formula> have the same input alphabets (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e117" xlink:type="simple"/></inline-formula>), there exists a transducer, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e118" xlink:type="simple"/></inline-formula>, that unifies the input of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e119" xlink:type="simple"/></inline-formula> with the input of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e120" xlink:type="simple"/></inline-formula>. The output alphabet is <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e121" xlink:type="simple"/></inline-formula>, i.e. a <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e122" xlink:type="simple"/></inline-formula>-output symbol (or a gap) aligned with a <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e123" xlink:type="simple"/></inline-formula>-output symbol (or a gap).</p>
        <p>Let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e124" xlink:type="simple"/></inline-formula> denote the set of all gapped pairwise alignments of sequences <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e125" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e126" xlink:type="simple"/></inline-formula>. Transducer <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e127" xlink:type="simple"/></inline-formula> has the property that <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e128" xlink:type="simple"/></inline-formula>:<disp-formula><graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.e129" xlink:type="simple"/><label>(3)</label></disp-formula>If <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e130" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e131" xlink:type="simple"/></inline-formula> are in Moore form, then <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e132" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e133" xlink:type="simple"/></inline-formula>. Paths through <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e134" xlink:type="simple"/></inline-formula> are associated with three-way alignments of the input sequence to the two output sequences.</p>
        <p><italic>Identity</italic>: Let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e135" xlink:type="simple"/></inline-formula> be a transducer that copies input to output unmodified, so <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e136" xlink:type="simple"/></inline-formula>.</p>
        <p><italic>Exact match</italic>: For any sequence <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e137" xlink:type="simple"/></inline-formula>, there exists a Moore-form transducer <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e138" xlink:type="simple"/></inline-formula> with <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e139" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e140" xlink:type="simple"/></inline-formula>, that rejects all input except <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e141" xlink:type="simple"/></inline-formula>, such that <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e142" xlink:type="simple"/></inline-formula> if <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e143" xlink:type="simple"/></inline-formula>, and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e144" xlink:type="simple"/></inline-formula> if <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e145" xlink:type="simple"/></inline-formula>. Note that <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e146" xlink:type="simple"/></inline-formula> outputs nothing (the empty string).</p>
        <p><italic>Chapman-Kolmogorov transducers</italic>: A transducer <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e147" xlink:type="simple"/></inline-formula> is <italic>probabilistic</italic> if <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e148" xlink:type="simple"/></inline-formula> represents a probability <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e149" xlink:type="simple"/></inline-formula>: that is, for any given input string, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e150" xlink:type="simple"/></inline-formula>, it defines a probability measure on output strings, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e151" xlink:type="simple"/></inline-formula>.</p>
        <p>Suppose <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e152" xlink:type="simple"/></inline-formula> is a function returning a probabilistic transducer of the form <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e153" xlink:type="simple"/></inline-formula>, i.e. a transducer whose transition weight <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e154" xlink:type="simple"/></inline-formula> depends on an additional <italic>time parameter</italic>, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e155" xlink:type="simple"/></inline-formula>, and which satisfies the transducer equivalence <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e156" xlink:type="simple"/></inline-formula>.</p>
        <p>Then <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e157" xlink:type="simple"/></inline-formula> gives the finite-time transition probabilities of a homogeneous continuous-time Markov process on the strings <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e158" xlink:type="simple"/></inline-formula>, as the above transducer equivalence is a form of the Chapman-Kolmogorov equation.</p>
        <p>If the state space of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e159" xlink:type="simple"/></inline-formula> is finite, then this equation describes a renormalization of the composed state space <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e160" xlink:type="simple"/></inline-formula> back down to the original state space <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e161" xlink:type="simple"/></inline-formula>. So far, only one nontrivial time-dependent transducer is known that solves this equation exactly using a finite number of states: the TKF91 model <xref ref-type="bibr" rid="pone.0034572-Thorne2">[51]</xref>.</p>
      </sec>
      <sec id="s4c">
        <title>The phylogenetic likelihood</title>
        <p>We rewrite the evidence, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e162" xlink:type="simple"/></inline-formula> for sequences <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e163" xlink:type="simple"/></inline-formula>, tree <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e164" xlink:type="simple"/></inline-formula>, and parameters <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e165" xlink:type="simple"/></inline-formula>, in the form <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e166" xlink:type="simple"/></inline-formula> where <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e167" xlink:type="simple"/></inline-formula> denotes the set of sequences observed at leaf nodes, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e168" xlink:type="simple"/></inline-formula> denotes the stochastic evolutionary processes occuring on the branches, and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e169" xlink:type="simple"/></inline-formula> denotes the probabilistic model for the sequence at the root node of the tree.</p>
        <p>The root and branch transducers <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e170" xlink:type="simple"/></inline-formula> represent an alternative view of the tree and parameters <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e171" xlink:type="simple"/></inline-formula>. The root transducer <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e172" xlink:type="simple"/></inline-formula> outputs from the equilibrium or other initial distribution of the process. If <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e173" xlink:type="simple"/></inline-formula> is a parent-child pair, then <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e174" xlink:type="simple"/></inline-formula> is a time-dependent transducer parameterized by the branch length. In practise, the branch transducers need not satisfy the Chapman-Kolmogorov equation for the following constructs to be of use; for example, the <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e175" xlink:type="simple"/></inline-formula> might be approximations to true Chapman-Kolmogorov transducers <xref ref-type="bibr" rid="pone.0034572-Mikls1">[52]</xref>.</p>
        <p>Let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e176" xlink:type="simple"/></inline-formula> be a transducer outputting sequences sampled from the prior at the phylogenetic root.</p>
        <p>Let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e177" xlink:type="simple"/></inline-formula> be a tree node. If <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e178" xlink:type="simple"/></inline-formula> is a leaf, define <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e179" xlink:type="simple"/></inline-formula>. Otherwise, let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e180" xlink:type="simple"/></inline-formula> denote the left and right child nodes, and define <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e181" xlink:type="simple"/></inline-formula> where <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e182" xlink:type="simple"/></inline-formula> is a transducer modeling the evolution on the branch leading to <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e183" xlink:type="simple"/></inline-formula>.</p>
        <p>Diagramatically we can write <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e184" xlink:type="simple"/></inline-formula> as (.. (.<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e185" xlink:type="simple"/></inline-formula>. (.<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e186" xlink:type="simple"/></inline-formula>.)) (.<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e187" xlink:type="simple"/></inline-formula>. (.<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e188" xlink:type="simple"/></inline-formula>.)))</p>
        <p>The phylogenetic likelihood is then fully described by <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e189" xlink:type="simple"/></inline-formula>.</p>
        <p>Like <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e190" xlink:type="simple"/></inline-formula>, transducer <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e191" xlink:type="simple"/></inline-formula> models a probability distribution over output sequences, but accepts only the empty string as an input sequence. This empty input sequence is just a technical formality (transducers must have inputs); if we ignore it, we can think of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e192" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e193" xlink:type="simple"/></inline-formula> as hidden Markov models (HMMs), rather than transducers. <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e194" xlink:type="simple"/></inline-formula> is an HMM that generates a single sequence, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e195" xlink:type="simple"/></inline-formula> a multi-sequence HMM that generates the whole set of leaf sequences.</p>
        <p>Inference with HMMs often uses a dynamic programming matrix (e.g. the Forward matrix) to track the ways that a given evidential sequence can be produced by a given grammar.</p>
        <p>For our purposes it is useful to introduce the evidence in a different way, by transforming the model to incorporate the evidence directly. We augment the state space so that the model is no longer capable of generating any sequences <italic>except</italic> the observed <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e196" xlink:type="simple"/></inline-formula>, by composing <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e197" xlink:type="simple"/></inline-formula>'s forked outputs with exact-match transducers that will only accept the observed sequences at the leaves of the tree. This yields a model, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e198" xlink:type="simple"/></inline-formula>, whose state space is of size <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e199" xlink:type="simple"/></inline-formula> and, in fact, is directly analogous to the Forward matrix.</p>
        <p>If <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e200" xlink:type="simple"/></inline-formula> is a leaf node, then let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e201" xlink:type="simple"/></inline-formula> where <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e202" xlink:type="simple"/></inline-formula> is the sequence at <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e203" xlink:type="simple"/></inline-formula>. Otherwise, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e204" xlink:type="simple"/></inline-formula>.</p>
        <p>Diagramatically we can write <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e205" xlink:type="simple"/></inline-formula> as (.. (.<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e206" xlink:type="simple"/></inline-formula>..<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e207" xlink:type="simple"/></inline-formula>.) (.<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e208" xlink:type="simple"/></inline-formula>. .<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e209" xlink:type="simple"/></inline-formula>.))</p>
        <p>Let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e210" xlink:type="simple"/></inline-formula>. The evidence is <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e211" xlink:type="simple"/></inline-formula>.</p>
        <p>The net output of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e212" xlink:type="simple"/></inline-formula> is always the empty string. The sequences <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e213" xlink:type="simple"/></inline-formula> are recognized as inputs by the <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e214" xlink:type="simple"/></inline-formula> transducers at the tips of the tree, but are not passed on as outputs themselves.</p>
        <p>Likewise, the input of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e215" xlink:type="simple"/></inline-formula> is the empty string, because <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e216" xlink:type="simple"/></inline-formula> accepts only the empty string on its input.</p>
        <p>We can think of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e217" xlink:type="simple"/></inline-formula> as a Markov model, rather than an HMM. It has no input or output; rather, the sequences are encoded into its structure.</p>
        <p>Transducer <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e218" xlink:type="simple"/></inline-formula> has <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e219" xlink:type="simple"/></inline-formula> states, which is impractically many, so ProtPal uses a progressive hierarchy <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e220" xlink:type="simple"/></inline-formula> of approximations to the corresponding <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e221" xlink:type="simple"/></inline-formula>, with state spaces that are bounded in size.</p>
        <p>If <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e222" xlink:type="simple"/></inline-formula> is a leaf node, let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e223" xlink:type="simple"/></inline-formula>. Otherwise, let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e224" xlink:type="simple"/></inline-formula> where <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e225" xlink:type="simple"/></inline-formula> is a subset defined by sampling complete paths through the Markov model <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e226" xlink:type="simple"/></inline-formula> and adding the <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e227" xlink:type="simple"/></inline-formula>-states used by those paths to <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e228" xlink:type="simple"/></inline-formula>, until the pre-specified bound on <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e229" xlink:type="simple"/></inline-formula> is reached. Then <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e230" xlink:type="simple"/></inline-formula>.</p>
        <p>The likelihood of a given history may be calculated by summing over paths through <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e231" xlink:type="simple"/></inline-formula> consistent with that history. In the simplest cases (e.g. minimal Moore-form branch transducers), each indel history corresponds to exactly one path, so the MAP indel history corresponds to the maximum-weight state path through <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e232" xlink:type="simple"/></inline-formula>.</p>
      </sec>
      <sec id="s4d">
        <title>Alignment envelopes</title>
        <p>Let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e233" xlink:type="simple"/></inline-formula> be defined such that it has only one nonzero-weighted path<disp-formula><graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.e234" xlink:type="simple"/></disp-formula>so a <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e235" xlink:type="simple"/></inline-formula>-state is either the start state (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e236" xlink:type="simple"/></inline-formula>), the end state (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e237" xlink:type="simple"/></inline-formula>), a wait state (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e238" xlink:type="simple"/></inline-formula>) or a match state (<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e239" xlink:type="simple"/></inline-formula>). All these states have the form <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e240" xlink:type="simple"/></inline-formula> where <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e241" xlink:type="simple"/></inline-formula> represents the number of symbols of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e242" xlink:type="simple"/></inline-formula> that have to be read in order to reach that state, i.e. a “co-ordinate” into <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e243" xlink:type="simple"/></inline-formula>. All <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e244" xlink:type="simple"/></inline-formula>-states are labeled with such co-ordinates, as are the states of any transducer that is a composition involving <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e245" xlink:type="simple"/></inline-formula>, such as <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e246" xlink:type="simple"/></inline-formula> or <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e247" xlink:type="simple"/></inline-formula>.</p>
        <p>For example, in a simple case involving a root node (1) with two children (2,3) whose sequences are constrained to be <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e248" xlink:type="simple"/></inline-formula>, the evidence transducer is <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e249" xlink:type="simple"/></inline-formula> = (.<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e250" xlink:type="simple"/></inline-formula>. (.<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e251" xlink:type="simple"/></inline-formula>..<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e252" xlink:type="simple"/></inline-formula>.) (.<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e253" xlink:type="simple"/></inline-formula>..<inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e254" xlink:type="simple"/></inline-formula>.))</p>
        <p>All states of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e255" xlink:type="simple"/></inline-formula> have the form <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e256" xlink:type="simple"/></inline-formula> where <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e257" xlink:type="simple"/></inline-formula>, so <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e258" xlink:type="simple"/></inline-formula> and similarly for <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e259" xlink:type="simple"/></inline-formula>. Thus, each state in <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e260" xlink:type="simple"/></inline-formula> is associated with a co-ordinate pair <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e261" xlink:type="simple"/></inline-formula> into <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e262" xlink:type="simple"/></inline-formula>, as well as a state-type pair <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e263" xlink:type="simple"/></inline-formula>.</p>
        <p>Let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e264" xlink:type="simple"/></inline-formula> be a node in the tree, let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e265" xlink:type="simple"/></inline-formula> be the set of indices of leaf nodes descended from <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e266" xlink:type="simple"/></inline-formula>, and let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e267" xlink:type="simple"/></inline-formula> be the phylogenetic transducer for the subtree rooted at <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e268" xlink:type="simple"/></inline-formula>, defined in Section. Let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e269" xlink:type="simple"/></inline-formula> be the state space of <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e270" xlink:type="simple"/></inline-formula>.</p>
        <p>If <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e271" xlink:type="simple"/></inline-formula> is a leaf node descended from <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e272" xlink:type="simple"/></inline-formula>, then <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e273" xlink:type="simple"/></inline-formula> includes, as a component, the transducer <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e274" xlink:type="simple"/></inline-formula>. Any <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e275" xlink:type="simple"/></inline-formula>-state, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e276" xlink:type="simple"/></inline-formula>, is a tuple, one element of which is a <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e277" xlink:type="simple"/></inline-formula>-state, <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e278" xlink:type="simple"/></inline-formula>, where <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e279" xlink:type="simple"/></inline-formula> is a co-ordinate (into sequence <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e280" xlink:type="simple"/></inline-formula>) and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e281" xlink:type="simple"/></inline-formula> is a state-type. Define <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e282" xlink:type="simple"/></inline-formula> to be the co-ordinate and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e283" xlink:type="simple"/></inline-formula> to be the corresponding state-type.</p>
        <p>Let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e284" xlink:type="simple"/></inline-formula> be the function returning the set of <italic>absorbing leaf indices</italic> for a state, such that the existence of a finite-weight transition <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e285" xlink:type="simple"/></inline-formula> implies that <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e286" xlink:type="simple"/></inline-formula> for all <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e287" xlink:type="simple"/></inline-formula>.</p>
        <p>Let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e288" xlink:type="simple"/></inline-formula> be two sibling nodes. The <italic>alignment envelope</italic> is the set of sibling state-pairs from <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e289" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e290" xlink:type="simple"/></inline-formula> that can be aligned. The function <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e291" xlink:type="simple"/></inline-formula> indicates membership of the envelope. For example, this basic envelope allows only sibling co-ordinates separated by a distance <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e292" xlink:type="simple"/></inline-formula> or less<disp-formula><graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.e293" xlink:type="simple"/><label>(4)</label></disp-formula></p>
        <p>An alignment envelope can be based on a <italic>guide alignment</italic>. For leaf nodes <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e294" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e295" xlink:type="simple"/></inline-formula>, let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e296" xlink:type="simple"/></inline-formula> be the number of residues of sequence <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e297" xlink:type="simple"/></inline-formula> in the section of the guide alignment from the first column, up to and including the column containing residue <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e298" xlink:type="simple"/></inline-formula> of sequence <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e299" xlink:type="simple"/></inline-formula>.</p>
        <p>This envelope excludes a pair of sibling states if they include a homology between residues which is more than <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e300" xlink:type="simple"/></inline-formula> from the homology of those characters contained in the guide alignment:<disp-formula><graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.e301" xlink:type="simple"/><label>(5)</label></disp-formula></p>
        <p>Let <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e302" xlink:type="simple"/></inline-formula> be the number of match columns (those columns of the guide alignment in which both <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e303" xlink:type="simple"/></inline-formula> and <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e304" xlink:type="simple"/></inline-formula> have a non-gap character) between the column containing residue <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e305" xlink:type="simple"/></inline-formula> of sequence <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e306" xlink:type="simple"/></inline-formula> and the column containing residue <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e307" xlink:type="simple"/></inline-formula> of sequence <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e308" xlink:type="simple"/></inline-formula>. This envelope excludes a pair of sibling states if they include a homology between residues which is more than <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e309" xlink:type="simple"/></inline-formula> <italic>matches</italic> from the homology of those characters contained in the guide alignment:<disp-formula><graphic mimetype="image" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.e310" xlink:type="simple"/></disp-formula></p>
      </sec>
      <sec id="s4e">
        <title>OPTIC data analysis</title>
        <sec id="s4e1">
          <title>Data</title>
          <p>Amniote gene families were downloaded from <ext-link ext-link-type="uri" xlink:href="http://genserv.anat.ox.ac.uk/downloads/clades/" xlink:type="simple">http://genserv.anat.ox.ac.uk/downloads/clades/</ext-link>. We restricted our analysis to the <inline-formula><inline-graphic mimetype="image" xlink:href="info:doi/10.1371/journal.pone.0034572.e311" xlink:type="simple"/></inline-formula>7,500 families having simple 1∶1 orthologies. The same species tree topology (downloaded from <ext-link ext-link-type="uri" xlink:href="http://genserv.anat.ox.ac.uk/clades/amniota/displayPhylogeny" xlink:type="simple">http://genserv.anat.ox.ac.uk/clades/amniota/displayPhylogeny</ext-link> was used for all reconstructions, though branch lengths were estimated separately for each family as part of OPTIC. When computing branch-specific indel rates, the branch lengths of the species tree were used.</p>
        </sec>
        <sec id="s4e2">
          <title>Reconstruction and rate estimation</title>
          <p>Gene families were aligned and reconstructed using ProtPal with a 3-rate class Markov chain over amino acids, insertion and deletion rates set to 0.01, and 250 traceback samples. Averaged and per-branch indel rates were computed with ProtPal using the -pi and -pb options. The indel rates were then normalized by the synonymous substitution rate for each corresponding nucleotide alignment (taken directly from OPTIC), computed with PAML <xref ref-type="bibr" rid="pone.0034572-Yang3">[53]</xref>. Residues' origins were determined by finding the tree node closest to the root containing a non-gap reconstructed character.</p>
        </sec>
        <sec id="s4e3">
          <title>External data</title>
          <p>Genes were mapped to Gene Ontology terms via the mapping downloaded from <ext-link ext-link-type="uri" xlink:href="http://www.ebi.ac.uk/GOA/human_release.html" xlink:type="simple">http://www.ebi.ac.uk/GOA/human_release.html</ext-link> during 10/2010. Indel SNPs per gene were taken from a table downloaded from Supplemental Table 5 of <xref ref-type="bibr" rid="pone.0034572-Mills1">[54]</xref>.</p>
        </sec>
      </sec>
    </sec>
    <sec id="s5">
      <title>Supporting Information</title>
      <supplementary-material id="pone.0034572.s001" mimetype="application/pdf" position="float" xlink:href="info:doi/10.1371/journal.pone.0034572.s001" xlink:type="simple">
        <label>Text S1</label>
        <caption>
          <p>
            <bold>Contains techinical details concerning generation of simulation data, analysis of OPTIC data, as well as figures pertaining to both simulated and OPTIC data.</bold>
          </p>
          <p>(PDF)</p>
        </caption>
      </supplementary-material>
    </sec>
  </body>
  <back>
    <ack>
      <p>The authors thank Erick Matsen and Lars Barquist for insightful comments on the manuscript.</p>
    </ack>
    <ref-list>
      <title>References</title>
      <ref id="pone.0034572-Qu1">
        <label>1</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Qu</surname><given-names>X</given-names></name><name name-style="western"><surname>Swanson</surname><given-names>R</given-names></name><name name-style="western"><surname>Day</surname><given-names>R</given-names></name><name name-style="western"><surname>Tsai</surname><given-names>J</given-names></name></person-group>             <year>2009</year>             <article-title>A guide to template based structure prediction.</article-title>             <source>Curr Protein Pept Sci</source>             <volume>10</volume>             <fpage>270</fpage>             <lpage>85</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Moses1">
        <label>2</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Moses</surname><given-names>AM</given-names></name><name name-style="western"><surname>Chiang</surname><given-names>DY</given-names></name><name name-style="western"><surname>Pollard</surname><given-names>DA</given-names></name><name name-style="western"><surname>Iyer</surname><given-names>VN</given-names></name><name name-style="western"><surname>Eisen</surname><given-names>MB</given-names></name></person-group>             <year>2004</year>             <article-title>MONKEY: identifying conserved transcription-factor binding sites in multiple alignments using a binding site-specific evolutionary model.</article-title>             <source>Genome Biology</source>             <volume>5</volume>          </element-citation>
      </ref>
      <ref id="pone.0034572-Pollard1">
        <label>3</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Pollard</surname><given-names>KS</given-names></name><name name-style="western"><surname>Salama</surname><given-names>SR</given-names></name><name name-style="western"><surname>Lambert</surname><given-names>N</given-names></name><name name-style="western"><surname>Lambot</surname><given-names>M</given-names></name><name name-style="western"><surname>Coppens</surname><given-names>S</given-names></name><etal/></person-group>             <year>2006</year>             <article-title>An RNA gene expressed during cortical development evolved rapidly in humans.</article-title>             <source>Nature</source>             <volume>443</volume>             <fpage>167</fpage>             <lpage>172</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Thompson1">
        <label>4</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Thompson</surname><given-names>JD</given-names></name><name name-style="western"><surname>Plewniak</surname><given-names>F</given-names></name><name name-style="western"><surname>Poch</surname><given-names>O</given-names></name></person-group>             <year>1999</year>             <article-title>A comprehensive comparison of multiple sequence alignment programs.</article-title>             <source>Nucleic Acids Research</source>             <volume>27</volume>             <fpage>2682</fpage>             <lpage>2690</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Wong1">
        <label>5</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Wong</surname><given-names>KM</given-names></name><name name-style="western"><surname>Suchard</surname><given-names>MA</given-names></name><name name-style="western"><surname>Huelsenbeck</surname><given-names>JP</given-names></name></person-group>             <year>2008</year>             <article-title>Alignment uncertainty and genomic analysis.</article-title>             <source>Science</source>             <volume>319</volume>             <fpage>473</fpage>             <lpage>6</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Lytynoja1">
        <label>6</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Löytynoja</surname><given-names>A</given-names></name><name name-style="western"><surname>Goldman</surname><given-names>N</given-names></name></person-group>             <year>2008</year>             <article-title>Phylogeny-aware gap placement prevents errors in sequence alignment and evolutionary analysis.</article-title>             <source>Science</source>             <volume>320</volume>             <fpage>1632</fpage>             <lpage>1635</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-MarkovaRaina1">
        <label>7</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Markova-Raina</surname><given-names>P</given-names></name><name name-style="western"><surname>Petrov</surname><given-names>D</given-names></name></person-group>             <year>2011</year>             <article-title>High sensitivity to aligner and high rate of false positives in the estimates of positive selection in the 12 Drosophila genomes.</article-title>             <source>Genome Research</source>             <volume>21</volume>             <fpage>863</fpage>             <lpage>874</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Nelesen1">
        <label>8</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Nelesen</surname><given-names>S</given-names></name><name name-style="western"><surname>Liu</surname><given-names>K</given-names></name><name name-style="western"><surname>Zhao</surname><given-names>D</given-names></name><name name-style="western"><surname>Linder</surname><given-names>CR</given-names></name><name name-style="western"><surname>Warnow</surname><given-names>T</given-names></name></person-group>             <year>2008</year>             <article-title>The effect of the guide tree on multiple sequence alignments and subsequent phylogenetic analyses.</article-title>             <source>Pacific Symposium on Biocomputing</source>             <volume>2008</volume>             <fpage>25</fpage>             <lpage>36</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Liu1">
        <label>9</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Liu</surname><given-names>K</given-names></name><name name-style="western"><surname>Nelesen</surname><given-names>S</given-names></name><name name-style="western"><surname>Raghavan</surname><given-names>S</given-names></name><name name-style="western"><surname>Linder</surname><given-names>CR</given-names></name><name name-style="western"><surname>Warnow</surname><given-names>T</given-names></name></person-group>             <year>2009</year>             <article-title>Barking up the wrong treelength: the impact of gap penalty on alignment and tree accuracy.</article-title>             <source>IEEE/ACM Trans Comput Biol Bioinform</source>             <volume>6</volume>             <fpage>7</fpage>             <lpage>21</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-project1">
        <label>10</label>
        <element-citation publication-type="journal" xlink:type="simple">             <collab xlink:type="simple">project consortium E</collab>             <year>2007</year>             <article-title>Analyses of deep mammalian sequence alignments and constraint predictions for 1% of the human genome.</article-title>             <source>Genome Research</source>             <volume>17</volume>             <fpage>760</fpage>             <lpage>774</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Bradley1">
        <label>11</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Bradley</surname><given-names>RK</given-names></name><name name-style="western"><surname>Uzilov</surname><given-names>AV</given-names></name><name name-style="western"><surname>Skinner</surname><given-names>ME</given-names></name><name name-style="western"><surname>Bendana</surname><given-names>YR</given-names></name><name name-style="western"><surname>Barquist</surname><given-names>L</given-names></name><etal/></person-group>             <year>2009</year>             <article-title>Evolutionary modeling and prediction of non-coding RNAs in Drosophila.</article-title>             <source>PLoS ONE</source>             <volume>4</volume>             <fpage>e6478</fpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Strope1">
        <label>12</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Strope</surname><given-names>C</given-names></name><name name-style="western"><surname>Abel</surname><given-names>K</given-names></name><name name-style="western"><surname>Scott</surname><given-names>S</given-names></name><name name-style="western"><surname>Moriyama</surname><given-names>E</given-names></name></person-group>             <year>2009</year>             <article-title>Biological sequence simulation for testing complex evolutionary hypotheses: indel-seq-gen version 2.0.</article-title>             <source>Mol Biol Evol</source>             <volume>26</volume>             <fpage>2581</fpage>             <lpage>93</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Holmes1">
        <label>13</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Holmes</surname><given-names>I</given-names></name><name name-style="western"><surname>Bruno</surname><given-names>WJ</given-names></name></person-group>             <year>2001</year>             <article-title>Evolutionary HMMs: a Bayesian approach to multiple alignment.</article-title>             <source>Bioinformatics</source>             <volume>17</volume>             <fpage>803</fpage>             <lpage>820</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Suchard1">
        <label>14</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Suchard</surname><given-names>MA</given-names></name><name name-style="western"><surname>Redelings</surname><given-names>BD</given-names></name></person-group>             <year>2006</year>             <article-title>BAli-Phy: simultaneous Bayesian inference of alignment and phylogeny.</article-title>             <source>Bioinformatics</source>             <volume>22</volume>             <fpage>2047</fpage>             <lpage>2048</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Lytynoja2">
        <label>15</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Löytynoja</surname><given-names>A</given-names></name><name name-style="western"><surname>Goldman</surname><given-names>N</given-names></name></person-group>             <year>2005</year>             <article-title>An algorithm for progressive multiple alignment of sequences with insertions.</article-title>             <source>Proceedings of the National Academy of Sciences of the USA</source>             <volume>102</volume>             <fpage>10557</fpage>             <lpage>62</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Edgar1">
        <label>16</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Edgar</surname><given-names>RC</given-names></name></person-group>             <year>2004</year>             <article-title>MUSCLE: a multiple sequence alignment method with reduced time and space complexity.</article-title>             <source>BMC Bioinformatics</source>             <volume>5</volume>             <fpage>113</fpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Larkin1">
        <label>17</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Larkin</surname><given-names>M</given-names></name><name name-style="western"><surname>Blackshields</surname><given-names>G</given-names></name><name name-style="western"><surname>Brown</surname><given-names>N</given-names></name><name name-style="western"><surname>Chenna</surname><given-names>R</given-names></name><name name-style="western"><surname>McGettigan</surname><given-names>P</given-names></name><etal/></person-group>             <year>2007</year>             <article-title>Clustal W and Clustal X version 2.0.</article-title>             <source>Bioinformatics</source>             <volume>23</volume>             <fpage>2947</fpage>             <lpage>2948</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Katoh1">
        <label>18</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Katoh</surname><given-names>K</given-names></name><name name-style="western"><surname>Kuma</surname><given-names>K</given-names></name><name name-style="western"><surname>Toh</surname><given-names>H</given-names></name><name name-style="western"><surname>Miyata</surname><given-names>T</given-names></name></person-group>             <year>2005</year>             <article-title>Mafft version 5: improvement in accuracy of multiple sequence alignment.</article-title>             <source>Nucleic Acids Research</source>             <volume>33</volume>             <fpage>511</fpage>             <lpage>518</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Felsenstein1">
        <label>19</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Felsenstein</surname><given-names>J</given-names></name></person-group>             <year>1981</year>             <article-title>Evolutionary trees from DNA sequences: a maximum likelihood approach.</article-title>             <source>Journal of Molecular Evolution</source>             <volume>17</volume>             <fpage>368</fpage>             <lpage>376</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Higgins1">
        <label>20</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Higgins</surname><given-names>DG</given-names></name><name name-style="western"><surname>Bleasby</surname><given-names>AJ</given-names></name><name name-style="western"><surname>Fuchs</surname><given-names>R</given-names></name></person-group>             <year>1992</year>             <article-title>CLUSTAL V: improved software for multiple sequence alignment.</article-title>             <source>Computer Applications in the Biosciences</source>             <volume>8</volume>             <fpage>189</fpage>             <lpage>191</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Lee1">
        <label>21</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Lee</surname><given-names>C</given-names></name><name name-style="western"><surname>Grasso</surname><given-names>C</given-names></name><name name-style="western"><surname>Sharlow</surname><given-names>M</given-names></name></person-group>             <year>2002</year>             <article-title>Multiple sequence alignment using partial order graphs.</article-title>             <source>Bioinformatics</source>             <volume>18</volume>             <fpage>452</fpage>             <lpage>464</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Cartwright1">
        <label>22</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Cartwright</surname><given-names>RA</given-names></name></person-group>             <year>2005</year>             <article-title>DNA assembly with gaps (Dawg): simulating sequence evolution.</article-title>             <source>Bioinformatics</source>             <volume>21</volume>             <supplement>Suppl 3</supplement>             <fpage>iii31</fpage>             <lpage>8</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Bradley2">
        <label>23</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Bradley</surname><given-names>RK</given-names></name><name name-style="western"><surname>Roberts</surname><given-names>A</given-names></name><name name-style="western"><surname>Smoot</surname><given-names>M</given-names></name><name name-style="western"><surname>Juvekar</surname><given-names>S</given-names></name><name name-style="western"><surname>Do</surname><given-names>J</given-names></name><etal/></person-group>             <year>2009</year>             <article-title>Fast statistical alignment.</article-title>             <source>PLoS Computational Biology</source>             <volume>5</volume>             <fpage>e1000392</fpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Kamneva1">
        <label>24</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Kamneva</surname><given-names>O</given-names></name><name name-style="western"><surname>Liberles</surname><given-names>A</given-names></name><name name-style="western"><surname>Ward</surname><given-names>N</given-names></name></person-group>             <year>2010</year>             <article-title>Genome-wide inuence of indel substitutions on evolution of bacteria of the pvc superphylum, revealed using a novel computational method.</article-title>             <source>Genome Biology and Evolution</source>             <volume>2</volume>             <fpage>870</fpage>             <lpage>886</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Zhang1">
        <label>25</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Zhang</surname><given-names>Z</given-names></name><name name-style="western"><surname>Huang</surname><given-names>J</given-names></name><name name-style="western"><surname>Wang</surname><given-names>Z</given-names></name><name name-style="western"><surname>WAng</surname><given-names>L</given-names></name><name name-style="western"><surname>Peiji</surname><given-names>G</given-names></name></person-group>             <year>2011</year>             <article-title>Impact of indels on the anking regions in structural domains.</article-title>             <source>Molecular Biology and Evolution</source>             <volume>28</volume>             <fpage>291</fpage>             <lpage>301</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Zhu1">
        <label>26</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Zhu</surname><given-names>L</given-names></name><name name-style="western"><surname>Wang</surname><given-names>Q</given-names></name><name name-style="western"><surname>Tang</surname><given-names>P</given-names></name><name name-style="western"><surname>Araki</surname><given-names>H</given-names></name><name name-style="western"><surname>Tian</surname><given-names>D</given-names></name></person-group>             <year>2009</year>             <article-title>Genomewide association between insertions/deletions and the nucleotide diversity in bacteria.</article-title>             <source>Molecular Biology and Evolution</source>             <volume>26</volume>             <fpage>2353</fpage>             <lpage>2361</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-GomezValero1">
        <label>27</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Gomez-Valero</surname><given-names>L</given-names></name><name name-style="western"><surname>Latorre</surname><given-names>A</given-names></name><name name-style="western"><surname>Gil</surname><given-names>R</given-names></name><name name-style="western"><surname>Gadau</surname><given-names>J</given-names></name><name name-style="western"><surname>Feldhaar</surname><given-names>H</given-names></name><etal/></person-group>             <year>2008</year>             <article-title>Patterns and rates of nucleotide substitution, insertion and deletion in the endosymbiont of ants blochmannia oridanus.</article-title>             <source>Molecular Ecology</source>             <volume>17</volume>             <fpage>4382</fpage>             <lpage>4392</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Clark1">
        <label>28</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Clark</surname><given-names>AG</given-names></name><name name-style="western"><surname>Eisen</surname><given-names>MB</given-names></name><name name-style="western"><surname>Smith</surname><given-names>DR</given-names></name><name name-style="western"><surname>Bergman</surname><given-names>CM</given-names></name><name name-style="western"><surname>Oliver</surname><given-names>B</given-names></name><etal/></person-group>             <year>2007</year>             <article-title>Evolution of genes and genomes on the Drosophila phylogeny.</article-title>             <source>Nature</source>             <volume>450</volume>             <fpage>203</fpage>             <lpage>218</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Lunter1">
        <label>29</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Lunter</surname><given-names>G</given-names></name></person-group>             <year>2007</year>             <article-title>Probabilistic whole-genome alignments reveal high indel rates in the human and mouse genomes.</article-title>             <source>Bioinformatics</source>             <volume>23</volume>             <fpage>289</fpage>             <lpage>296</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Heger1">
        <label>30</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Heger</surname><given-names>A</given-names></name><name name-style="western"><surname>Ponting</surname><given-names>C</given-names></name></person-group>             <year>2008</year>             <article-title>OPTIC: orthologous and paralogous transcripts in clades.</article-title>             <source>NAR</source>             <volume>36</volume>             <fpage>267</fpage>             <lpage>270</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-delaChaux1">
        <label>31</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>de la Chaux</surname><given-names>N</given-names></name><name name-style="western"><surname>Messeer</surname><given-names>P</given-names></name><name name-style="western"><surname>Arndt</surname><given-names>P</given-names></name></person-group>             <year>2007</year>             <article-title>DNA indels in coding regions reveal selective contraints on protein evolution in the human lineage.</article-title>             <source>BMC Evolutionary Biology</source>             <volume>7</volume>          </element-citation>
      </ref>
      <ref id="pone.0034572-Wang1">
        <label>32</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Wang</surname><given-names>Z</given-names></name><name name-style="western"><surname>Martin</surname><given-names>J</given-names></name><name name-style="western"><surname>Abubucker</surname><given-names>S</given-names></name><name name-style="western"><surname>Yin</surname><given-names>Y</given-names></name><name name-style="western"><surname>Gasser</surname><given-names>R</given-names></name><etal/></person-group>             <year>2009</year>             <article-title>Systematic analysis of insertions and deletions specific to nematode proteins and their proposed functional and evolutionary relevance.</article-title>             <source>BMC Evol Biol</source>             <volume>9</volume>          </element-citation>
      </ref>
      <ref id="pone.0034572-Saccone1">
        <label>33</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Saccone</surname><given-names>S</given-names></name><name name-style="western"><surname>Quan</surname><given-names>J</given-names></name><name name-style="western"><surname>Mehta</surname><given-names>G</given-names></name><name name-style="western"><surname>Bolze</surname><given-names>R</given-names></name><name name-style="western"><surname>Thomas</surname><given-names>P</given-names></name><etal/></person-group>             <year>2011</year>             <article-title>New tools and methods for direct programmatic access to the dbSNP relational database.</article-title>             <source>Nucleic Acids Res</source>          </element-citation>
      </ref>
      <ref id="pone.0034572-Beissbarth1">
        <label>34</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Beissbarth</surname><given-names>T</given-names></name><name name-style="western"><surname>Speed</surname><given-names>TP</given-names></name></person-group>             <year>2004</year>             <article-title>GOstat: find statistically overrepresented Gene Ontologies within a group of genes.</article-title>             <source>Bioinformatics</source>             <volume>20</volume>             <fpage>1464</fpage>             <lpage>1465</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Initial1">
        <label>35</label>
        <element-citation publication-type="journal" xlink:type="simple">             <year>2002</year>             <article-title>Initial sequencing and comparative analysis of the mouse genome.</article-title>             <source>Nature</source>          </element-citation>
      </ref>
      <ref id="pone.0034572-Matsen1">
        <label>36</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Matsen</surname><given-names>FA</given-names></name><name name-style="western"><surname>Kodner</surname><given-names>RB</given-names></name><name name-style="western"><surname>Armbrust</surname><given-names>EV</given-names></name></person-group>             <year>2010</year>             <article-title>pplacer: linear time maximum-likelihood and Bayesian phylogenetic placement of sequences onto a fixed reference tree.</article-title>             <source>BMC Bioinformatics</source>             <volume>11</volume>             <fpage>538</fpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Yang1">
        <label>37</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Yang</surname><given-names>Z</given-names></name></person-group>             <year>1994</year>             <article-title>Estimating the pattern of nucleotide substitution.</article-title>             <source>Journal of Molecular Evolution</source>             <volume>39</volume>             <fpage>105</fpage>             <lpage>111</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Rannala1">
        <label>38</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Rannala</surname><given-names>B</given-names></name><name name-style="western"><surname>Yang</surname><given-names>Z</given-names></name></person-group>             <year>1996</year>             <article-title>Probability distribution of molecular evolutionary trees: a new method of phylogenetic inference.</article-title>             <source>Journal of Molecular Evolution</source>             <volume>43</volume>             <fpage>304</fpage>             <lpage>311</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Siepel1">
        <label>39</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Siepel</surname><given-names>A</given-names></name><name name-style="western"><surname>Haussler</surname><given-names>D</given-names></name></person-group>             <year>2004</year>             <article-title>Combining phylogenetic and hidden Markov models in biosequence analysis.</article-title>             <source>Journal of Computational Biology</source>             <volume>11</volume>             <fpage>413</fpage>             <lpage>428</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Yang2">
        <label>40</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Yang</surname><given-names>Z</given-names></name><name name-style="western"><surname>Nielsen</surname><given-names>R</given-names></name><name name-style="western"><surname>Goldman</surname><given-names>N</given-names></name><name name-style="western"><surname>Pedersen</surname><given-names>AM</given-names></name></person-group>             <year>2000</year>             <article-title>Codon-substitution models for heterogeneous selection pressure at amino acid sites.</article-title>             <source>Genetics</source>             <volume>155</volume>             <fpage>432</fpage>             <lpage>449</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Thorne1">
        <label>41</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Thorne</surname><given-names>JL</given-names></name><name name-style="western"><surname>Goldman</surname><given-names>N</given-names></name><name name-style="western"><surname>Jones</surname><given-names>DT</given-names></name></person-group>             <year>1996</year>             <article-title>Combining protein evolution and secondary structure.</article-title>             <source>Molecular Biology and Evolution</source>             <volume>13</volume>             <fpage>666</fpage>             <lpage>673</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Siepel2">
        <label>42</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Siepel</surname><given-names>A</given-names></name><name name-style="western"><surname>Haussler</surname><given-names>D</given-names></name></person-group>             <year>2004</year>             <article-title>Phylogenetic estimation of context-dependent substitution rates by maximum likelihood.</article-title>             <source>Molecular Biology and Evolution</source>             <volume>21</volume>             <fpage>468</fpage>             <lpage>488</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Knudsen1">
        <label>43</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Knudsen</surname><given-names>B</given-names></name><name name-style="western"><surname>Hein</surname><given-names>J</given-names></name></person-group>             <year>1999</year>             <article-title>RNA secondary structure prediction using stochastic context-free grammars and evolutionary history.</article-title>             <source>Bioinformatics</source>             <volume>15</volume>             <fpage>446</fpage>             <lpage>454</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Siepel3">
        <label>44</label>
        <element-citation publication-type="other" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Siepel</surname><given-names>A</given-names></name><name name-style="western"><surname>Haussler</surname><given-names>D</given-names></name></person-group>             <year>2004</year>             <article-title>Computational identification of evolutionarily conserved exons.</article-title>             <person-group person-group-type="editor"><name name-style="western"><surname>Bourne</surname><given-names>P</given-names></name><name name-style="western"><surname>Gusfield</surname><given-names>D</given-names></name></person-group>             <fpage>177</fpage>             <lpage>186</lpage>             <comment>Proceedings of the eighth annual international conference on research in computational molecular biology, San Diego, March 27–31 2004. ACM</comment>          </element-citation>
      </ref>
      <ref id="pone.0034572-Pedersen1">
        <label>45</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Pedersen</surname><given-names>JS</given-names></name><name name-style="western"><surname>Bejerano</surname><given-names>G</given-names></name><name name-style="western"><surname>Siepel</surname><given-names>A</given-names></name><name name-style="western"><surname>Rosenbloom</surname><given-names>K</given-names></name><name name-style="western"><surname>Lindblad-Toh</surname><given-names>K</given-names></name><etal/></person-group>             <year>2006</year>             <article-title>Identification and classification of conserved RNA secondary structures in the human genome.</article-title>             <source>PLoS Computational Biology</source>             <volume>2</volume>             <fpage>e33</fpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Kschischang1">
        <label>46</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Kschischang</surname><given-names>FR</given-names></name><name name-style="western"><surname>Frey</surname><given-names>BJ</given-names></name><name name-style="western"><surname>Loeliger</surname><given-names>HA</given-names></name></person-group>             <year>1998</year>             <article-title>Factor graphs and the sum-product algorithm.</article-title>             <source>IEEE Transactions on Information Theory</source>             <volume>47</volume>             <fpage>498</fpage>             <lpage>519</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Mohri1">
        <label>47</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Mohri</surname><given-names>M</given-names></name><name name-style="western"><surname>Pereira</surname><given-names>F</given-names></name><name name-style="western"><surname>Riley</surname><given-names>M</given-names></name></person-group>             <year>2002</year>             <article-title>Weighted finite-state transducers in speech recognition.</article-title>             <source>Computer Speech and Language</source>             <volume>16</volume>             <fpage>69</fpage>             <lpage>88</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Paten1">
        <label>48</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Paten</surname><given-names>B</given-names></name><name name-style="western"><surname>Herrero</surname><given-names>J</given-names></name><name name-style="western"><surname>Fitzgerald</surname><given-names>S</given-names></name><name name-style="western"><surname>Beal</surname><given-names>K</given-names></name><name name-style="western"><surname>Flicek</surname><given-names>P</given-names></name><etal/></person-group>             <year>2008</year>             <article-title>Genomewide nucleotide-level mammalian ancestor reconstruction.</article-title>             <source>Genome Research</source>             <volume>18</volume>             <fpage>1829</fpage>             <lpage>1843</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Westesson1">
        <label>49</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Westesson</surname><given-names>O</given-names></name><name name-style="western"><surname>Lunter</surname><given-names>G</given-names></name><name name-style="western"><surname>Paten</surname><given-names>B</given-names></name><name name-style="western"><surname>Holmes</surname><given-names>I</given-names></name></person-group>             <year>2011</year>             <article-title>An alignment-free generalization to indels of Felsenstein's phylogenetic pruning algorithm.</article-title>             <source>arXiv</source>          </element-citation>
      </ref>
      <ref id="pone.0034572-Moore1">
        <label>50</label>
        <element-citation publication-type="other" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Moore</surname><given-names>EF</given-names></name></person-group>             <year>1956</year>             <source>Gedanken-experiments on Sequential Machines</source>             <publisher-loc>Princeton, N.J.</publisher-loc>             <publisher-name>Princeton University Press, volume 34 of Annals of Mathematical Studies, chapter 5</publisher-name>             <fpage>129</fpage>             <lpage>153</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Thorne2">
        <label>51</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Thorne</surname><given-names>JL</given-names></name><name name-style="western"><surname>Kishino</surname><given-names>H</given-names></name><name name-style="western"><surname>Felsenstein</surname><given-names>J</given-names></name></person-group>             <year>1991</year>             <article-title>An evolutionary model for maximum likelihood alignment of DNA sequences.</article-title>             <source>Journal of Molecular Evolution</source>             <volume>33</volume>             <fpage>114</fpage>             <lpage>124</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Mikls1">
        <label>52</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Miklós</surname><given-names>I</given-names></name><name name-style="western"><surname>Lunter</surname><given-names>G</given-names></name><name name-style="western"><surname>Holmes</surname><given-names>I</given-names></name></person-group>             <year>2004</year>             <article-title>A long indel model for evolutionary sequence alignment.</article-title>             <source>Molecular Biology and Evolution</source>             <volume>21</volume>             <fpage>529</fpage>             <lpage>540</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Yang3">
        <label>53</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Yang</surname><given-names>Z</given-names></name></person-group>             <year>2007</year>             <article-title>PAML 4: phylogenetic analysis by maximum likelihood.</article-title>             <source>Molecular Biology and Evolution</source>             <volume>24</volume>             <fpage>1586</fpage>             <lpage>1591</lpage>          </element-citation>
      </ref>
      <ref id="pone.0034572-Mills1">
        <label>54</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Mills</surname><given-names>R</given-names></name><name name-style="western"><surname>Luttig</surname><given-names>C</given-names></name><name name-style="western"><surname>Larkins</surname><given-names>C</given-names></name><name name-style="western"><surname>Beauchamp</surname><given-names>A</given-names></name><name name-style="western"><surname>Tsui</surname><given-names>C</given-names></name><etal/></person-group>             <year>2006</year>             <article-title>An initial map of insertion and deletion (indel) variation in the human genome.</article-title>             <source>Genome Research</source>             <volume>16</volume>          </element-citation>
      </ref>
      <ref id="pone.0034572-Sinha1">
        <label>55</label>
        <element-citation publication-type="journal" xlink:type="simple">             <person-group person-group-type="author"><name name-style="western"><surname>Sinha</surname><given-names>S</given-names></name><name name-style="western"><surname>Siggia</surname><given-names>E</given-names></name></person-group>             <year>2005</year>             <article-title>Sequence turnover and tandem repeats in cisregulatory modules in drosophila.</article-title>             <source>MBE</source>             <volume>22</volume>          </element-citation>
      </ref>
    </ref-list>
    
  </back>
</article>