uqrmaie1 / admixtools

https://uqrmaie1.github.io/admixtools
71 stars 14 forks source link

$f4 missing from qpAdm #48

Closed ghost closed 11 months ago

ghost commented 11 months ago

Whenever I run qpAdm, the option to view f4 stats is missing; $weights, $popdrop, and $rankdrop are present, but $f4 just returns NULL.

uqrmaie1 commented 11 months ago

Currently the qpadm() function only returns f4-statistics when the first argument are precomputed f2-statistics, and not when the first argument is a genotype file prefix.

It would relatively straight-forward to return the f4-statistics that are used internally, but two things would be missing:

  1. The inferred f4-statistics from the fitted model.
  2. Any f4-statistics where the 1st and 3rd population are not the first left and the first right population.

If you are mostly interested in the subset of f4-statistics which are used internally, it would be easy to change the qpadm function so that it returns those, and it wouldn't slow it down. If you want the complete table of f4-statistics for all target+left and right populations (but without inferred fitted f4), the simplest thing would be to run f4(data, target, left, right, right). If you want the inferred fitted f4-statistics, I'll have to change a few more things in the qpadm function. It might also slow it down a bit, but maybe it's worth it.

Let me know which f4-statistics you want the qpadm function to return, and I see what I can do!