Hi Russell,

A package I wrote a while back should be able to do that fairly easily.
https://github.com/eliotmiller/addTaxa The only paper it's described in
remains https://bsapubs.onlinelibrary.wiley.com/doi/full/10.3732/ajb.1500195
It's a wrapper for bind.tip, with some additional stuff. You basically
would give it a taxonomic file where you identify the clades you're
interested in (e.g. both of those Cercopithecus species could be named some
unique clade name and off you go, it'd add the missing one to the other),
then lapply that whole addTaxa command over the list of trees in
multiPhylo. At some point I made laser a dependency, and it's possible I
left it in that state. If that's the case, you can still get laser from old
CRAN mirrors I believe. Let me know if you want more help.

Best,
Eliot

On Wed, Jun 2, 2021 at 7:05 PM Russell Engelman <neovenatori...@gmail.com>
wrote:

> Dear R-sig-phylo,
>
> I have been working with a mammalian phylogeny I recently downloaded from
> VertLife (http://vertlife.org/phylosubsets/). Unfortunately, the phylogeny
> is missing a large number of species, so I am trying to manually add these
> taxa to the phylogeny. I have a series of 100 trees that I am using to do
> things such as test for phylogenetic signal. I know how to use bind.tip to
> add new taxa to a single tree, but I am having more trouble with a
> multiPhylo object. I am primarily adding these taxa by placing them as
> sister to their nearest included relative (since most of them are elevated
> former subspecies), but the issue here is that in the 100 trees in the
> multiPhylo object the node representing the taxon to bind these taxa to is
> not the same across all trees due to shifting topologies.
>
> This is an example of the code I have been using, in which "tree" is the
> tree object. This works for a single 'phylo' tree but not 'multiphylo'.
>
> ```
> newtree<-lapply(tree,bind.tip,tip.label="Cercopithecus_albogularis",
>                 position=0.59,edge.length = 0.59,
>
> where=mrca(tree)["Cercopithecus_mitis","Cercopithecus_mitis"])
> ```
>
> Now, this code will not work, but I know exactly why: 'tree' is a
> multiPhylo object and so the 'where' argument cannot find the node for the
> terminal taxon. However, the issue is how can I tell R to repeat this
> 'where' argument for each of the 100 trees, since the node in question is
> not identical across these trees? Is there an easier way to do this than
> using the 'mrca' call for each terminal taxon? I've noticed adding a 'mrca'
> argument also increases computation time and if I am reinventing the wheel
> it would be nice to know if I am overthinking things.
>
> Sincerely,
> Russell
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at
> http://www.mail-archive.com/r-sig-phylo@r-project.org/
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to