bpec.treePlot: Treeplot indicating cluster membership

Description Usage Arguments Details Value Author(s) References Examples

View source: R/bpec.treePlot.R

Description

Given a set of haplotype nodes in a tree structure, creates a haplotype tree plot, starting from the root at the top. The size of each haplotype node represents the number of times it was sampled, and color represents population cluster. Unsampled haplotypes are represented by black dots. Thickness of tree edges represents posterior certainty, with thinner edges corresponding to higher uncertainty.

Usage

1
bpec.treePlot(bpecout,colorCode=c(7,5,6,3,2,8,4,9))

Arguments

bpecout

R object from bpec.mcmc run.

colorCode

A vector of color codes to use, ideally the same ones used in bpec.ContourPlot.

Details

The algorithm will try to plot the tree such that branches don't cross. The label which will be shown correspond to the original labels provided by the user. In cases where 2 sequences (with different labels) were collapsed to the same haplotype, the smallest (in number) of the two labels will be shown.

Value

graphEdgesSub

Set of nodes and branch that can be loaded into plot.igraph().

graphEdgesTree

Phylogenetic tree representation that can be plotted directly using plot().

Author(s)

Ioanna Manolopoulou & Axel Hille

References

I. Manolopoulou, A. Hille, B.C.Emerson B (2020). BPEC: An R Package for Bayesian Phylogeographic and Ecological Clustering. Journal of Statistical Software, 92(3), 1-32. doi: 10.18637/jss.v092.i03

G. Csardi, T. Nepusz (2006). The igraph software package for complex network research. InterJournal, Complex Systems, 1695(5), 1-9.

I. Manolopoulou and B.C. Emerson (2012). Phylogeographic ancestral inference using the coalescent model on haplotype trees. Journal of Computational Biology, 19(6), 745-755.

G. Valiente (2009). Combinational Pattern Matching Algorithms in Computational Biology Using Perl and R. CRC Press.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#to use example dataset:
data(MacrocnemisRawSeqs)
data(MacrocnemisCoordsLocs)
coordsLocs <- MacrocnemisCoordsLocs
rawSeqs <- MacrocnemisRawSeqs

##to use your own dataset 
#rawSeqs <- bpec.loadSeq('haplotypes.nex')
#coordsLocs <- bpec.loadCoords("coordsLocsFile.txt")

## to set phenotypic/environmental covariate names manually, use (as appropriate)
# colnames(coordsLocs)[1:dims] <- c('lat','long','cov1','cov2','cov3')   
## where dims is the corresponding number of measurements available 
## (2 for latitude and longitude only, add one for each additional available measurement) 

#to run the MCMC sampler: 

bpecout <- bpec.mcmc(rawSeqs, coordsLocs, maxMig = 2, iter = 50, ds = 0, postSamples = 1, dims = 8)
bpec.Tree <- bpec.treePlot(bpecout)

BPEC documentation built on March 2, 2020, 1:07 a.m.