mcmc.target.seq: Find MCMC Target Sequence

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/mcmc.target.seq.R

Description

mcmc.target.seq uses MCMC to find a configuration of DNA positions to get as close as possible to a given tree.

boot.samples.idxs bootstraps over indices into a DNA matrix.

lookup.samples goes from an index representation of a configuration of DNA to the actual DNAbin format.

convert.table.to.idx converts a table of counts for positions 1..n into a list of indices corresponding to positions (i.e. goes from the tabled form to a vector whose tabling matches the input).

Usage

1
2
3
4
5
6
7

Arguments

data

A DNA matrix in DNAbin format.

x

A tree of class 'phylo' to estimate.

F

A tree estimation function, accepting a DNA matrix in DNAbin format and returning a tree of class 'phylo.'

n

The number of MCMC iterations to perform

B

The number of bootstrap replicates.

block

The block size to use during bootstrapping.

idxs

A list of numeric vectors of indices to use for lookup.

T

A table or table-like vector to convert.

Details

mcmc.target.seq performs an MCMC with simulated annealing to locate a configuration of DNA positions from the original matrix that gets as close as possible to a target tree. Propositions for the MCMC replacing one character with another uniformly at random.

The remaining functions are intended to be used as support functions.

Value

mcmc.target.seq returns a list of 4 elements: a numeric vector of counts of each position in the original matrix, the best estimated tree, the best distance from the estimated tree to the target tree, and a numeric vector of the distances for every iteration of the simulation.

boot.samples.idxs returns a numeric vector representing the bootstrapped idices.

lookup.samples returns a list of objects of class DNAbin corresponding to the DNA sequences generated from indices into the original DNA matrix.

convert.table.to.idx returns a numeric vector of indices based on the table counts.

Author(s)

John Chakerian <[email protected]>

References

Chakerian, J. and Holmes, S. P. Computational Tools for Evaluating Phylogenetic and Heirarchical Clustering Trees. arXiv:1006.1015v1.

See Also

dist.multiPhylo orthant.boundary.tree

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
data(woodmouse)
otree <- root(fastme.ols(dist.dna(woodmouse)), "No305", resolve.root=TRUE)
breps = 200

trees <- boot.phylo(otree, woodmouse, B=breps, function(x)
        root(fastme.ols(dist.dna(x)), "No305", resolve.root=TRUE),trees=TRUE)

combined.trees <- c(list(otree), trees$trees)

binning <- bin.multiPhylo(combined.trees)

tree.a <- combined.trees[[match(1, binning)]]
i = 2
max.bin = max(binning)
tree.b <- combined.trees[[match(2, binning)]]

while(length(distinct.edges(tree.a,tree.b)) > 1 && i < max.bin)
{
    i = i + 1
    tree.b = combined.trees[[match(i, binning)]]
}

bdy.tree <- orthant.boundary.tree(tree.a, tree.b)

f.est <- function(x) root(nj(dist.dna(x)), "No305", resolve.root=TRUE)

res <- mcmc.target.seq(woodmouse, bdy.tree, f.est, 1000)

par(mfrow=c(2,1))
plot(res$tree)
plot(res$vals)

distory documentation built on May 29, 2017, 10:19 p.m.