R/ape.R
5bb1376e
 
d8a0e350
 ## ##' @export
 ## ape::read.tree
b921de96
 
 
d8a0e350
 ## ##' generate random tree
 ## ##' @export
 ## ##' @rdname rtree
 ## ##' @param n number of tips in the tree
 ## ##' @param rooted logcial
 ## ##' @param tip.label tip label
 ## ##' @param br one of the following: (i) an R function used to generate the
 ## ##'           branch lengths ('rtree'; use 'NULL' to simulate only a
 ## ##'           topology), or the coalescence times ('rcoal'); (ii) a
 ## ##'           character to simulate a genuine coalescent tree for 'rcoal'
 ## ##'           (the default); or (iii) a numeric vector for the branch
 ## ##'           lengths or the coalescence times.
 ## ##' @param ... additional parameters to be passed to 'br'
 ## ##' @source
 ## ##' This is just the imported function
 ## ##' from the ape package. The documentation you should
 ## ##' read for the rtree function can be found here: \link[ape]{rtree}
 ## ##'
 ## ##' @seealso
 ## ##' \link[ape]{rtree}
 ## rtree <- ape::rtree
b921de96
 
6c9cd355
 
 ##' merge phylo and output of boot.phylo to 'apeBootstrap' object
 ##'
0d9e240e
 ##'
6c9cd355
 ##' @title apeBoot
 ##' @param phylo phylo
 ##' @param boot bootstrap values
 ##' @return an instance of 'apeBootstrap'
d8a0e350
 ##' @importFrom treeio as.treedata
6c9cd355
 ##' @export
 ##' @author Guangchuang Yu
 apeBoot <- function(phylo, boot) {
d8a0e350
     message("this function was deprecated, please use treeio::as.treedata")
     as.treedata(phylo, boot)
6c9cd355
 }
 
d8a0e350
 ## apeBoot <- function(phylo, boot) {
 ##     ## phylo is a phylo object
 ##     ## boot is output from boot.phylo
 ##     new("apeBootstrap",
 ##         phylo=phylo,
 ##         bootstrap=data.frame(node=(1:Nnode(phylo)) + Ntip(phylo), bootstrap=boot)
 ##         )
 ## }
 
6c9cd355
 
d8a0e350
 ## ##' @rdname show-methods
 ## ##' @importFrom ape print.phylo
 ## ##' @exportMethod show
 ## setMethod("show", signature(object = "apeBootstrap"),
 ##           function(object) {
 ##               cat("'apeBoot' S4 object that stored bootstrap value generated by 'ape::boot.phylo'", ".\n\n")
 ##               cat("...@ tree: ")
 ##               print.phylo(get.tree(object))
 ##           })
6c9cd355
 
 
 
 
d8a0e350
 ## ##' @rdname groupClade-methods
 ## ##' @exportMethod groupClade
 ## setMethod("groupClade", signature(object="apeBootstrap"),
 ##           function(object, node, group_name="group") {
 ##               groupClade_(object, node, group_name)
 ##           })
6c9cd355
 
d8a0e350
 ## ##' @rdname scale_color-methods
 ## ##' @exportMethod scale_color
 ## setMethod("scale_color", signature(object="apeBootstrap"),
 ##           function(object, by="bootstrap", ...) {
 ##               scale_color_(object, by, ...)
 ##           })
6c9cd355
 
 
d8a0e350
 ## ##' @rdname get.fields-methods
 ## ##' @exportMethod get.fields
 ## setMethod("get.fields", signature(object="apeBootstrap"),
 ##           function(object, ...) {
 ##               get.fields.tree(object)
 ##           }
 ##           )
6c9cd355