Phylogeographic GoogleEarth plot

Share:

Description

Given the output of an MCMC run, outputs phylogeographic code to show migration on a map through GoogleEarth.

Usage

1
BPEC.GeoTree(MCMCout,CoordsLocs,file="GoogleEarthTree.kml")

Arguments

MCMCout

R object from BPEC.MCMC run

CoordsLocs

A matrix where each row shows latitude, longitude (plus any additional covariates), plus all the haplotype numbers found at each location.

file

Filename for the .kml file to be created

Details

Additionally to the output variables, a .kml file is created which can be loaded into GoogleEarth.

Value

Phy

Set of nodes and branches that can be loaded into Phylo2GE()

Geo

Set of haplotypes and locations that can be loaded into Phylo2GE()

Author(s)

Axel Hille

References

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.

N. Arrigo, L.P. Albert, P.G. Mickelson and M.S. Barker (2012). Quantitative visualization of biological data in Google Earth using R2G2, an R CRAN package. Molecular Ecology Resources, 12(6), 1177-1179.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
#to use example dataset:
data(MacrocnemisRawSeqs)
data(MacrocnemisCoordsLocs)
CoordsLocs = MacrocnemisCoordsLocs
RawSeqs = MacrocnemisRawSeqs

##to use your own dataset
#RawSeqs = read.nexus.data('Haplotypes.nex')
#CoordsLocs = read.table(
# 'CoordsLocsFile.txt',header=FALSE,fill=TRUE,col.names=1:max(count.fields('CoordsLocsFile.txt'))
#  )
## to set phenotypic/environmental covariate names, 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: 
MCMCout = BPEC.MCMC(RawSeqs,CoordsLocs,MaxMig=2,iter=50,ds=0,PostSamples=5,dims=8)
BPEC.Geo = BPEC.GeoTree(MCMCout,CoordsLocs,file="GoogleEarthTree.kml")

## End(Not run)