Re: [R-sig-phylo] R-sig-phylo Digest, Vol 95, Issue 6

2015-12-11 Thread Jacob Berv
There appears to be some issues with ggtree plotting BEAST output - I just 
tried to run through the example and got the following errors: 


source("https://bioconductor.org/biocLite.R;)
biocLite("ggtree")
require("ggtree")

> file <- system.file("extdata/BEAST", "beast_mcc.tree", package="ggtree")
> beast <- read.beast(file)
> beast

Phylogenetic tree with 15 tips and 14 internal nodes.

Tip labels:
A_1995, B_1996, C_1995, D_1987, E_1996, F_1997, ...

Rooted; includes branch lengths.
> str(beast)
List of 23
 $ edge  : int [1:28, 1:2] 16 17 18 18 17 16 19 19 20 20 ...
 $ edge.length   : num [1:28] 3.1 25.44 9.39 6.39 8.82 ...
 $ Nnode : int 14
 $ tip.label : chr [1:15] "A_1995" "B_1996" "C_1995" "D_1987" ...
 $ rate_range_MIN: num [1:14] NA 0.00137 0.00184 0.00119 0.00135 ...
 $ rate_range_MAX: num [1:14] NA 0.00502 0.00422 0.00639 0.00481 ...
 $ length_range_MIN  : num [1:14] NA 0.00603 15.72468 0.42344 0.46641 ...
 $ length_range_MAX  : num [1:14] NA 7.71 36.72 11 3.95 ...
 $ length_95%_HPD_MIN: num [1:14] NA 0.306 22.049 1.88 1.125 ...
 $ length_95%_HPD_MAX: num [1:14] NA 5.18 30.12 6.67 2.93 ...
 $ height: num [1:14] 38.04 34.89 9.47 33.62 31.6 ...
 $ rate  : num [1:14] NA 0.00292 0.00291 0.00291 0.00289 ...
 $ rate_median   : num [1:14] NA 0.00291 0.0029 0.0029 0.00288 ...
 $ length: num [1:14] 0 3.01 25.72 4.35 2.02 ...
 $ length_median : num [1:14] NA 3.01 25.58 4.28 2.01 ...
 $ rate_95%_HPD_MIN  : num [1:14] NA 0.00231 0.00237 0.00228 0.00226 ...
 $ rate_95%_HPD_MAX  : num [1:14] NA 0.00359 0.00348 0.00357 0.0035 ...
 $ height_95%_HPD_MIN: num [1:14] 35.31 31.42 7.32 33.07 30.72 ...
 $ height_95%_HPD_MAX: num [1:14] 40.8 38.7 11.6 34.3 32.6 ...
 $ height_range_MIN  : num [1:14] 33.97 29.2 5.94 33 30.32 ...
 $ height_range_MAX  : num [1:14] 46.9 42.9 15.1 35.4 33.5 ...
 $ height_median : num [1:14] 37.93 34.82 9.39 33.57 31.56 ...
 $ posterior : num [1:14] 1 0.941 1 1 1 ...
 - attr(*, "class")= chr "phylo"
 - attr(*, "origin")= chr 
"/Library/Frameworks/R.framework/Versions/3.2/Resources/library/ggtree/extdata/BEAST/beast_mcc.tree"
> plot(beast, annotation="length_0.95_HPD", branch.length="none") + theme_tree()
NULL
Warning messages:
1: In plot.window(...) : "annotation" is not a graphical parameter
2: In plot.window(...) : "branch.length" is not a graphical parameter
3: In plot.xy(xy, type, ...) : "annotation" is not a graphical parameter
4: In plot.xy(xy, type, ...) :
  "branch.length" is not a graphical parameter
5: In title(...) : "annotation" is not a graphical parameter
6: In title(...) : "branch.length" is not a graphical parameter

So, there is some issue with plotting, and read.beast is also not parsing all 
of the data from internal branches. you can see that it reads data from 14 
branches (I think these are the terminal branches?) but there are actually 28 
total branches in the example. It would be awesome if this actually could 
replace the read.annotated.nexus from OutbreakTools, as this kind of output is 
much easier to workwith.

Jake


> On Dec 10, 2015, at 7:42 AM, Yu, Guangchuang  wrote:
> 
> Dear Roger,
> 
> ggtree can parse BEAST output and visualize BEAST statistics, see the
> document:
> http://www.bioconductor.org/packages/3.2/bioc/vignettes/ggtree/inst/doc/ggtree.html#annotating-tree-with-beast-output
> 
> Bests,
> Guangchuang
> 
> 
> On Thu, Dec 10, 2015 at 7:00 PM,  wrote:
> 
>> Send R-sig-phylo mailing list submissions to
>>r-sig-phylo@r-project.org
>> 
>> To subscribe or unsubscribe via the World Wide Web, visit
>>https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>> or, via email, send a message with subject or body 'help' to
>>r-sig-phylo-requ...@r-project.org
>> 
>> You can reach the person managing the list at
>>r-sig-phylo-ow...@r-project.org
>> 
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of R-sig-phylo digest..."
>> 
>> 
>> Today's Topics:
>> 
>>   1. Re: Plotting sampled-ancestor trees in R (Roger Close)
>>   2. Implementation of Mir et al.'s (2013) tree balanceindex?
>>  (Gabriel Yedid)
>> 
>> 
>> --
>> 
>> Message: 1
>> Date: Wed, 9 Dec 2015 15:50:11 +
>> From: Roger Close 
>> To: David Bapst 
>> Cc: R Sig Phylo Listserv 
>> Subject: Re: [R-sig-phylo] Plotting sampled-ancestor trees in R
>> Message-ID:
>>

Re: [R-sig-phylo] R-sig-phylo Digest, Vol 95, Issue 6

2015-12-11 Thread Jacob Berv
Whoops! nevermind. It appears read.beast was being masked from read.beast in 
phyloch. Working now.
Jake


> On Dec 11, 2015, at 12:56 PM, Jacob Berv  
> wrote:
> 
> There appears to be some issues with ggtree plotting BEAST output - I just 
> tried to run through the example and got the following errors: 
> 
> 
> source("https://bioconductor.org/biocLite.R 
> ")
> biocLite("ggtree")
> require("ggtree")
> 
> > file <- system.file("extdata/BEAST", "beast_mcc.tree", package="ggtree")
> > beast <- read.beast(file)
> > beast
> 
> Phylogenetic tree with 15 tips and 14 internal nodes.
> 
> Tip labels:
>   A_1995, B_1996, C_1995, D_1987, E_1996, F_1997, ...
> 
> Rooted; includes branch lengths.
> > str(beast)
> List of 23
>  $ edge  : int [1:28, 1:2] 16 17 18 18 17 16 19 19 20 20 ...
>  $ edge.length   : num [1:28] 3.1 25.44 9.39 6.39 8.82 ...
>  $ Nnode : int 14
>  $ tip.label : chr [1:15] "A_1995" "B_1996" "C_1995" "D_1987" ...
>  $ rate_range_MIN: num [1:14] NA 0.00137 0.00184 0.00119 0.00135 ...
>  $ rate_range_MAX: num [1:14] NA 0.00502 0.00422 0.00639 0.00481 ...
>  $ length_range_MIN  : num [1:14] NA 0.00603 15.72468 0.42344 0.46641 ...
>  $ length_range_MAX  : num [1:14] NA 7.71 36.72 11 3.95 ...
>  $ length_95%_HPD_MIN: num [1:14] NA 0.306 22.049 1.88 1.125 ...
>  $ length_95%_HPD_MAX: num [1:14] NA 5.18 30.12 6.67 2.93 ...
>  $ height: num [1:14] 38.04 34.89 9.47 33.62 31.6 ...
>  $ rate  : num [1:14] NA 0.00292 0.00291 0.00291 0.00289 ...
>  $ rate_median   : num [1:14] NA 0.00291 0.0029 0.0029 0.00288 ...
>  $ length: num [1:14] 0 3.01 25.72 4.35 2.02 ...
>  $ length_median : num [1:14] NA 3.01 25.58 4.28 2.01 ...
>  $ rate_95%_HPD_MIN  : num [1:14] NA 0.00231 0.00237 0.00228 0.00226 ...
>  $ rate_95%_HPD_MAX  : num [1:14] NA 0.00359 0.00348 0.00357 0.0035 ...
>  $ height_95%_HPD_MIN: num [1:14] 35.31 31.42 7.32 33.07 30.72 ...
>  $ height_95%_HPD_MAX: num [1:14] 40.8 38.7 11.6 34.3 32.6 ...
>  $ height_range_MIN  : num [1:14] 33.97 29.2 5.94 33 30.32 ...
>  $ height_range_MAX  : num [1:14] 46.9 42.9 15.1 35.4 33.5 ...
>  $ height_median : num [1:14] 37.93 34.82 9.39 33.57 31.56 ...
>  $ posterior : num [1:14] 1 0.941 1 1 1 ...
>  - attr(*, "class")= chr "phylo"
>  - attr(*, "origin")= chr 
> "/Library/Frameworks/R.framework/Versions/3.2/Resources/library/ggtree/extdata/BEAST/beast_mcc.tree"
> > plot(beast, annotation="length_0.95_HPD", branch.length="none") + 
> > theme_tree()
> NULL
> Warning messages:
> 1: In plot.window(...) : "annotation" is not a graphical parameter
> 2: In plot.window(...) : "branch.length" is not a graphical parameter
> 3: In plot.xy(xy, type, ...) : "annotation" is not a graphical parameter
> 4: In plot.xy(xy, type, ...) :
>   "branch.length" is not a graphical parameter
> 5: In title(...) : "annotation" is not a graphical parameter
> 6: In title(...) : "branch.length" is not a graphical parameter
> 
> So, there is some issue with plotting, and read.beast is also not parsing all 
> of the data from internal branches. you can see that it reads data from 14 
> branches (I think these are the terminal branches?) but there are actually 28 
> total branches in the example. It would be awesome if this actually could 
> replace the read.annotated.nexus from OutbreakTools, as this kind of output 
> is much easier to workwith.
> 
> Jake
> 
> 
>> On Dec 10, 2015, at 7:42 AM, Yu, Guangchuang > > wrote:
>> 
>> Dear Roger,
>> 
>> ggtree can parse BEAST output and visualize BEAST statistics, see the
>> document:
>> http://www.bioconductor.org/packages/3.2/bioc/vignettes/ggtree/inst/doc/ggtree.html#annotating-tree-with-beast-output
>>  
>> 
>> 
>> Bests,
>> Guangchuang
>> 
>> 
>> On Thu, Dec 10, 2015 at 7:00 PM,  wrote:
>> 
>>> Send R-sig-phylo mailing list submissions to
>>>r-sig-phylo@r-project.org
>>> 
>>> To subscribe or unsubscribe via the World Wide Web, visit
>>>https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
>>> or, via email, send a message with subject or body 'help' to
>>>r-sig-phylo-requ...@r-project.org
>>> 
>>> You can reach the person managing the list at
>>>r-sig-phylo-ow...@r-project.org
>>> 
>>> When replying, please edit your Subject line so it is more specific
>>> than "Re: Contents of R-sig-phylo digest..."
>>> 
>>> 
>>> Today's Topics:
>>> 
>>>   1. Re: Plotting sampled-ancestor trees in R (Roger Close)
>>>   2. Implementation of Mir et al.'s (2013) tree balanceindex?
>>>  (Gabriel Yedid)
>>> 
>>> 
>>> --
>>> 
>>> Message: 1
>>> Date: Wed, 9 Dec 2015 15:50:11 +
>>> From: Roger