rooting

82 views
Skip to first unread message

chris blair

unread,
Jul 1, 2018, 8:57:33 AM7/1/18
to raxml
Hi all, 

I have a file containing thousands of unrooted gene trees from RAxML. I am trying to root them using the outgroup in R (Ape), but for some reason it's not working. Here is what I am doing:

trees <- read.tree(file="besttrees_351.tre", keep.multi=TRUE)
root(trees, "MXH253AgPi")

What am I missing here?

Thanks. 

Chris

Fidel Botero

unread,
Jul 1, 2018, 9:39:43 AM7/1/18
to ra...@googlegroups.com
Hi Chris,
If I remember well, you have to store the rooted trees in a new object. 

rooted<-root(....)

Using root() without redirection reroots the trees but doesn't modify the original ones.

Best,

Fidel



--
You received this message because you are subscribed to the Google Groups "raxml" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raxml+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

chris blair

unread,
Jul 1, 2018, 9:45:38 AM7/1/18
to raxml
Yeah I've tried that. Seems to be something else. When I first import the file it tells me that all trees are rooted. I'm assuming this is just how APE reads trees inferred by RAxML. When I try to root using the outgroup and then type is.rooted(trees) it tells me false for most trees. I wonder if the issue might be related to polytomies?

Alexandros Stamatakis

unread,
Jul 1, 2018, 11:59:38 PM7/1/18
to ra...@googlegroups.com
I have never used that R function, but RAxML output trees are always
strictly bifurcating,

alexis

On 01.07.2018 15:45, chris blair wrote:
> Yeah I've tried that. Seems to be something else. When I first import
> the file it tells me that all trees are rooted. I'm assuming this is
> just how APE reads trees inferred by RAxML. When I try to root using the
> outgroup and then type is.rooted(trees) it tells me false for most
> trees. I wonder if the issue might be related to polytomies?
>
> On Sunday, 1 July 2018 09:39:43 UTC-4, fidelbc83 wrote:
>
> Hi Chris,
> If I remember well, you have to store the rooted trees in a new object.
>
> rooted<-root(....)
>
> Using root() without redirection reroots the trees but doesn't
> modify the original ones.
>
> Best,
>
> Fidel
>
>
>
> chris blair <blai...@gmail.com <javascript:>> schrieb am So., 1.
> Juli 2018, 14:57:
>
> Hi all,
>
> I have a file containing thousands of unrooted gene trees from
> RAxML. I am trying to root them using the outgroup in R (Ape),
> but for some reason it's not working. Here is what I am doing:
>
> trees <- read.tree(file="besttrees_351.tre", keep.multi=TRUE)
> root(trees, "MXH253AgPi")
>
> What am I missing here?
>
> Thanks.
>
> Chris
>
> --
> You received this message because you are subscribed to the
> Google Groups "raxml" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to raxml+un...@googlegroups.com <javascript:>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "raxml" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to raxml+un...@googlegroups.com
> <mailto:raxml+un...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--
Alexandros (Alexis) Stamatakis

Research Group Leader, Heidelberg Institute for Theoretical Studies
Full Professor, Dept. of Informatics, Karlsruhe Institute of Technology

www.exelixis-lab.org

Eddie Salinas

unread,
Jul 2, 2018, 4:47:49 AM7/2/18
to ra...@googlegroups.com, blai...@gmail.com
Hi Chris,

Recentl I was using APE.  Specifically to read trees and do some plotting of them using its features to color some tips/leaves differently than others.   This was in late April or early/mid May.

At first I would read trees using read.trees as following the vignette (https://cran.r-project.org/web/packages/ape/vignettes/MoranI.pdf)

BUT it would crash at the read.trees function and would not read the tree file.

For me, what fixed the issue was upgrading to a more recent version of APE.  

As of now, the latest version appears to be 5.1 https://cran.r-project.org/web/packages/ape/index.html
I think my issue was observed in v 5.0 .  

HTH

-eddie

To unsubscribe from this group and stop receiving emails from it, send an email to raxml+unsubscribe@googlegroups.com <mailto:raxml+unsubscribe@googlegroups.com>.

For more options, visit https://groups.google.com/d/optout.

--
Alexandros (Alexis) Stamatakis

Research Group Leader, Heidelberg Institute for Theoretical Studies
Full Professor, Dept. of Informatics, Karlsruhe Institute of Technology

www.exelixis-lab.org
--
You received this message because you are subscribed to the Google Groups "raxml" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raxml+unsubscribe@googlegroups.com.

Fidel Botero

unread,
Jul 2, 2018, 5:20:57 AM7/2/18
to ra...@googlegroups.com
Hi again Chris,

I just checked with a single tree and had the same problem, i.e, using the root function resulted in an unrooted tree (due to polytomies). It was solved by setting the resolve.root option to TRUE:

root(tree, outgroup=og, resolve.root=T)

Also, there is a function is.rooted.multiPhylo() that might be more adequate for your multitree file than the canonical is.rooted().

Hope this helps.

Best,

Fidel

2018-07-02 10:47 GMT+02:00 Eddie Salinas <eddiea...@gmail.com>:
Hi Chris,

Recentl I was using APE.  Specifically to read trees and do some plotting of them using its features to color some tips/leaves differently than others.   This was in late April or early/mid May.

At first I would read trees using read.trees as following the vignette (https://cran.r-project.org/web/packages/ape/vignettes/MoranI.pdf)

BUT it would crash at the read.trees function and would not read the tree file.

For me, what fixed the issue was upgrading to a more recent version of APE.  

As of now, the latest version appears to be 5.1 https://cran.r-project.org/web/packages/ape/index.html
I think my issue was observed in v 5.0 .  

HTH

-eddie



--
Fidel Botero-Castro

chris blair

unread,
Jul 2, 2018, 7:58:06 AM7/2/18
to raxml
Thanks for the suggestions everyone. This seemed to work:

or (index in 1:length(trees)){
  outgroup <- "MXH253AgPi"
  trees[[index]] <- root(trees[[index]], outgroup, resolve.root=TRUE)
-eddie


To unsubscribe from this group and stop receiving emails from it, send an email to raxml+un...@googlegroups.com <mailto:raxml+un...@googlegroups.com>.

For more options, visit https://groups.google.com/d/optout.

--
Alexandros (Alexis) Stamatakis

Research Group Leader, Heidelberg Institute for Theoretical Studies
Full Professor, Dept. of Informatics, Karlsruhe Institute of Technology

www.exelixis-lab.org


--
You received this message because you are subscribed to the Google Groups "raxml" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raxml+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "raxml" group.
To unsubscribe from this group and stop receiving emails from it, send an email to raxml+un...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Fidel Botero-Castro

Reply all
Reply to author
Forward
0 new messages