read beast/mrbayes/mega Nexus output

read beast/mrbayes/mega newick file format

read.beast(file)

read.mrbayes(file)

read.beast.newick(file)

read.mega(file)

Arguments

file

newick file

Value

treedata object

treedata object

Author

Guangchuang Yu https://guangchuangyu.github.io

Bradley R Jones

Examples

file <- system.file("extdata/BEAST", "beast_mcc.tree", package="treeio")
read.beast(file)
#> 'treedata' S4 object that stored information of
#> 	'/usr/local/lib/R/site-library/treeio/extdata/BEAST/beast_mcc.tree'.
#> 
#> [email protected] phylo:
#> 
#> 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.
#> 
#> with the following features available:
#> 	'height',	'height_0.95_HPD',	'height_median',	'height_range',	'length',
#> 	'length_0.95_HPD',	'length_median',	'length_range',	'posterior',	'rate',
#> 	'rate_0.95_HPD',	'rate_median',	'rate_range'.
#> 
#> # The associated data tibble abstraction: 29 × 16
#> # The 'node', 'label' and 'isTip' are from the phylo tree.
#>     node label  isTip height height_0.95_HPD height_median height_range length
#>    <int> <chr>  <lgl>  <dbl> <list>                  <dbl> <list>        <dbl>
#>  1     1 A_1995 TRUE      18 <dbl [2]>                  18 <dbl [2]>     1.34 
#>  2     2 B_1996 TRUE      17 <dbl [2]>                  17 <dbl [2]>     3.30 
#>  3     3 C_1995 TRUE      18 <dbl [2]>                  18 <dbl [2]>     3.33 
#>  4     4 D_1987 TRUE      26 <dbl [2]>                  26 <dbl [2]>     9.14 
#>  5     5 E_1996 TRUE      17 <dbl [2]>                  17 <dbl [2]>     3.29 
#>  6     6 F_1997 TRUE      16 <dbl [2]>                  16 <dbl [2]>     0.849
#>  7     7 G_1992 TRUE      21 <dbl [2]>                  21 <dbl [2]>     5.21 
#>  8     8 H_1992 TRUE      21 <dbl [2]>                  21 <dbl [2]>     2.19 
#>  9     9 I_1994 TRUE      19 <dbl [2]>                  19 <dbl [2]>     1.76 
#> 10    10 J_1983 TRUE      30 <dbl [2]>                  30 <dbl [2]>     1.60 
#> # … with 19 more rows, and 8 more variables: length_0.95_HPD <list>,
#> #   length_median <dbl>, length_range <list>, posterior <dbl>, rate <dbl>,
#> #   rate_0.95_HPD <list>, rate_median <dbl>, rate_range <list>
file <- system.file("extdata/MrBayes", "Gq_nxs.tre", package="treeio")
read.mrbayes(file)
#> 'treedata' S4 object that stored information of
#> 	'/usr/local/lib/R/site-library/treeio/extdata/MrBayes/Gq_nxs.tre'.
#> 
#> [email protected] phylo:
#> 
#> Phylogenetic tree with 12 tips and 10 internal nodes.
#> 
#> Tip labels:
#>   B_h, B_s, G_d, G_k, G_q, G_s, ...
#> 
#> Unrooted; includes branch lengths.
#> 
#> with the following features available:
#> 	'length_0.95HPD',	'length_mean',	'length_median',	'prob',	'prob_range',
#> 	'prob_stddev',	'prob_percent',	'prob+-sd'.
#> 
#> # The associated data tibble abstraction: 22 × 11
#> # The 'node', 'label' and 'isTip' are from the phylo tree.
#>     node label isTip length_0.95HPD length_mean   length_median prob  prob_range
#>    <int> <chr> <lgl> <list>         <chr>         <chr>         <chr> <list>    
#>  1     1 B_h   TRUE  <dbl [2]>      0.1434667402… 0.1431799378… 1     <dbl [2]> 
#>  2     2 B_s   TRUE  <dbl [2]>      0.1925054374… 0.1922242167… 1     <dbl [2]> 
#>  3     3 G_d   TRUE  <dbl [2]>      0.0547261328… 0.0546279278… 1     <dbl [2]> 
#>  4     4 G_k   TRUE  <dbl [2]>      0.0628571252… 0.0627032472… 1     <dbl [2]> 
#>  5     5 G_q   TRUE  <dbl [2]>      0.0632261126… 0.0631496765… 1     <dbl [2]> 
#>  6     6 G_s   TRUE  <dbl [2]>      0.0105788053… 0.0103911008… 1     <dbl [2]> 
#>  7     7 G_t   TRUE  <dbl [2]>      0.0072686054… 0.0071387519… 1     <dbl [2]> 
#>  8     8 M_s   TRUE  <dbl [2]>      0.2950272225… 0.2943109745… 1     <dbl [2]> 
#>  9     9 N_m   TRUE  <dbl [2]>      0.2277924813… 0.2275137837… 1     <dbl [2]> 
#> 10    10 P_h   TRUE  <dbl [2]>      0.2250534499… 0.2250620826… 1     <dbl [2]> 
#> # … with 12 more rows, and 3 more variables: prob_stddev <chr>,
#> #   prob_percent <chr>, prob+-sd <chr>
tree <- read.beast.newick(textConnection('(a[&rate=1]:2,(b[&rate=1.1]:1,c[&rate=0.9]:1)[&rate=1]:1);'))