dbtreeshape {apTreeshape}R Documentation

Collect trees from a database.

Description

dbtreeshape is a function that calls either pandit or treebase.
pandit connects to the database Pandit and collects a given list of trees from there, converting them into the "treeshape" or "phylo" class.
treebase does the same on the TreeBASE database.

Usage

dbtreeshape(db, tree, class="treeshape", type="s", quiet=FALSE, 
      model=NULL, p=0.3)
pandit(tree, class="treeshape", type="s", quiet=FALSE, model=NULL, p=0.3)
treebase(tree, class="treeshape", quiet=FALSE, model=NULL, p=0.3)

Arguments

db A character string equals to the name of the database to connect: "pandit" or "treebase".
tree ID vector or list of the trees to be collected from the base.
class The class of the returned trees: must be one of "treeshape" (default) or "phylo".
type The type of the tree: an object of class "character" equals to either "s" (default) or "f" (seed or full). This option is only used for the Pandit database.
quiet A logical value. If TRUE, nothing will be printed on screen. If FALSE (default), lines will be printed to indicate informations about the gathered trees.
model Argument to be passed to as.treshape.phylo. One of NULL (default), "pda" or "yule"
p Argument to be passed to as.treshape.phylo.

Details

The aim of these functions is to provide a simplified method to retrieve trees and to put them into the "treeshape" or "phylo" format, in order to be able to apply the methods apTreeshape provides.
These functions connect to databases and retrieve trees from their reference number in the database. There is currently no option to retrieve trees from their names. See references for more details about the Pandit and TreeBASE databases and the description of their data.
These functions may simulate trees with polytomies (see as.treeshape for more details about the polytomy resolution).

Value

An object of class "treeshape" or class "phylo" if only one tree is requested, a list of trees otherwise.

Author(s)

Michael Blum <michael.blum@imag.fr>
Nicolas Bortolussi <nicolas.bortolussi@imag.fr>
Eric Durand <eric.durand@imag.f>
Olivier François <olivier.francois@imag.fr>

References

http://www.ebi.ac.uk/goldman-srv/pandit/ for more details about the Pandit database.

http://www.treebase.org/treebase/ for informations about the TreeBASE database.

See Also

as.treeshape for more details about the convertion of non-binary trees.

Examples

if(!inherits(try(open(url("http://www.google.com")), silent = TRUE),
   "try-error")) {
## Sackin's index of a tree within TreeBASE.
sackin(treebase(tree=715))

## Colless' index of a tree within Pandit
colless(pandit(tree=1))
  
## Collects a tree without printings: 
plot(pandit(709, quiet=TRUE))

## Collects a list of trees :
trees=pandit(1:5)
summary(trees[[2]])
  
## Collects a non-binary tree
phy=treebase(741, class="phylo")
plot(phy)
tree=treebase(741, class="treeshape")
tree=treebase(741, class="treeshape", model="yule")
plot(tree)
}

[Package apTreeshape version 1.0.0 Index]