swapONE: Create alternative phylogenies from a given tree

View source: R/swapONE.R

swapONER Documentation

Create alternative phylogenies from a given tree

Description

The function produces an alternative phylogeny with altered topology and branch length, and computes the Kuhner-Felsenstein (Kuhner & Felsenstein 1994) distance between original and 'swapped' tree.

Usage

swapONE(tree,node=NULL,si=0.5,si2=0.5,plot.swap=FALSE)

Arguments

tree

a phylogenetic tree. The tree needs not to be ultrametric or fully dichotomous.

node

if specified, the clades subtended by such node(s) are imposed to be monophyletic. In this case, the function can still swap tips within the clade.

si

the proportion of tips whose topologic arrangement will be swapped.

si2

the proportion of nodes whose age will be changed.

plot.swap

if TRUE, the function plots the swapped tree. Swapped positions appear in red. Nodes with altered ages appear in green.

Details

swapONE changes the tree topology and branch lengths. Up to half of the tips, and half of the branch lengths can be changed randomly. Each randomly selected node is allowed to move up to 2 nodes apart from its original position.

Value

The function returns a list containing the 'swapped' version of the original tree, and the Kuhner-Felsenstein distance between the trees. Note, tip labels are ordered according to their position in the tree.

Author(s)

Silvia Castiglione, Pasquale Raia, Carmela Serio, Alessandro Mondanaro, Marina Melchionna, Mirko Di Febbraro, Antonio Profico, Francesco Carotenuto

References

Kuhner, M. K. & Felsenstein, J. (1994). A simulation comparison of phylogeny algorithms under equal and unequal evolutionary rates, Molecular Biology and Evolution, 11: 459-468.

Examples

## Not run: 
data("DataOrnithodirans")
DataOrnithodirans$treedino->treedino

## Case 1. change the topology and the branch lengths for the entire tree
swapONE(tree=treedino,si=0.5,si2=0.5,plot.swap=FALSE)

## Case 2. change the topology and the branch lengths of the
##         tree by keeping the monophyly of a specific clade
swapONE(tree=treedino,node=422,si=0.5,si2=0.5,plot.swap=FALSE)

## End(Not run)

RRphylo documentation built on June 7, 2023, 5:49 p.m.