millanek / Dsuite

Fast calculation of Patterson's D (ABBA-BABA) and the f4-ratio statistics across many populations/species
160 stars 26 forks source link

Forcing particular combinations #101

Closed elizeng closed 1 month ago

elizeng commented 2 months ago

I have specific permutations that I am interested in testing for introgression.

Context: I have 12 populations: N1-4, S1-8

I am interested in testing for introgression for the specific permutations where P1 and P2 comprise of N1-4, and P3 of S1-8.

Using Dtrios, I get scenarios where the S population is assigned to P1 and while N populations are in P2 and P3, for which the statistical values cannot be easily converted. Example: Permutation I get with Dtrios: P1 P2 P3 S1 N1 N2

Permutation that I am interested in P1 P2 P3 N2 N1 S1

The ouput from Dtrios for the former permutation: Dstatistic Z-score p-value f4-ratio BBAA ABBA BABA 0.033719 16.5261 2.30E-16 0.141038 102944 101308 94698.7

Given that D stats is minimized for each trio, would other combinations then be significant for introgression?

I have also tried using the tree function, but it seems that I would require a tree comprising all populations rather than making a simple tree for P1, P2, P3, O. I do not have a tree for all populations at the moment.

Would appreciate any suggestion for whether it is possible to set up the analysis for specific permutations.

Cheers!

elizeng commented 1 month ago

Managed to get all permutations I wanted by specifying a tree: (((N1,N2,N3,N4),(S1,S2,S3,S4,S5,S6,S7,S8)),Outgroup)