Answers.Body: <p>I don't use R to build trees, I use established subprocessing stripts in Python and ETE3. So I've not run this code, but I do understand the critical parts of the code.</p>
  
  <p>The hard bit is bootstrapping a maximum likelihood tree, first is the ML model
  1.</p>
  
  <pre><code>fitGTR &lt;-optim.pml(fitGTR, model="GTR", optInv=TRUE, optGamma=TRUE, + rearrangement = "NNI", control = pml.control(trace = 0))
  </code></pre>
  
  <p>The above model is perfect, general time reversible model with a gamma correction and an estimate of the invariant sites. This is the most important part of tree estimation. The NNI for tree rearrangements is a good one. So THIS is the model you want. You can emperical test this, but these days we don't bother.</p>
  
  <p>The information given for bootstrapping,</p>
  
  <p>2.</p>
  
  <pre><code>BStree &lt;- bootstrap.pml(x, bs = 500, trees = TRUE, multicore = FALSE,
    mc.cores = NULL, ...)
  </code></pre>
  
  <p>The critical parameter is bs=500. By default it uses bs=100 which I don't think is enough. I would set multicore = TRUE to speed the calculation (it will speed it up alot) and I assume there must be a setting for the number of cores (?).</p>
  
  <p>I assume you can then stack all the parameters from 1/ into code 2. So in other words the model you used in part 1. (GTR PINVAR and Gammma) is same model used in the bootstrapping.</p>
  
  <p>This will produce a bootstrap file, probably of 500 bootstrapped ML trees, so you need to produce a consensus and represent the values on the optimal ML tree.</p>
  
  <p>Thus you need to overlay the bootstrap onto the tree that is output in 1. This says fitGTR and I suspect that will be a tree file with a likelihood, you might need to set a tree output and that would be 'tree' in the code below.
  3.</p>
  
  <pre><code>plotBS(tree, BStrees, type = "myroot", bs.col = "black",
    bs.adj = NULL, p = 50, frame = "none", ...)
  </code></pre>
  
  <p>The type = myroot is your defined outgroup for the tree. This should be your nicely bootstrapped tree.</p>
  
  <p>There was also this code in the help manual and I'm not sure what this is doing. I suspect it is just producing bootstrapped datasets, so its not needed here.</p>
  
  <pre><code>bootstrap.phyDat(x, FUN, bs = 100, multicore = FALSE,
        mc.cores = NULL, jumble = TRUE, ...)
  </code></pre>
  
  <p>To do the same with parsimony then just replace pml for parsimony. Comparing 2 bootstrap trees is a node is robust when it scores >80% </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-21T08:57:18.870Z
Answers.Text: will use this one to run
Answers.UserDisplayName: kcm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-16T17:48:08.403Z
Answers.LastActivityDate: 2020-06-16T18:06:02.283Z
Answers.LastEditDate: 2020-06-16T18:06:02.283Z
Answers.UserDisplayName: M__
Answers.Body: <blockquote>
  <p>Can i even compare these two methods?</p>
  </blockquote>
  <p>See if this paper helps:
  <a href="https://www.nature.com/articles/nature02917" rel="nofollow noreferrer">https://www.nature.com/articles/nature02917</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-23T09:11:51.483Z
Answers.Text: Welcome  @HD2000 thanks for your comment, could you please summarise the content of your weblink here? I agrree it is a very thought provoking paper indeed, one that didn't stand the test of conventional practice but waooo
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-24T09:38:47.510Z
Answers.Text: Can you add more detail about why your link would help?
Answers.UserDisplayName: StupidWolf
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-23T08:11:43.827Z
Answers.LastActivityDate: 2020-07-23T08:11:43.827Z
Answers.UserDisplayName: HD2000
Body: <p>Maximum Likelihood analysis compares the tips or the species based on their sequence similarity while Parsimony analysis compares the characteristic features among the species.</p>
  
  <p>So far I did comparison of both the tree using dendextend. Is there any other methods or library to make the comparison more quantitative.Due to my limited understanding I have this in mind. Can i even compare these two methods?  </p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-06T20:25:56.833Z
