Apparently, this can do it: https://vcf-kit.readthedocs.io/en/latest/tajima/
Hi all,
I'm trying to calculate Tajima's D with vcftools parameter --TajimaD 5000 and I wonder whether there is another parameter that allows to calculate it in sliding windows. I've seen that there is something similar to calculate pi (--window-pi and --window-pi-step) and fst (--fst-window-size and --fst-window-step).
Any help will be appreciated, thanks in advance!
2 answers
Hey again,
it looks like vcf-kit is more straightforward for calculating Tajima's D value in sliding windows! To be honest, I haven't been really able to make PopGenome function, but vcf-kit is quite easy:
vk tajima 5000 3000 input.vcf > output.TajimaD
5000 refers to the window size and 3000 the step size of the sliding window.
I am not aware of a way to do this; however, you could simply run --TajimaD multiple times with varying bin size and then find some way to provide a summary function. For example, if you converted your outputs to BED format, you could likely then use BEDTools to summarise the data into a single output. This is experimental, of course.
Thanks a lot, Kevin! I'm working on VCF-kit (I'm having trouble with the installation) and I've also found an R package called PopGenome that calculates several population genomics statistics in sliding windows... Let's see which of both is better ;)
Okay, good luck. Please report back which works best!
Log in to answer this question.