I have an alignment between 3 species at the codon level and would like to calculate theta. The "ape" part is easy:
a <- read.FASTA("M715_870002501/aligned_nt.fasta"
methods(class = "haplotype")
 [.haplotype plot.haplotype print.haplotype sort.haplotype`
` Non-visible functions are asterisked
s <- length(seg.sites(a))
However, I am not sure how to import this DNAbin format into pegas for the
theta.s() function. The data function won't work:
In data(a) : data set \u2018a\u2019 not found
According to pegas docs, for theta.s:
This function computes the population parameter THETA using the number of segregating sites
s - in a sample of
n - DNA sequences.
theta.s(s, n, variance = FALSE)
s - a numeric giving the number of segregating sites.
n - a numeric giving the number of sequences.
variance - a logical indicating whether the variance of the estimated THETA should be
returned (TRUE), the default being FALSE.
Any ideas? I feel like solution is simple and I am missing it... do I just do theta.s(s, 3) ? Since there are 3 DNA sequences?