grenedalf icon indicating copy to clipboard operation
grenedalf copied to clipboard

CMH tests?

Open joannarifkin opened this issue 10 months ago • 3 comments

Hi there!

Thanks for developing the package - it seems great.

I may have missed this in the documentation, in which case I apologize, but is there a way to do CMH tests, as popoolation2 does? We have three biological replicates of the same phenomenon and pools for each, and would like to be able to do one. I could, of course, probably just use the popoolation2 script, but thought I'd check.

Thanks again!

Joanna

joannarifkin avatar Jan 29 '25 18:01 joannarifkin

Hi Joanna,

thanks for your interest in grenedalf!

Unfortunately, at the moment, the CMH test is not implemented in grenedalf. It has been on my list for a while though, but I've moved fields a bit, and so am not working full time on grenedalf at the moment. It seems that CMH is in principle not too complicated to implement, but the code in PoPoolation2 (here) seems rather confusing, so not sure how long it will take me to port this into grenedalf.

Let's keep this issue open as a reminder for me. In the meantime, if PoPoolation2's implementation works for you, please use that for now. If not, and you encounter issues with it, let me know, so that I might increase my priority for this!

Cheers and so long Lucas

lczech avatar Jan 31 '25 11:01 lczech

Hi Lucas,

Using a CMH test from PoPoolation2 seems to work fine with the sync file generated from grenedalf once I removed the header row. (I also removed missing data but I don't think that was necessary.) I've reproduced my code below in case other people want to use it.

grep -v "\.\:\." sync.sync > no_missing_sync.sync 
grep -v "#" no_missing_sync.sync > no_missing_no_header_sync.sync 

perl cmh-test.pl --input no_missing_no_header_sync.sync --output cmh_test_20250205 --min-coverage 30 --max-coverage 200 --population 1-2,3-4,5-6 

If you want to make any upgrades, you might actually want to consider implementing a LRT-1 test instead (https://doi.org/10.1534/genetics.118.301824, https://doi.org/10.1186/s13059-019-1770-8) because as far as I can tell there's no easily accessible software to do one. But I totally understand the challenge of keeping up with old projects after you move on.

Thanks again for this excellent package!

Joanna

joannarifkin avatar Feb 05 '25 19:02 joannarifkin

Hi Joanna,

thanks for the update and the inspiration for the LRT, I'll have a look at that.

As for your commands to remove the sync extensions that PoPoolation2 does not understand: There are actually options to do that already, see here :-)

Cheers Lucas

lczech avatar Feb 05 '25 19:02 lczech