Created
July 13, 2017 13:02
-
-
Save koelling/bb44162f4586a0f27433d0c60c650520 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
popA = 1 | |
popB = 2 | |
samplesA = [sample for sample in tree_sequence.get_samples() if tree_sequence.get_population(sample) == popA] | |
samplesB = [sample for sample in tree_sequence.get_samples() if tree_sequence.get_population(sample) == popB] | |
piA = tree_sequence.get_pairwise_diversity(samples = samplesA) | |
piB = tree_sequence.get_pairwise_diversity(samples = samplesB) | |
piAB = tree_sequence.get_pairwise_diversity(samples = samplesA + samplesB) | |
print(piA, piB, piAB) | |
#56465.569079715795 56413.38735640868 57020.29606185412 | |
pi_between = piAB | |
pi_within = piA | |
F_ST = (pi_between - pi_within) / pi_between | |
print(F_ST) | |
#0.009728588247535055 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment