Answers.Body: <p>The answer really is that a root is determined using external evidence, rather than from the internal branches.</p>
  <p>An algorithm such as root digger can be used to estimate the root placement based on a branch that for example might minimise the anomalous branch lengths in all other taxa. Excessive comparative branch-lengths could indicate an error in rooting the tree and this can be the basis of the estimate. However, it is an estimate.</p>
  <p>R libraries such as <code>ape</code> are more likely to simply mid-point root the tree, which isn't really cool, but its easy to calculate.</p>
  <p>The three approaches for rooting are either:</p>
  <ol>
  <li>Using a known outgroup to the taxa of interest, which unequivocally predates their divergence.</li>
  <li>External information such the evolution of key morphological features of the organism.</li>
  <li>Published studies.</li>
  </ol>
  <p><em>Point 1</em> This can be used singly to find the root - a &quot;root-finding tree&quot; - and the tree of interest presented by constructing a second tree without this root in the alignment. For example the Archaea predate bacteria, one tree determines where the Archaea attach to taxa of interest. If the outgroup is very distinct this could cause artefacts.</p>
  <p><em>Point 2</em> Finding an outgroup much close to the taxa of interest using external information, for example gram-negative versus gram-positive bacteria, e.g. if all the bacteria in your analysis were one or the other and again do the two tree strategy (point 1).</p>
  <p><em>Point 3</em> Using large kingdom wide phylogenies from published studies to determine where the most ancestral branch in your taxa.</p>
  <p>This is not an exhaustive list about how to use external information to determine the location of the root, but it is very widely recognised.</p>
  <hr />
  <p><strong>Directional versus reversible matrices</strong></p>
  <p>Directional matrix (e.g. most options in Beast) need to know where the root is, or they will 'guess it': ideally and this information can be feed into the algorithm when it is started. This is important if you are doing molecular dating.</p>
  <p>In fact, you can do this even with reversible matrices (e.g. RAxML) but it makes no difference to the answer.</p>
  <hr />
  <p><strong>Manual re-rooting</strong></p>
  <p>If you have identified the root and the phylogeny you have does not represent that root correctly you can &quot;re-root&quot; the tree using the outgroup identified from point 1 to 3. A program such FigTree are cool for re-rooting. Re-rooting is perfectly cool providing you present the methodology that identifies the root taxa or taxon (singular).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-03T09:56:57.307Z
Answers.Text: Thanks @M_ for your answer that helps me unclog this issue. I will go through the three approaches to find out the best one in my case. Thanks
Answers.UserDisplayName: MagíBC
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-02T15:43:17.940Z
Answers.LastActivityDate: 2022-05-02T16:08:08.973Z
Answers.LastEditDate: 2022-05-02T16:08:08.973Z
Answers.UserDisplayName: M__
Body: <p>But I have some weeks fighting with this issue about phylogenetic tree building to use in a phyloseq object in order to calculate beta-diversity metrics that takes into account tree distance branches metrics.</p>
  <p>I have one tree for Archea and another tree for bacteria (both unrooted), created from <a href="http://www.iqtree.org" rel="nofollow noreferrer">IQTREE</a> from the protein alignments obtained by GTDB-Tk software. I tried to use the software <a href="https://github.com/computations/root_digger" rel="nofollow noreferrer">Root-Digger</a>, but <a href="https://github.com/computations/root_digger/issues/9" rel="nofollow noreferrer">only works with nucleotide alignments and not protein alignments</a>. Do you know another software capable (working with protein alignments) to infer more objectively the root rather than define arbitrarily a root through ape R package?</p>
  <hr />
  <p>Root-digger is described as &quot;a non-reversible Markov model&quot;, which would be assumed to be a directional mutation matrix, thus T-&gt;A would have a different probability to A-&gt;T using Bayesian approach to branch-length estimation</p>
  <p>IQ-TREE is an ultra-rapid method for non-parametric bootstrapping which can be essential for extremely large phylogenies.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-01T19:40:18.663Z
