DNAmodel {ape} | R Documentation |
This function defines a model of evolution for a set of DNA sequences with possible partitions.
DNAmodel(model = "K80", part.model = 1, ncat = 1, part.gamma = 1, invar = FALSE, part.invar = 1)
model |
a vector of mode character giving the substition model
for each partition (must be of the same length than
unique(part.model) ). |
part.model |
a vector of integers defining the partitions for the substition models (eventually recycled). |
ncat |
the number of categories in each partition defined by
part.gamma (must be of the same length than
unique(part.gamma) ). |
part.gamma |
a vector of integers defining the partitions for the inter-sites variation in substitution parameters (eventually recycled). |
invar |
a vector of logical values specifying whether there are
invariants in each partition defined by part.invar (must be
of the same length than unique(part.invar) ). |
part.invar |
a vector of integers defining the partitions for the proportion of invariants (eventually recycled). |
The six arguments of this function work in pairs: model
defines
the substitution model for each partition defined by
part.model
. The latter is recycled along the sequence: thus by
default there is a single partition. For instance, to partition a
sequence of 1000 sites into two partitions of equal length, one will
use part.model = c(rep(1, 500), rep(2, 500))
. The partitions
must be numbered with a series of integers (1, 2, 3, ...). To
partition the codon positions, one could do part.model = c(1, 1,
2)
.
There must be as many models than partitions, but the former may be
the same. For instance, model = c("K80", "K80")
means that
partitions 1 and 2 evolve under Kimura's model but its parameters will
be estimated separately in each partition. In addition, branch lengths
are the same in all partitions up to a multiplying coefficient (the
contrast parameter, denoted 'xi').
The substitution models must be among the followings: "JC69"
"K80"
, "F81"
, "F84"
, "HKY85"
,
"T92"
, "TN93"
, and "GTR"
. These models (except
HKY85 and GTR) are described in the help page of dist.dna
.
The two other pairs of functions work in the same way. This decoupling allows one to share some parameters accross partitions (see examples).
an object of class "DNAmodel"
with components defined by the
arguments of the function call.
The result of this function is not intended to be used by the user,
but rather to be passed to mlphylo
.
Emmanuel Paradis Emmanuel.Paradis@mpl.ird.fr
### the homogeneous K80 model: mod <- DNAmodel() ### the simplest substitution model: mod <- DNAmodel("JC69") ### the classical GTR + G4 + I: mod <- DNAmodel("GTR", ncat = 4, invar = TRUE) ### assuming K80 for the two first codon-positions, and ### JC69 for the third position: mod <- DNAmodel(c("K80", "JC69"), part.model = c(1, 1, 2)) ### the same but adding inter-sites variation (the alpha parameter ### is the same for both partitions): mod <- DNAmodel(c("K80", "JC69"), part.model = c(1, 1, 2), ncat = 4) ### Only the alpha parameter of ISV is different between the ### partitions (K80 is assumed with equal Ts/Tv): mod <- DNAmodel(ncat = c(4, 4), part.gamma = c(1, 1, 2)) ### A much more complete model resulting in three ### overall partitions: mod <- DNAmodel(c("K80", "K80"), part.model = c(rep(1, 600), rep(2, 200)), ncat = c(4, 4), part.gamma = c(rep(1, 200), rep(2, 600)))