Description Usage Arguments Value Author(s) See Also Examples
Likelihood of an alignment given a tree model
1 | likelihood.msa(x, tm, features = NULL, by.column = FALSE)
|
x |
An object of class |
tm |
An object of class |
features |
A features object. If non-null, compute likelihoods for each feature rather than the whole alignment. |
by.column |
Logical value. If |
Either the log likelihood of the entire alignment (if
by.column==FALSE && is.null(features)
,
or a numeric vector giving the log likelihood of each feature
(if !is.null(features)
), or a numeric vector giving the
log likelihood of each column (if by.column==TRUE
).
Melissa J. Hubisz and Adam Siepel
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | files <- c("rev.mod", "ENr334-100k.maf", "ENr334-100k.fa", "small.gff")
exampleArchive <- system.file("extdata", "examples.zip", package="rphast")
unzip(exampleArchive, files)
msa <- read.msa("ENr334-100k.fa")
mod <- read.tm("rev.mod")
likelihood.msa(msa, mod)
like1 <- likelihood.msa(msa, mod, by.column=TRUE)
length(like1)==ncol.msa(msa)
sum(like1)
msa <- read.msa("ENr334-100k.maf")
likelihood.msa(msa, mod)
like2 <- likelihood.msa(msa, mod, by.column=TRUE)
sum(like2)
mod$subst.mod <- "JC69"
likelihood.msa(msa, mod)
#'
# can also get likelihood by feature
features <- read.feat("small.gff")
features$seqname <- names(msa)[1]
likelihood.msa(msa, mod, features=features)
unlink(files)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.