Learn R Programming

phangorn

phangorn is a package for phylogenetic reconstruction and analysis in the R language. phangorn offers the possibility of reconstructing phylogenies with distance based methods, maximum parsimony or maximum likelihood (ML) and performing Hadamard conjugation. Extending the general ML framework, this package provides the possibility of estimating mixture and partition models. Furthermore, phangorn offers several functions for comparing trees, phylogenetic models or splits, simulating character data and performing congruence analyses.

To get an introduction into phylogenetic inference you want to look at:

vignette("Trees", package="phangorn")

Installation

You can install the the latest release phangorn of the package from CRAN, or the development version from github or r-universe.

TypeSourceCommand
ReleaseCRANinstall.packages("phangorn")
DevelopmentGitHubremotes::install_github("KlausVigo/phangorn")
Developmentr-universeinstall.packages('phangorn', repos = 'https://klausvigo.r-universe.dev')

To install the development version you may need to install the Biostrings package from bioconductor first:

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("Biostrings")

To use all functionality you might install all you might need to install the rgl and ggseqlogo package.

install.packages("rgl")
install.packages("ggseqlogo")

The development version usually depends on the latest ape development version and information to download can be found here.

Citation

If you use phangorn please cite:

Schliep K.P. 2011. phangorn: phylogenetic analysis in R. Bioinformatics, 27(4) 592-593

License

phangorn is licensed under the GPLv2.

Copy Link

Version

Install

install.packages('phangorn')

Monthly Downloads

18,827

Version

2.12.1

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

September 17th, 2024

Functions in phangorn (2.12.1)

ancestral.pml

Ancestral character reconstruction.
densiTree

Plots a densiTree.
as.networx

Conversion among phylogenetic network objects
delta.score

Computes the \(\delta\) score
phyDat

Conversion among Sequence Formats
identify.networx

Identify splits in a network
image.phyDat

Plot of a Sequence Alignment
designTree

Compute a design matrix or non-negative LS
codonTest

codonTest
coalSpeciesTree

Species Tree
dist.p

Pairwise Polymorphism P-Distances from DNA Sequences
ldfactorial

Arithmetic Operators
cophenetic.networx

Pairwise Distances from a Phylogenetic Network
consensusNet

Computes a consensusNetwork from a list of trees Computes a networx object from a collection of splits.
cladePar

Utility function to plot.phylo
discrete.gamma

Discrete Gamma and Beta distribution
dist.hamming

Pairwise Distances from Sequences
chloroplast

Chloroplast alignment
latag2n.phyDat

Replace leading and trailing alignment gaps with an ambiguous state
lento

Lento plot
threshStateC

Internal phangorn Functions
distanceHadamard

Distance Hadamard
getRoot

Tree manipulation
mites

Morphological characters of Mites (Schäffer et al. 2010)
getClans

Clans, slices and clips
mast

Maximum agreement subtree
phangorn-package

phangorn: Phylogenetic Reconstruction and Analysis
baseFreq

Summaries of alignments
dna2codon

Translate nucleic acid sequences into codons
hadamard

Hadamard Matrices and Fast Hadamard Multiplication
bootstrap.pml

Bootstrap
gap_as_state

Treat gaps as a state
nni

Tree rearrangements.
acctran

Parsimony tree.
plot.networx

plot phylogenetic networks
pml.control

Auxiliary for Controlling Fitting
simSeq

Simulate sequences.
splitsNetwork

Phylogenetic Network
read.phyDat

Import and export sequence alignments
plot.pml

Plot phylogeny of a pml object
lli

Internal maximum likelihood functions.
neighborNet

Computes a neighborNet from a distance matrix
pmlCluster

Stochastic Partitioning
maxCladeCred

Maximum clade credibility tree
modelTest

ModelTest
superTree

Super Tree methods
pmlMix

Phylogenetic mixture model
print.phyDat

Generic functions for class phyDat
reexports

Objects exported from other packages
plotAnc

Plot ancestral character on a tree
transferBootstrap

Transfer Bootstrap
upgma

UPGMA, WPGMA and sUPGMA
multiphyDat2pmlPart

Partition model.
treedist

Distances between trees
write.ancestral

Export and convenience functions for ancestral reconstructions
pml_bb

Likelihood of a tree.
write.pml

Export pml objects
plotBS

Plotting trees with bootstrap values
read.nexus.splits

Function to import and export splits and networks
read.nexus.partitions

Function to import partitioned data from nexus files
writeDist

Writing and reading distances in phylip and nexus format
as.pml

Likelihood of a tree.
yeast

Yeast alignment (Rokas et al.)
add.tips

Add tips to a tree
CI

Consistency Index and Retention Index
SOWH.test

Swofford-Olsen-Waddell-Hillis Test
add_ci

Draw Confidences Intervals on Phylogenies
NJ

Neighbor-Joining
bab

Branch and bound for finding all most parsimonious trees
Laurasiatherian

Laurasiatherian data (AWCMEE)
allTrees

Compute all trees topologies.
SH.test

Shimodaira-Hasegawa Test
add_edge_length

Assign and compute edge lengths from a sample of trees
addConfidences

Compare splits and add support values to an object
Ancestors

tree utility function
allSplits

Splits representation of graphs and trees.