Re: [R-sig-phylo] Problem date consensus phylogeny

2019-01-23 Thread Emmanuel Paradis

Hi Alina,

Did you try multi2di() to remove polytomies?

Best,

Emmanuel

Le 23/01/2019 à 17:41, Alina van dijk a écrit :

Hi everyone,

My name is Alina, I'm attending master degree in ecology and I have a
little problem with my consensus phylogeny. I used 1000 phylogeny of
birdtree to construct the consensus tree but now I need to insert the dates
in this consensus tree.

To accomplish this idea, I tried different methods: consensustree<-averageTree
(tree,method="symmetric.difference") but the result is a consensus tree in
topology, binary and rooted but not ultrametric. For this problem I used
consensus_tree_ultrametric
<-compute.brlen(consensustree,method="Grafen",power=1), but the edge
lengths was altered.

So, I used another method to make a consensus tree using phytools
consensustree_another_method <- consensus.edges(multiphylo,method =
"mean.edge") as a result, a ultrametric tree, rooted with consensus edges
lengths, but have polytomies :(

I also tried using phylobase , proposed by Brian O'Meara in this link:
https://grokbase.com/t/r/r-sig-phylo/12bn9x5gv4/why-no-branch-lengths-on-consensus-trees
,
  but as a result, my consensus tree wasn´t ultrametric and the
transformation also altered the edge lengths.

I only need to insert the dates based on the trees dated by Jetz in this
consensus tree and as result, an ultrametric tree, with consensus edges
lengths and no polytomy.

Does anyone know how to solve that problem?

Thanks in advance,
Best Regards,

Alina

[[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/


Pour nous remonter une erreur de filtrage, veuillez vous rendre ici : 
http://f.security-mail.net/VKQxzoa2




___
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/


Re: [R-sig-phylo] Problem date consensus phylogeny

2019-01-23 Thread Joseph Brown
 I typically use a non-R tool like treeannotator (from the BEAST package)
to do this type of thing, especially when involving large numbers of big
trees.

HTH.
Joseph.

On Wed, Jan 23, 2019 at 4:42 PM Alina van dijk  wrote:

> Hi everyone,
>
> My name is Alina, I'm attending master degree in ecology and I have a
> little problem with my consensus phylogeny. I used 1000 phylogeny of
> birdtree to construct the consensus tree but now I need to insert the dates
> in this consensus tree.
>
> To accomplish this idea, I tried different methods:
> consensustree<-averageTree
> (tree,method="symmetric.difference") but the result is a consensus tree in
> topology, binary and rooted but not ultrametric. For this problem I used
> consensus_tree_ultrametric
> <-compute.brlen(consensustree,method="Grafen",power=1), but the edge
> lengths was altered.
>
> So, I used another method to make a consensus tree using phytools
> consensustree_another_method <- consensus.edges(multiphylo,method =
> "mean.edge") as a result, a ultrametric tree, rooted with consensus edges
> lengths, but have polytomies :(
>
> I also tried using phylobase , proposed by Brian O'Meara in this link:
>
> https://grokbase.com/t/r/r-sig-phylo/12bn9x5gv4/why-no-branch-lengths-on-consensus-trees
> ,
>  but as a result, my consensus tree wasn´t ultrametric and the
> transformation also altered the edge lengths.
>
> I only need to insert the dates based on the trees dated by Jetz in this
> consensus tree and as result, an ultrametric tree, with consensus edges
> lengths and no polytomy.
>
> Does anyone know how to solve that problem?
>
> Thanks in advance,
> Best Regards,
>
> Alina
>
> [[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/


[R-sig-phylo] Problem date consensus phylogeny

2019-01-23 Thread Alina van dijk
Hi everyone,

My name is Alina, I'm attending master degree in ecology and I have a
little problem with my consensus phylogeny. I used 1000 phylogeny of
birdtree to construct the consensus tree but now I need to insert the dates
in this consensus tree.

To accomplish this idea, I tried different methods: consensustree<-averageTree
(tree,method="symmetric.difference") but the result is a consensus tree in
topology, binary and rooted but not ultrametric. For this problem I used
consensus_tree_ultrametric
<-compute.brlen(consensustree,method="Grafen",power=1), but the edge
lengths was altered.

So, I used another method to make a consensus tree using phytools
consensustree_another_method <- consensus.edges(multiphylo,method =
"mean.edge") as a result, a ultrametric tree, rooted with consensus edges
lengths, but have polytomies :(

I also tried using phylobase , proposed by Brian O'Meara in this link:
https://grokbase.com/t/r/r-sig-phylo/12bn9x5gv4/why-no-branch-lengths-on-consensus-trees
,
 but as a result, my consensus tree wasn´t ultrametric and the
transformation also altered the edge lengths.

I only need to insert the dates based on the trees dated by Jetz in this
consensus tree and as result, an ultrametric tree, with consensus edges
lengths and no polytomy.

Does anyone know how to solve that problem?

Thanks in advance,
Best Regards,

Alina

[[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/


Re: [R-sig-phylo] exponential time with write.tree

2019-01-23 Thread Jérémie Bardin
Thanks a lot Emmanuel. It works perfectly.
Amitiés, Jérémie.

Jérémie Bardin, Dr.

 CR2P - Centre de Recherche en Paléontologie - ParisSorbonne Université - MNHN 
- CNRS
Site Jussieu, Tour 46-56, 5°et.
4 place Jussieu, 75252 Paris Cedex 05
tel. +331.44.27.51.77.
jeremie.bar...@upmc.fr / jbar...@mnhn.fr / jeremiebar...@yahoo.fr 

Le mercredi 23 janvier 2019 à 15:55:01 UTC+1, Emmanuel Paradis 
 a écrit :  
 
 Hi Jérémie,

You're correct: the current version of write.tree() scales with n^2. 
This seems to be related to calling the generic '[[' operator. You can 
modify the code with the usual fix(write.tree), then insert these two lines:

    phy <- .uncompressTipLabel(phy)
    class(phy) <- NULL

right before the 'for' loop, save and close. You may need to use the 
modified code once or twice (with a small tree) so that R might 
byte-compile it. I've tried it with the 2027025 trees generared by 
allTrees(9,rooted=T) and it took 8.5 mins (instead of the predicted 28 
hrs with the current code).

Best,

Emmanuel

Le 23/01/2019 à 10:51, Jérémie Bardin a écrit :
> Hi all,
> I tried to export 2 millions trees to a .tre file with write.tree. This never 
> ends, thus i tried to get why and realized that the time to write the .tre 
> depends exponentially on the number of trees.
> 
> trees<-allTrees(9,rooted=T)to<-seq(1,200,1)durations<-NAfor(i in 
> 1:length(to)) { ptm <- proc.time() write.tree(trees[1:to[i]], file = 
> "test.tre") durations[i]<-(proc.time() - ptm)[3]}
> I do not really get why it is not nearly linear. Any explanation?
> Cheers, Jérémie
> 
> Jérémie Bardin, Dr.
> 
> CR2P - Centre de Recherche en Paléontologie - ParisSorbonne Université - MNHN 
> - CNRS
> Site Jussieu, Tour 46-56, 5°et.
> 4 place Jussieu, 75252 Paris Cedex 05
> tel. +331.44.27.51.77.
> jeremie.bar...@upmc.fr / jbar...@mnhn.fr / jeremiebar...@yahoo.fr
> 
>     [[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/
> 
> 
> Pour nous remonter une erreur de filtrage, veuillez vous rendre ici : 
> http://f.security-mail.net/fPLqvOj4
> 
> 
  
[[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/


Re: [R-sig-phylo] exponential time with write.tree

2019-01-23 Thread Emmanuel Paradis

Hi Jérémie,

You're correct: the current version of write.tree() scales with n^2. 
This seems to be related to calling the generic '[[' operator. You can 
modify the code with the usual fix(write.tree), then insert these two lines:


phy <- .uncompressTipLabel(phy)
class(phy) <- NULL

right before the 'for' loop, save and close. You may need to use the 
modified code once or twice (with a small tree) so that R might 
byte-compile it. I've tried it with the 2027025 trees generared by 
allTrees(9,rooted=T) and it took 8.5 mins (instead of the predicted 28 
hrs with the current code).


Best,

Emmanuel

Le 23/01/2019 à 10:51, Jérémie Bardin a écrit :

Hi all,
I tried to export 2 millions trees to a .tre file with write.tree. This never 
ends, thus i tried to get why and realized that the time to write the .tre 
depends exponentially on the number of trees.

trees<-allTrees(9,rooted=T)to<-seq(1,200,1)durations<-NAfor(i in 1:length(to)) { 
ptm <- proc.time() write.tree(trees[1:to[i]], file = "test.tre") 
durations[i]<-(proc.time() - ptm)[3]}
I do not really get why it is not nearly linear. Any explanation?
Cheers, Jérémie

Jérémie Bardin, Dr.

CR2P - Centre de Recherche en Paléontologie - ParisSorbonne Université - MNHN - 
CNRS
Site Jussieu, Tour 46-56, 5°et.
4 place Jussieu, 75252 Paris Cedex 05
tel. +331.44.27.51.77.
jeremie.bar...@upmc.fr / jbar...@mnhn.fr / jeremiebar...@yahoo.fr

[[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/


Pour nous remonter une erreur de filtrage, veuillez vous rendre ici : 
http://f.security-mail.net/fPLqvOj4




___
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/


[R-sig-phylo] exponential time with write.tree

2019-01-23 Thread Jérémie Bardin
Hi all,
I tried to export 2 millions trees to a .tre file with write.tree. This never 
ends, thus i tried to get why and realized that the time to write the .tre 
depends exponentially on the number of trees.

trees<-allTrees(9,rooted=T)to<-seq(1,200,1)durations<-NAfor(i in 
1:length(to)) { ptm <- proc.time() write.tree(trees[1:to[i]], file = 
"test.tre") durations[i]<-(proc.time() - ptm)[3]}
I do not really get why it is not nearly linear. Any explanation?
Cheers, Jérémie

Jérémie Bardin, Dr.

CR2P - Centre de Recherche en Paléontologie - ParisSorbonne Université - MNHN - 
CNRS
Site Jussieu, Tour 46-56, 5°et.
4 place Jussieu, 75252 Paris Cedex 05
tel. +331.44.27.51.77.
jeremie.bar...@upmc.fr / jbar...@mnhn.fr / jeremiebar...@yahoo.fr

[[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/