X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2FDNA.R;h=72e12582617e0927bdc5d9a2a884d5784b6c46fb;hb=dca7b216e929337836a18374147b13eb793ffd95;hp=919f0ecd88912e69ff85b2ee04181d122936eb7b;hpb=8883719a9139685f26d4c0c4cb26872d5f6d0d96;p=ape.git diff --git a/R/DNA.R b/R/DNA.R index 919f0ec..72e1258 100644 --- a/R/DNA.R +++ b/R/DNA.R @@ -1,4 +1,4 @@ -## DNA.R (2009-09-06) +## DNA.R (2009-09-18) ## Manipulations and Comparisons of DNA Sequences @@ -286,21 +286,6 @@ seg.sites <- function(x) which(as.logical(ans[[4]])) } -nuc.div <- function(x, variance = FALSE, pairwise.deletion = FALSE) -{ - if (pairwise.deletion && variance) - warning("cannot compute the variance of nucleotidic diversity\nwith pairwise deletion: try 'pairwise.deletion = FALSE' instead.") - if (is.list(x)) x <- as.matrix(x) - n <- dim(x)[1] - ans <- sum(dist.dna(x, "raw", pairwise.deletion = pairwise.deletion))/ - (n*(n - 1)/2) - if (variance) { - var <- (n + 1)*ans/(3*(n + 1)*dim(x)[2]) + 2*(n^2 + n + 3)*ans/(9*n*(n - 1)) - ans <- c(ans, var) - } - ans -} - dist.dna <- function(x, model = "K80", variance = FALSE, gamma = FALSE, pairwise.deletion = FALSE, base.freq = NULL, as.matrix = FALSE)