How to calculate the sum of squared deviations for mismatch analysis in R?

I am new to R.

I am currently working on mitochondrial genetic sequences.

I did some neutrality tests like Tajima's D but have no idea how to get the sum of squared deviations (SSD) for mismatch analysis.

In literatures SSD is often obtained with Arlequin but I would like to get it with R.

SSD is often used in studies. Why hard to get?

Hi, and welcome!

Take a look at the pegas package which has an amova function (yes, with an m), which returns

a list with a table of sums of square deviations (SSD), mean square deviations (MSD), and the number of degrees of freedom, and a vector of variance components.

I'm not in your field, but recommend looking at this because the package describes itself

Description Functions for reading, writing, plotting, analysing, and manipulating allelic and haplotypic data, including from VCF files, and for the analysis of population nucleotide sequences and micro-satellites including coalescent analyses, linkage disequilibrium, population structure (Fst, Amova) and equilibrium (HWE), haplotype networks, minimum span- ning tree and network, and median-joining networks.

There's also an MMD, mismatch distribution function that

draws a histogram of the frequencies of pairwise distances from a set of DNA sequences.

Thank you for your advice.

The pegas package is really great and I often use it.

But the SSD I mean here is different from the SSD in AMOVA results.
What I want is SSD for each population not within samples, between samples or total.

An example of what I want is seen in the table 1 of this article
Dadi H, Lee SH, Jung KS, et al. Effect of Population Reduction on mtDNA Diversity and Demographic History of Korean Cattle Populations. Asian-Australas J Anim Sci . 2012;25(9):1223–1228. doi:10.5713/ajas.2012.12122

See the link below

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.