Learn R Programming

strataG (version 2.0.2)

sequenceLikelihoods: Sequence Likelihoods

Description

Calculate likelihood of each sequence based on gamma distribution of pairwise distances.

Usage

sequenceLikelihoods(x, model = "N", pairwise.deletion = FALSE, n = NULL,
  ...)

Arguments

x

a DNAbin object.

model

a character string specifying the evolutionary model to be used. Passed to dist.dna.

pairwise.deletion

a logical indicating whether to delete the sites with missing data in a pairwise way. Passed to dist.dna.

n

number of sequences with lowest delta(log-likelihoods) to plot. Defaults to all sequences Set to 0 to supress plotting.

...

arguments passed from other functions (ignored).

Value

vector of delta(log-Likelihoods) for each sequence, sorted from smallest to largest, and a plot of their distributions.

Details

Fits a Gamma distribution to the pairwise distances of sequences and calculates the log-likelihood for each (sum of all pairwise log-likelihoods for that sequence). Sequences that are extremely different from all others will have low log-likelihoods. Values returned as delta(log-likelhoods) = difference of log-likelihoods from maximum observed values.

Examples

Run this code
# NOT RUN {
library(ape)
data(dolph.haps)

sequenceLikelihoods(as.DNAbin(dolph.haps))

# }

Run the code above in your browser using DataLab