Tajima's D is the difference of two population genetics measures, the average number of pairwise differences and the total number of segregating sites (bases where these differences occur). This is scaled to be behaving such that this would be the same as in a neutrally evolving population of constant size.
The equation is as follows:
where 0t is the number of pairwise differences and 0w is the number of segregating sites.
To install locally:
python setup.py install
or via pip:
pip install tajima
tajima -F fasta_file
and to perform alignment using MUSCLE (if the FASTA is not of equal length):
tajima -F fasta_file -M