postprob.msa: Obtain posterior probilities of every state at every node

Description Usage Arguments Value Author(s) Examples

View source: R/msa.R

Description

Obtain posterior probilities of every state at every node

Usage

1
postprob.msa(x, tm, every.site = FALSE)

Arguments

x

An object of type msa

tm

An object of type tm

every.site

If TRUE, return probabilities for every site rather than every site pattern (this may be very redundant and large for a large alignment with few species).

Value

An array giving the posterior probabilities of all states for every unique site pattern, or for every site if every.site is TRUE

Author(s)

Melissa J. Hubisz and Adam Siepel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
exampleArchive <- system.file("extdata", "examples.zip", package="rphast")
unzip(exampleArchive, "ENr334-100k.maf")
m <- read.msa("ENr334-100k.maf")
mod <- phyloFit(m, tree="((hg18,(mm9,rn4)),canFam2)")
x <- postprob.msa(sub.msa(m, start.col=41447839, end.col=41448033,
                          refseq="hg18"), mod)
dim(x)
dimnames(x)
x[,,"CCCC"]

# now get postprobs for every site
x <- postprob.msa(sub.msa(m, start.col=41447839, end.col=41448033,
                          refseq="hg18"), mod, every.site=TRUE)
unlink("ENr334-100k.maf")

Example output

Extracting sufficient statistics ...
Compacting sufficient statistics ...
Fitting tree model to alignment using REV ...
numpar = 11
Done.  log(likelihood) = -238483.838344 numeval=334
[1]  3  4 40
[[1]]
[1] "hg18-canFam2" "hg18-mm9"     "mm9-rn4"     

[[2]]
[1] "A" "C" "G" "T"

[[3]]
 [1] "CCTT" "CCCC" "--TT" "--T-" "--A-" "--C-" "--G-" "TTTT" "GGCC" "TGTT"
[11] "TTTC" "GGTC" "TTTG" "GG--" "CC--" "GGGG" "GAAA" "AAAA" "TTCT" "TTCC"
[21] "CTTT" "TTAA" "TATT" "AACC" "--AA" "--GG" "GCGG" "GGAA" "CCAA" "GAGG"
[31] "TTGG" "-G--" "-C--" "-A--" "GCAA" "GATT" "AATT" "CCCT" "AATC" "AACT"

                        A         C            G            T
hg18-canFam2 4.486038e-04 0.9938363 3.923823e-04 0.0053227459
hg18-mm9     6.121704e-05 0.9980161 5.356951e-05 0.0018691266
mm9-rn4      1.152963e-05 0.9995841 9.971208e-06 0.0003943768

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