Comments.Text: Hi @MagiBC this really two questions. Could you kindly focus on your main question and submit the second question as a separate request?
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-02T08:21:51.347Z
Comments.Text: Hi @M__, yes sorry are two questions. Ok, thank you and I take into account your suggestion. The second question is at: https://bioinformatics.stackexchange.com/questions/19018/phylogenetic-tree-building-from-progenomes-database-for-shotgun-metagenomics
Comments.UserDisplayName: MagíBC
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-02T15:10:22.700Z
Comments.Text: One option is to use rootstrap from IQTREE version newer than 2.1.3 (http://www.iqtree.org/doc/Rootstrap). However for at the moment I am not capable to run the first toy tutorial example in the abovementioned question. It's not a stable version. I write in google groups of IQTREE. I keep you informed if I had news.
Comments.UserDisplayName: MagíBC
Tags: <phylogenetics><phylogeny><metagenome><scaffold>
Title: Phylogenetic tree rooting in shotgun metagenomics
ThreadText: # Phylogenetic tree rooting in shotgun metagenomics
  
  (Asked by: username_0 on 2022-05-01)
  
  But I have some weeks fighting with this issue about phylogenetic tree building to use in a phyloseq object in order to calculate beta-diversity metrics that takes into account tree distance branches metrics.
  
  I have one tree for Archea and another tree for bacteria (both unrooted), created from [IQTREE](http://www.iqtree.org) from the protein alignments obtained by GTDB-Tk software. I tried to use the software [Root-Digger](https://github.com/computations/root_digger), but [only works with nucleotide alignments and not protein alignments](https://github.com/computations/root_digger/issues/9). Do you know another software capable (working with protein alignments) to infer more objectively the root rather than define arbitrarily a root through ape R package?
  
  ---
  
  Root-digger is described as "a non-reversible Markov model", which would be assumed to be a directional mutation matrix, thus T->A would have a different probability to A->T using Bayesian approach to branch-length estimation
  
  IQ-TREE is an ultra-rapid method for non-parametric bootstrapping which can be essential for extremely large phylogenies.
  
  **Tags:** phylogenetics, phylogeny, metagenome, scaffold
  
  > **Comments:**
  > **username_1**: Hi @MagiBC this really two questions. Could you kindly focus on your main question and submit the second question as a separate request?  
  > **username_0**: Hi @username_1, yes sorry are two questions. Ok, thank you and I take into account your suggestion. The second question is at: https://bioinformatics.stackexchange.com/questions/19018/phylogenetic-tree-building-from-progenomes-database-for-shotgun-metagenomics  
  > **username_0**: One option is to use rootstrap from IQTREE version newer than 2.1.3 (http://www.iqtree.org/doc/Rootstrap). However for at the moment I am not capable to run the first toy tutorial example in the abovementioned question. It's not a stable version. I write in google groups of IQTREE. I keep you informed if I had news.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-05-02. Score: 2
  
  The answer really is that a root is determined using external evidence, rather than from the internal branches.
  
  An algorithm such as root digger can be used to estimate the root placement based on a branch that for example might minimise the anomalous branch lengths in all other taxa. Excessive comparative branch-lengths could indicate an error in rooting the tree and this can be the basis of the estimate. However, it is an estimate.
  
  R libraries such as `ape` are more likely to simply mid-point root the tree, which isn't really cool, but its easy to calculate.
  
  The three approaches for rooting are either:
  
  1. Using a known outgroup to the taxa of interest, which unequivocally predates their divergence.
  2. External information such the evolution of key morphological features of the organism.
  3. Published studies.
  
  *Point 1* This can be used singly to find the root - a "root-finding tree" - and the tree of interest presented by constructing a second tree without this root in the alignment. For example the Archaea predate bacteria, one tree determines where the Archaea attach to taxa of interest. If the outgroup is very distinct this could cause artefacts.
  
  *Point 2* Finding an outgroup much close to the taxa of interest using external information, for example gram-negative versus gram-positive bacteria, e.g. if all the bacteria in your analysis were one or the other and again do the two tree strategy (point 1).
  
  *Point 3* Using large kingdom wide phylogenies from published studies to determine where the most ancestral branch in your taxa.
  
  This is not an exhaustive list about how to use external information to determine the location of the root, but it is very widely recognised.
  
  ---
  
  **Directional versus reversible matrices**
  
  Directional matrix (e.g. most options in Beast) need to know where the root is, or they will 'guess it': ideally and this information can be feed into the algorithm when it is started. This is important if you are doing molecular dating.
  
  In fact, you can do this even with reversible matrices (e.g. RAxML) but it makes no difference to the answer.
  
  ---
  
  **Manual re-rooting**
  
  If you have identified the root and the phylogeny you have does not represent that root correctly you can "re-root" the tree using the outgroup identified from point 1 to 3. A program such FigTree are cool for re-rooting. Re-rooting is perfectly cool providing you present the methodology that identifies the root taxa or taxon (singular).
  
  > **Comments:**
  > **username_0**: Thanks @M_ for your answer that helps me unclog this issue. I will go through the three approaches to find out the best one in my case. Thanks  
  
  ---
  
  