pplacer: linear time maximum-likelihood and Bayesian phylogenetic placement of sequences onto a fixed reference tree
© Matsen et al. 2010
Received: 18 March 2010
Accepted: 30 October 2010
Published: 30 October 2010
Skip to main content
© Matsen et al. 2010
Received: 18 March 2010
Accepted: 30 October 2010
Published: 30 October 2010
Likelihood-based phylogenetic inference is generally considered to be the most reliable classification method for unknown sequences. However, traditional likelihood-based phylogenetic methods cannot be applied to large volumes of short reads from next-generation sequencing due to computational complexity issues and lack of phylogenetic signal. "Phylogenetic placement," where a reference tree is fixed and the unknown query sequences are placed onto the tree via a reference alignment, is a way to bring the inferential power offered by likelihood-based approaches to large data sets.
This paper introduces pplacer, a software package for phylogenetic placement and subsequent visualization. The algorithm can place twenty thousand short reads on a reference tree of one thousand taxa per hour per processor, has essentially linear time and memory complexity in the number of reference taxa, and is easy to run in parallel. Pplacer features calculation of the posterior probability of a placement on an edge, which is a statistically rigorous way of quantifying uncertainty on an edge-by-edge basis. It also can inform the user of the positional uncertainty for query sequences by calculating expected distance between placement locations, which is crucial in the estimation of uncertainty with a well-sampled reference tree. The software provides visualizations using branch thickness and color to represent number of placements and their uncertainty. A simulation study using reads generated from 631 COG alignments shows a high level of accuracy for phylogenetic placement over a wide range of alignment diversity, and the power of edge uncertainty estimates to measure placement confidence.
Pplacer enables efficient phylogenetic placement and subsequent visualization, making likelihood-based phylogenetics methodology practical for large collections of reads; it is freely available as source code, binaries, and a web service.
High-throughput pyrosequencing technologies have enabled the widespread use of metagenomics and metatranscriptomics in a variety of fields . This technology has revolutionized the possibilities for unbiased surveys of environmental microbial diversity, ranging from the human gut to the open ocean [2–8]. The trade off for high throughput sequencing is that the resulting sequence reads can be short and come without information on organismal origin or read location within a genome.
The most common way of analyzing a metagenomic data set is to use BLAST  to assign a taxonomic name to each query sequence based on "reference" data of known origin. This strategy has its problems: when a query sequence is only distantly related to sequences in the database, BLAST can either err substantially by forcing a query into an alignment with a known sequence, or return an uninformatively broad collection of alignments. Furthermore, similarity statistics such as BLAST E-values can be difficult to interpret because they are dependent on fragment length and database size. Therefore it can be difficult to know if a given taxonomic assignment is correct unless a very clear "hit" is found.
Numerous tools have appeared that assign taxonomic information to query sequences, overcoming the shortcomings of BLAST. For example, MEGAN (MEtaGenome ANalyzer)  implements a commonancestor algorithm on the NCBI taxonomy using BLAST scores. PhyloPythia , TACOA , and Phymm  use composition based methods to assign taxonomic information to metagenomic sequences. Recent tools can work with reads as short as 100 bp.
Phylogeny offers an alternative and complementary means of understanding the evolutionary origin of query sequences. The presence of a query sequence on a certain branch of a tree gives precise information about the evolutionary relationship of that sequence to other sequences in the tree. For example, a query sequence placed deep in the tree can indicate how the query is distantly related to the other sequences in the tree, whereas the corresponding taxonomic name would simply indicate membership in a large taxonomic group. On the other hand, taxonomic names are key to obtaining functional information about organisms, and the most robust and comprehensive means of understanding the provenance of unknown sequences will derive both from taxonomic and phylogenetic sources.
Likelihood-based phylogenetics, with over 30 years of theoretical and practical development, is a sophisticated tool for the evolutionary analysis of sequence data. It has well-developed statistical foundations for inference [14, 15], tests for uncertainty estimation , and sophisticated evolutionary models [17, 18]. In contrast to distance-based methods, likelihood-based methods can use both low and high variation regions of an alignment to provide resolution at different levels of a phylogenetic tree .
Traditional likelihood-based phylogenetics approaches are not always appropriate for analyzing the data from metagenomic and metatranscriptomic studies. The first challenge is that of complexity: the maximum likelihood phylogenetics problem is NP-hard [20, 21] and thus maximum likelihood trees cannot be found in a practical amount of time with many taxa. A remarkable amount of progress has been made in approximate acceleration heuristics [22–25], but accurate maximum likelihood inference for hundreds of thousands of taxa remains out of reach.
Second, accurate phylogenetic inference is not possible with fixed length sequences in the limit of a large number of taxa. This can be seen via theory , where lower bounds on sequence length can be derived as an increasing function of the number of taxa. It is clear from simulation , where one can directly observe the growth of needed sequence length. Such problems can also be observed in real data where insufficient sequence length for a large number of taxa is manifested as a large collection of trees similar in terms of likelihood ; statistical tools can aid in the diagnosis of such situations .
The lack of signal problem is especially pronounced when using contemporary sequencing methods that produce a large number of short reads. Some methodologies, such as 454 , will soon be producing sequence in the 600-800 bp range, which is sufficient for classical phylogenetic inference on a moderate number of taxa. However, there is considerable interest in using massively parallel methodologies such as SOLiD and Illumina which produce hundreds of millions of short reads at low cost . Signal problems are further exacerbated by shotgun sequencing methodology where the sequenced position is randomly distributed over a given gene. Applying classical maximum-likelihood phylogeny to a single alignment of shotgun reads together with full-length reference sequences can lead to artifactual grouping of short reads based on the read position in the alignment; such grouping is not a surprise given that non-sequenced regions are treated as missing data (see, e.g. [19, 31]).
A third problem is deriving meaningful information from large trees. Although significant progress has been made in visualizing trees with thousands of taxa [32, 33], understanding the similarities and differences between such trees is inherently difficult. In a setting with lots of samples, constructing one tree per sample requires comparing trees with disjoint sets of taxa; such comparisons can only be done in terms of tree shape . Alternatively, phylogenetic trees can be constructed on pairs of environments at a time, then comparison software such as UniFrac  can be used to derive distances between them, but the lack of a unifying phylogenetic framework hampers the analysis of a large collection of samples. "Phylogenetic placement" has emerged in the last several years as an alternative way to gain an evolutionary understanding of sequence data from a large collection of taxa. The input of a phylogenetic placement algorithm consists of a reference tree, a reference alignment, and a collection of query sequences. The result of a phylogenetic placement algorithm is a collection of assignments of query sequences to the tree, one assignment for each query (or more than one when placement location is uncertain). Phylogenetic placement is a simplified version of phylogenetic tree reconstruction by sequential insertion [36, 37]. It has been gaining in popularity, with recent implementations in 2008 [38, 39], and more efficient implementations in this paper and by Berger and Stamatakis . A recent HIV subtype classification scheme  is also a type of phylogenetic placement algorithm that allows the potential for recombination in query sequences.
Phylogenetic placement sidesteps many of the problems associated with applying traditional phylogenetics algorithms to large, environmentally-derived sequence data. Computation is significantly simplified, resulting in algorithms that can place thousands to tens of thousands of query sequences per hour per processor into a reference tree on a thousand taxa. Because computation is performed on each query sequence individually, the calculation can be readily parallelized. The relationships between the query sequences are not investigated, reducing from an exponential to a linear number of phylogenetic hypotheses. Short and/or non-overlapping query sequences pose less of a problem, as query sequences are compared to the full-length reference sequences. Visualization of samples and comparison between samples are facilitated by the assumption of a reference tree, that can be drawn in a way which shows the location of reads.
Phylogenetic placement is not a substitute for traditional phylogenetic analysis, but rather an approximate tool when handling a large number of sequences. Importantly, the addition of a taxon x to a phylogenetic data set on taxa S can lead to re-evaluation of the phylogenetic tree on S; this is the essence of the taxon sampling debate  and has recently been the subject of mathematical investigation . This problem can be mitigated by the judicious selection of reference taxa and the use of well-supported phylogenetic trees. The error resulting from the assumption of a fixed phylogenetic reference tree will be smaller than that when using an assumed taxonomy such as the commonly used NCBI taxonomy, which forms a reference tree of sorts for a number of popular methods currently in use [10, 43]. Phylogenetic placement, in contrast, is done on a gene-by-gene basis and can thus accommodate the variability in the evolutionary history of different genes, which may include gene duplication, horizontal transfer, and loss.
To validate pplacer's phylogenetic placement algorithm we implemented a framework that simulates reads from real alignments and tests pplacer's ability to place the read in the correct location. As described below, a primary focus of this effort is a simulation study of 631 COG alignments, where 10 reads were simulated from each taxon of each alignment, placed on their respective trees, and evaluated for accuracy. These tests confirm both that pplacer places reads accurately and that the posterior probability and the likelihood weight ratio (described below) both do a good job of indicating whether a placement can be trusted or not. We also use these simulations to understand how the distance to sister taxon impacts placement accuracy.
Pplacer places query sequences in a fixed reference phylogeny according to phylogenetic posterior probability and maximum likelihood criteria. In Bayesian mode, pplacer evaluates the posterior probability of a fragment placement on an edge conditioned on the reference tree topology and branch lengths. The posterior probability has a clear statistical interpretation as the probability that the fragment is correctly placed on that edge, assuming the reference tree, the alignment, and the priors on pendant branch length. Because the reference tree is fixed, direct numerical quadrature over the likelihood function can be performed to obtain the posterior probability rather than relying on Markov chain Monte-Carlo procedures as is typically done in phylogenetics [44, 45]. In maximum likelihood (ML) mode, pplacer evaluates the "likelihood weight ratio" , i.e. the ML likelihood values across all placement locations normalized to sum to one.
The pplacer binary is stand-alone; a single command specifying the reference tree, the reference alignment, a reference statistics file, and the aligned reads suffices to run the core pplacer analysis. Pplacer does not optimize sequence mutation model parameters, and instead obtains those values from PHYML  or RAxML  statistics output files. When analyzing protein sequences the user can choose between the LG  or WAG  models, and nucleotide likelihoods are computed via the general time reversible (GTR) model. Rate variation among sites is accomodated by the discrete Γ model . For posterior probability calculation, the user can choose between exponential or uniform pendant branch length priors. Each pplacer run creates a .place file that describes the various placements and their confidence scores; analysis can be done directly on this file, or the user can run it through placeviz, our tool to visualize the fragment placements. The pplacer code is written in the functional/imperative language ocaml using routines from the GNU scientific library (GSL) .
To accelerate placements, pplacer implements a two-stage search algorithm for query sequences, where a quick first evaluation of the tree is followed by a more detailed search in high-scoring parts of the tree. The more detailed second search is directed by pplacer's "baseball" heuristics, which limit the full search in a way that adapts to the difficulty of the optimization problem (described in detail in "Methods"). The balance between speed and accuracy depends on two parameters, which can be appropriately chosen for the problem at hand via pplacer's "fantasy baseball" mode. This feature places a subset of the query sequences and reports the accuracy of the parameter combinations within specified ranges, as well as information concerning runtime for those parameter combinations. The user can then apply these parameter choices for an optimized run of their data.
Pplacer calculates edge uncertainty via posterior probability and the likelihood weight ratio. These methods quantify uncertainty on an edge-by-edge basis by comparing the best placement locations on each edge. Such quantities form the basis of an understanding of placement uncertainty.
Our package includes tools to facilitate placement visualization and management: placeviz and placeutil. Placeviz converts the placement files generated by pplacer into tree formats that are viewable by external viewers. The richest visualizations make use of the phyloXML format , which can be viewed using the freely available Archaeopteryx  Java software. Less information-dense visualizations are also available in the standard "Newick" format .
As shown in Figure 1, placeviz extends previous work on visualizations , representing placement density (branch thickness) and uncertainty (color) on a single tree. Specifically, it draws the reference tree such that the thickness of the branch is a linear function of the number of placements (this linear function has a non-zero y-intercept so that the whole tree is visible); the weighted average EDPL uncertainty for the placements on the tree is expressed as a color gradient from the usual branch length color (white or black by choice) to red, with 100% red representing a user-defined uncertainty maximum. Yellow is used to denote edges whose average EDPL uncertainty is above the given maximum level. An example placeviz visualization can be viewed interactively at http://matsen.fhcrc.org/pplacer/visualization.html.
Placeviz also offers other visualization options, such as individually placing the query sequences on the tree, which is useful for a small number of placements. It also can sort query sequences by their best scoring edge into a .loc.fasta file; inspection can reveal if any specific features of the query sequences lead to placement on one edge or another. This sorting can also group query sequences as potentially coming from similar organisms, even if those query sequences do not overlap.
Placeutil is a utility for combining, splitting apart, and filtering placements, which can be useful when doing large scale analysis. For example, when a collection of query sequences are split apart to run in parallel, their placements can be brought back together using placeutil, while checking that they were run using the same reference tree and model parameters. Conversely, if a number of samples were run together, they can be split apart again using regular expressions on their names. Placements can also be separated by likelihood weight ratio, posterior probability, and EDPL.
To demonstrate the use of pplacer for a metagenomic study, we analyzed the psbA and psbD gene for the D1 and D2 subunits of photosystem II in cyanobacterial and eukaryotic chloroplasts  from the Global Ocean Sampling (GOS) dataset . The GOS database is the largest publicly available metagenomic database, and has been the subject of numerous studies. We choose the psbA and psbD genes because they are well defined, are found across domains, and can be used to differentiate cyanobacteria from eukaryotic phototrophs in a data set assuming sequence reads are accurately identified . In addition, it has been shown in a number of studies that cyanophage virus genomes contain both psbA and psbD sequences [52–55], and that viruses are the source of a substantial number psbA and psbD sequences in GOS [56, 57]. BLAST searches using either a eukaryotic psbA query or a cyanobacterial psbA query sequence can yield the same collection of reads from GOS with similar E-values - even very low values on the order of 10-100 or smaller in some cases (Additional file 1: Table S1). This can make taxonomic assignment even at a high level difficult using BLAST-based comparisons. The use of pplacer on the closely related psbA and psbD genes demonstrates phylogenetic placement on closely related paralogs.
Simulation experiments were conducted to verify overall accuracy and to determine the relationship between confidence scores and accuracy. The simulation removes one taxon at a time from a given reference tree, simulates fragments from that taxon, then evaluates how accurately the placement method assigns the simulated fragments to their original position. In order to evaluate the accuracy of the placements, a simple topological distance metric is used. We have not simulated homopolymer-type errors in the alignments, because such errors should be treated by a pre-processing step and thus are not the domain of a phylogenetic placement algorithm. Furthermore, the emergence of more accurate very high throughput sequencing technology  re-focuses our attention on the question of speed rather than error problems. Further details are given in the "Methods" section.
A broad simulation analysis of pplacer performance was done using 631 COG  alignments. The COG alignments had between 19 and 436 taxa, with a median of 41; they were between 200 and 2050 amino acids in length, with a median of 391 (supplemental Figures S1 and S2). Reference phylogenetic trees were built based on the full-length gene sequences for each of these genes using PHYML  and the LG  protein substitution model (LG model chosen based on the evidence presented in the corresponding paper). Each taxon from each gene alignment was eliminated one at a time from the reference set as described in "Methods"; ten reads were simulated from each, leading to a total of 334,670 simulated reads, which were aligned to a hidden Markov model of the reference alignment. As is commonly done when analyzing a metagenome, the reads were filtered by their HMMER E-value (in this case 10-5). Two normal distributions were used for read length: a "long" read simulation with amino acid sequence length of mean 85 and standard deviation of 20, and a "short" read simulation with mean 30 and standard deviation of 7. After the HMMER step, the "long" read simulation placed a total of 285,621 reads, and the "short" one placed a total of 148,969 reads on their respective phylogenetic trees.
Accuracy results for the mean 85 AA COG simulation
Accuracy results for the mean 30 AA COG simulation
Likelihood-based phylogeny is a well developed way to establish the evolutionary relationships between sequences. Phylogenetic placement is a simplified version of likelihood-based phylogenetic inference that enables rapid placement of numerous short query sequences and sidesteps some of the problems inherent in applying phylogenetics to hundreds of thousands or millions of taxa. Phylogenetic placement is by no means a replacement for classical phylogenetic inference, which should be applied when query sequences are full length and moderate in number.
Phylogenetic placement software sits in a category distinct from taxonomic identification software such as MEGAN  or Phymm . First, phylogenetic placement software does not assign names to query sequences, and instead returns an assignment of the query sequences to edges of a phylogenetic tree. Second, phylogenetic placement is designed to work with a single reference phylogenetic tree built on a single alignment. Thus it is well suited for fine-scale analysis of query sequences to provide detailed comparative and evolutionary information at the single gene level. This poses no problems when looking at a single marker gene such as such as 16 S, but some scripting and automation is necessary when there are many genes of interest. These challenges are somewhat mitigated through program design and pipeline scripts , but phylogenetic placement methods may always require more work than general purpose taxonomic classification software.
Phylogenetic placement is also different from packages that construct a phylogenetic tree de novo in order to infer taxonomic identity by clade membership. Such packages, such as CARMA  and SAP [43, 62], combine sequence search, alignment, and phylogeny into a complete pipeline to provide taxonomic information for an unknown query sequence. Because different query sequences will have different sets of reference taxa, these methods are not phylogenetic placement algorithms as described above. Also, because they are performing a full phylogenetic tree construction, they either use distance-based methods for faster results [43, 61] or are many orders of magnitude slower than phylogenetic placement methods .
Pplacer is not the only software to perform likelihood-based phylogenetic placement. The first pair of software implementations were the "phylomapping" method of , and the first version of the "MLTreeMap" method of . Both methods use a topologically fixed reference tree, and are wrappers around existing phylogenetic implementations: ProtML  for phylomapping, and TREE-PUZZLE  for MLTreeMap. Neither project has resulted in software that is freely available for download (MLTreeMap is available as a web service, but as it is tied to a core set of bacterial genes it is not useful for scientists examining other genes or domains). Also, by using a general-purpose phylogenetic computing engine, they miss on opportunities to optimize on computation and the resulting algorithm is not linear in the number of reference taxa. Both methods equip placement with a statistically justifiable but non-traditional confidence score: phylomapping adapts the RELL bootstrap  to their setting, and MLTreeMap uses the "expected maximum likelihood weight ratio," which has been discussed in . AMPHORA also uses a hybrid parsimony and neighbor-joining strategy to place query sequences in a fixed reference tree .
The only other software at present that performs likelihood-based phylogenetic placement at speeds comparable of pplacer is the independently-developed "evolutionary placement algorithm" (EPA)  available as an option to RAxML . Pplacer and the EPA both cache likelihood information on the tree to accelerate placement, and both use two-stage algorithms to quickly place many sequences. The two packages use different acceleration heuristics, but only pplacer offers guidance on parameter choices to use for those heuristics via its "fantasy baseball" feature as described below in the section on algorithmic internals. The EPA allows for one parameter more flexibility than pplacer for branch length optimization, and can perform placement on partitioned datasets and inference on binary, RNA secondary structure, and multi-state data. The EPA offers single-process parallelization  (note both the EPA and pplacer can easily be run in parallel as multiple processes). The EPA leverages the efficient memory representation of RAxML, such that an equivalent run using the Gamma model of rate variation will use half the memory of pplacer, and a run using the CAT approximation will require one eighth of the memory. The EPA comes without a visualization tool such as placeviz, although it can be visualized if run on their webserver, or within the new MLTreeMap suite of Perl scripts for visualization .
In contrast to the EPA, pplacer placements all sit on a single reference tree with its associated branch lengths fixed. Thus it is easy to compare the relative location of placements, and to consider all placements on a single tree. Placement locations along a branch are useful in cases such as classification, where a placement close to the root of a clade may be assigned membership to that clade, whereas placements in the middle of the same edge may not. The EPA, on the other hand, optimizes the length of the branch of the reference tree as well as the placement location along that branch; thus each placement is done onto a slightly different reference tree. Presumably because the placement location does not happen on a single reference tree, the placement location is not reported by the program and this information is lost .
We did not compare the RAxML parsimony insertions wrapped by AMPHORA to these likelihood placements, because we would be scoring a parsimony insertion algorithm according to the original positions in a maximum-likelihood tree. The difference between these optimality criteria would naturally lead to some differences, which would be viewed by the scoring metric as error. The innovative bootstrap-based taxonomic assignment procedure in the AMPHORA package produces a name rather than a phylogenetic placement, and thus cannot be directly compared to the output of pplacer.
Pplacer enables efficient maximum likelihood and posterior probability phylogenetic placement of reads, making likelihood-based phylogenetics methodology practical for large-scale metagenomic or 16 S survey data. Pplacer can be used whenever a reference alignment and phylogenetic tree is available, and is designed for ease of use for both single-run and pipelined applications. "Baseball" heuristics adapt to the difficulty of the phylogenetic placement problem at hand, and come with features which guide the user to an appropriate set of parameter choices. The EDPL metric helps users decide if edge uncertainty is a substantial problem for downstream analysis. Pplacer offers tightly integrated yet flexible visualization tools which can be used to view both the placements and their uncertainty on a single tree. Large-scale simulations confirmed the accuracy of the pplacer results and the descriptive ability of the confidence scores. Pplacer is freely available, comes with a complete manual and tutorials, and can be used via a web service.
Pplacer forms the core of a body of work we are developing to facilitate and extend the utility of phylogenetic placement methodology. We have shown recently  that phylogenetic placements (and uncertainty measurements thereof) fit perfectly into a statistical framework generalizing weighted UniFrac  allowing for statistical comparison and visualization of differences between samples. In collaboration with another group, we have also implemented a preliminary version of software which automates the selection of appropriate reference sequences, as well as the assignment of taxonomic names based on phylogenetic placements.
Here we survey pplacer algorithmic developments. The code implementing these algorithms is freely available on the github code repository . The basic development that permits linear time and space scaling in the size of the reference tree is that of pre-calculation of likelihood vectors at either end of each edge of the reference tree; this development is shared by the EPA and SCUEAL  and the original idea goes back much earlier. Using these cached likelihood vectors, a naive algorithm might insert the query sequence into each edge of the tree and perform full branch length optimization using the cached likelihood vectors. However, a substantial speed improvement can be gained by performing a two-stage algorithm, where the first stage does a quick initial evaluation to find a good set of locations, and the second stage does a more detailed evaluation of the results from the first stage.
Pplacer's "baseball" heuristics limit the full search on the tree in a way that adapts to the difficulty of the optimization problem. The first stage is enabled by calculating likelihood vectors for the center of each edge; these vectors can be used to quickly sort the edges in approximate order of fit for a given query sequence. This edge ordering will be called the "batting order." The edges are evaluated in the batting order with full branch length optimization, stopping as follows. Start with the edge that looks best from the initial evaluation; let L be the log likelihood of the branch-length-optimized ML attachment to that edge. Fix some positive number D, called the "strike box." We proceed down the list in order until we encounter the first placement that has log likelihood less than L - D, which is called a "strike." Continue, allowing some number of strikes, until we stop doing detailed evaluation of what are most likely rather poor parts of the tree. An option restricts the total number of "pitches," i.e. full branch length optimizations.
The baseball heuristics allow the algorithm to adapt to the likelihood surface present in the tree; its behavior is controlled by parameters that can be chosen using pplacer's "fantasy baseball" feature. This option allows automated testing of various parameter combinations for the baseball heuristics. Namely, it evaluates a large fixed number of placements, and records what the results would have been if various settings for the number of allowed strikes and the strike box were chosen. It records both the number of full evaluations that were done (which is essentially linearly proportional to the run time) and statistics that record if the optimal placement would have been found with those settings, and how good the best found with those settings is compared to the optimal placement.
Placement speed can also be accelerated by using information gained about the placement of a given query sequence to aid in placement of closely related query sequences. Before placement begins, pairwise sequence comparisons are done, first in terms of number of mismatches and second in terms of number of matches to gaps. Specifically, each sequence s i is compared to previous sequences in order; the sequence s j that is most closely related to s i with j < i is found and assigned as s i 's "friend." If no sequence is above a certain threshold of similarity then no friend is assigned. If s i and s j are identical, then s j 's placement is used for s i . If they are similar but not identical, the branch lengths for s j are used as starting values for the branch length optimization of s i . This scheme is not a heuristic, but rather an exact way to accelerate the optimization process. On the other hand, such comparison is inherently an O(n 2 ) operation and thus may slow placement down given more than tens of thousands of query sequences. In such a case the user may choose to forgo the friend finding process.
Pplacer's speed is also linearly proportional to the lengths of the query sequences, which is enabled because the reference tree is fixed with respect to topology and branch length. Specifically, as described below, likelihood computations are performed such that the sites without a known state (gaps or missing sites) cancel out of the computation of likelihood weight or posterior probability. These sites are masked out of pplacer's computation and thus do not compute to runtime.
Because of the extensive memory caching to accelerate placement, pplacer consumes a nontrivial amount of memory. The fixed contributions to memory use break down as follows: a factor of two for quick and full evaluation of placements, two nodes on each edge, four rate variation categories, four bytes per double precision floating point number, and four (nucleotide) or 20 (amino acid) states. To get a lower bound for total memory use, multiply this number, which is 128 bytes (nucleotide) or 640 bytes (amino acid), with two times the number of reference sequences minus three (the number of edges), times the number of columns in the reference alignment. Other data structures add on top of that (Figure 3).
where ℒ ML is the maximal likelihood obtained by maximizing ℒ(D|T ref , ℓ i , a, b) with respect to branch length parameters a and b. The expected (under bootstrap replicates) likelihood weight ratio is the confidence score used in . Some justification for using likelihood weight ratios is given in .
An extension of these ideas would be to integrate the marginal likelihoods over the potential attachment positions on the edges of interest; we have not pursued such a calculation.
The simulation procedure for a single gene is as follows. Begin with an alignment A of full-length sequences for the gene of interest, along with a phylogeny T derived from that alignment. T is assumed to be correct.
remove X from the reference alignment, making an alignment A X
build a profile HMM out of A X
cut X and its pendant branch out of the tree T, suppressing the resultant degree-two internal node. Re-estimate branch lengths using A X , and call the resulting tree T X
simulate fragments from the unaligned sequence of X by taking sequences of normally-distributed length and uniformly-distributed position.
align these simulated fragments using the profile HMM built from A X
place the simulated fragments in T X with respect to the reference alignment A X
compare the resulting placements to the location of X in T using our error metric described below.
Note that only branch lengths are re-estimated; if we estimated T X de novo from A X then we would not be able to compare the placements to the taxon locations in T.
In order to evaluate the accuracy of the placements, a simple topological distance metric is used. To calculate this metric for the placement of a taxon X, highlight both the edge of T X corresponding to the correct placement and the edge of T X corresponding to the actual placement of the simulated fragment. The error metric then is the number of internal nodes between the two highlighted edges. Thus, if the fragment is placed in the correct position, then error is zero, and if it is placed sister to the correct position, then the error is one, and so on. This error metric is also used in .
Data for the analysis of speed and memory use was drawn from . The data came partitioned into two files, the smaller of which was used for the reference set. Sequences with at least 1200 non-gap characters were selected from the reference set and the sequence order was randomized. Reference trees were built on the first 200, 400, ..., 1600 sequences, and the other file was used as the query set.
The EPA to pplacer accuracy comparison was done using the simulation framework from . The same taxa were used to generate simulated nucleotide fragments, which had normally distributed length with mean 200 and standard deviation 60. These were aligned to the reference alignments using HM-MER. Reference tree branch lengths were re-estimated using RAxML after deletion of the taxon used for simulation. The standard version of the EPA reroots the tree at an arbitrary location; Alexandros Stamatakis modified the code for this comparison so that the tree is rerooted at the lexicographically (i.e. alphabetically) smallest node, and branch order resorted similarly. Because of this rerooting and resorting, the error could not be judged directly from the reference tree, and so the correct placement was assumed to be that chosen by the EPA with a full-length sequence. Simulation data can be downloaded from http://matsen.fhcrc.org/pplacer/data/10_EPA_comparison.tar.gz
Alignments for the COG simulation were downloaded from the COG website . The alignments were screened for completeness and taxa with incomplete sequences were removed. Alignment ends were trimmed to eliminate excessive gaps on either end. For the GOS psbA analysis, the - All_Metagenomic_Reads and All_Assembled_Sequences - were downloaded to a local computer cluster from CAMERA . A psbA and psbD reference alignment was made of eukaryotic plastid sequences using sequences retrieved from Genbank and then included all cyanobacteria with an HMM search of a local copy of microbial refseq (from Genbank); alignment of was done using Geneious alignment  and was hand edited.
Jonathan Eisen, Steve Evans, John Huelsenbeck and Rasmus Nielsen made helpful suggestions concerning phylogenetics, while Robert Bradley, Ruchira Datta, and Sean Eddy helped with the use of profile HMMs in this context. We thank the Center for Environmental Genomics at the University of Washington, in particular Chris Berthiaume and David Schruth, for computational assistance. David Schruth, Adrian Marchetti and Alexandros Stamatakis provided helpful suggestions on the manuscript. Simon Berger and Alexandros Stamatakis generously helped with simulation design and running of the EPA algorithm. FAM is especially grateful to Andrés Varón and Ward Wheeler, who made a number of suggestions which greatly improved the pplacer code. The following individuals from the ocaml listserv made helpful suggestions: Will M. Farr, Mauricio Fernandez, Stéphane Glondu, Jon D. Harrop, Xavier Leroy, Mike Lin, and Markus Mottl. FAM was supported by the Miller Institute for Basic Research at the University of California, Berkeley while doing this work. RBK is supported by the University of Washington Friday Harbor Laboratories. EVA is supported through a Gordon and Betty Moore Foundation Marine Microbiology Investigator award.
This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.