Comments.Text: Yes you can definitely compare both methods by tree topology, personally I do this via boostrapping.
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-07T08:45:11.263Z
Comments.Text: as usual what is the R way of doing it?
Comments.UserDisplayName: kcm
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-07T09:57:10.747Z
Comments.Text: How many taxa are there in your tree?
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-07T10:21:23.933Z
Comments.Text: this is my parismony data "Phylogenetic tree with 50 tips and 48 internal nodes." and this is my ML  Phylogenetic tree with 50 tips and 49 internal nodes.
Comments.UserDisplayName: kcm
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-07T10:33:35.613Z
Comments.Text: @Michael shall i share both the tree? object here?
Comments.UserDisplayName: kcm
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-07T11:03:37.280Z
Comments.Text: Hi no that is fine ... it is just that ML takes a long time and the number of taxa is key to the computational effort .. okay I will look at phangorn and post the code to bootstrap it. Do you use R on a cluster and are you happy 'farming' a job, e.g. splitting it in two or three?
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-07T11:17:46.110Z
Comments.Text: "Do you use R on a cluster and are you happy 'farming' a job, e.g. splitting it in two or three?" no i use workstation but we do have a cluster..i can use ..
Comments.UserDisplayName: kcm
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-06-07T14:06:02.193Z
Comments.Text: Ok I'll post up the codes, I need to look at phangorn it certainly does bootstrapping, but mid-week if thats ok? You know deadlines, deadlines ... :-(
Comments.UserDisplayName: M__
Tags: <r><phylogenetics>
Title: parsimony and maximum likelihood tree comparison in R
ThreadText: # parsimony and maximum likelihood tree comparison in R
  
  (Asked by: username_0 on 2020-06-06)
  
  Maximum Likelihood analysis compares the tips or the species based on their sequence similarity while Parsimony analysis compares the characteristic features among the species.
  
  So far I did comparison of both the tree using dendextend. Is there any other methods or library to make the comparison more quantitative.Due to my limited understanding I have this in mind. Can i even compare these two methods?
  
  **Tags:** r, phylogenetics
  
  > **Comments:**
  > **username_1**: Yes you can definitely compare both methods by tree topology, personally I do this via boostrapping.  
  > **username_0**: as usual what is the R way of doing it?  
  > **username_1**: How many taxa are there in your tree?  
  > **username_0**: this is my parismony data "Phylogenetic tree with 50 tips and 48 internal nodes." and this is my ML  Phylogenetic tree with 50 tips and 49 internal nodes.  
  > **username_0**: @Michael shall i share both the tree? object here?  
  > **username_1**: Hi no that is fine ... it is just that ML takes a long time and the number of taxa is key to the computational effort .. okay I will look at phangorn and post the code to bootstrap it. Do you use R on a cluster and are you happy 'farming' a job, e.g. splitting it in two or three?  
  > **username_0**: "Do you use R on a cluster and are you happy 'farming' a job, e.g. splitting it in two or three?" no i use workstation but we do have a cluster..i can use ..  
  > **username_1**: Ok I'll post up the codes, I need to look at phangorn it certainly does bootstrapping, but mid-week if thats ok? You know deadlines, deadlines ... :-(  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-06-16. Score: 1 | Accepted answer
  
  I don't use R to build trees, I use established subprocessing stripts in Python and ETE3. So I've not run this code, but I do understand the critical parts of the code.
  
  The hard bit is bootstrapping a maximum likelihood tree, first is the ML model
  1.
  
  ```
  fitGTR <-optim.pml(fitGTR, model="GTR", optInv=TRUE, optGamma=TRUE, + rearrangement = "NNI", control = pml.control(trace = 0))
  
  ```
  
  The above model is perfect, general time reversible model with a gamma correction and an estimate of the invariant sites. This is the most important part of tree estimation. The NNI for tree rearrangements is a good one. So THIS is the model you want. You can emperical test this, but these days we don't bother.
  
  The information given for bootstrapping,
  
  2.
  
  ```
  BStree <- bootstrap.pml(x, bs = 500, trees = TRUE, multicore = FALSE,
    mc.cores = NULL, ...)
  
  ```
  
  The critical parameter is bs=500. By default it uses bs=100 which I don't think is enough. I would set multicore = TRUE to speed the calculation (it will speed it up alot) and I assume there must be a setting for the number of cores (?).
  
  I assume you can then stack all the parameters from 1/ into code 2. So in other words the model you used in part 1. (GTR PINVAR and Gammma) is same model used in the bootstrapping.
  
  This will produce a bootstrap file, probably of 500 bootstrapped ML trees, so you need to produce a consensus and represent the values on the optimal ML tree.
  
  Thus you need to overlay the bootstrap onto the tree that is output in 1. This says fitGTR and I suspect that will be a tree file with a likelihood, you might need to set a tree output and that would be 'tree' in the code below.
  3.
  
  ```
  plotBS(tree, BStrees, type = "myroot", bs.col = "black",
    bs.adj = NULL, p = 50, frame = "none", ...)
  
  ```
  
  The type = myroot is your defined outgroup for the tree. This should be your nicely bootstrapped tree.
  
  There was also this code in the help manual and I'm not sure what this is doing. I suspect it is just producing bootstrapped datasets, so its not needed here.
  
  ```
  bootstrap.phyDat(x, FUN, bs = 100, multicore = FALSE,
        mc.cores = NULL, jumble = TRUE, ...)
  
  ```
  
  To do the same with parsimony then just replace pml for parsimony. Comparing 2 bootstrap trees is a node is robust when it scores >80%
  
  > **Comments:**
  > **username_0**: will use this one to run  
  
  ---
  
  ### Answer by username_2 on 2020-07-23. Score: 2
  
  > Can i even compare these two methods?
  
  See if this paper helps:
  <https://www.nature.com/articles/nature02917>
  
  > **Comments:**
  > **username_1**: Welcome  @username_2 thanks for your comment, could you please summarise the content of your weblink here? I agrree it is a very thought provoking paper indeed, one that didn't stand the test of conventional practice but waooo  
  > **username_3**: Can you add more detail about why your link would help?  
  
  ---
  
  