phyloP.prior: phyloP prior

Description Usage Arguments Value Examples

View source: R/phyloP.R

Description

Prior distribution on number of substitutions

Usage

1
2
3
phyloP.prior(mod, nsites = 100, subtree = NULL, branches = NULL,
  outfile = NULL, outfile.only = FALSE, quantiles = FALSE,
  epsilon = 1e-10)

Arguments

mod

An object of class tm representing the neutral model.

nsites

The number of sites in the alignment

subtree

Character string specifying the name of a node in the tree. If given, partition the tree into the subtree beneath the node and the complementary supertree, and compute joint number of substitutions in the sub/supertree. The branch above the specified node is included in the subtree.

branches

A vector of character strings givingi the names of branches to consider in the subtree. The remaininig branches are in the supertree. Return joint distribution of number of substitutions in sub/supertree.

outfile

Character string. If given, write results to given file.

outfile.only

Logical. If TRUE, do not return any results to R (this may be useful if results are very large).

quantiles

Logical. If TRUE, report quantiles of distribution rather than whole distribution.

epsilon

Numeric value indicating the thhreshold used in truncating tails of distributions; tail probabilities less than this value are discarded. This only applies to the right tail.

Value

A data.frame. If quantiles=FALSE, the columns will be the number of substitutions and their probability under the null model. If quantiles=TRUE, there will be 101 rows with the 0, 0.05, ..., 1.0th quantile.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
exampleArchive <- system.file("extdata", "examples.zip", package="rphast")
unzip(exampleArchive, "rev.mod")
tm <- read.tm("rev.mod")
t1 <- phyloP.prior(tm, nsites=10)
t2 <- phyloP.prior(tm, nsites=20)
t3 <- phyloP.prior(tm, nsites=20, quantiles=TRUE)
t4 <- phyloP.prior(tm, nsites=20, epsilon=1e-20)
plot(t1$nsub, t1$prior)
points(t2$nsub, t2$prior, col="red")
unlink("rev.mod")

rphast documentation built on May 1, 2019, 9:26 p.m.