signaturescience / skater

SKATE R Utilities
https://signaturescience.github.io/skater/
Other
9 stars 5 forks source link

New function to infer degree from kinship coefficient #16

Closed stephenturner closed 3 years ago

stephenturner commented 3 years ago

Need a function to take kinship coefficient and infer degree. See inference criteria from Manichaikul 2010, which is used by nearly everyone regardless of method they're using:

image

I've got some code laying around somewhere that does this down to whatever degree you want. I'll modify and put it here.

stephenturner commented 3 years ago

🐢

stephenturner commented 3 years ago

This is the culprit 🤦 🐢

https://github.com/signaturescience/skater/blob/ad89f9a6506c63343f119a20c766d69b1f07d3d8/R/utils.R#L70

This is a ~7000X speed up 🚀 🐇

https://github.com/signaturescience/skater/blob/aa97d9b2bd33077e20ccef3fd79de9aaeaa302c0/R/utils.R#L75

vpnagraj commented 3 years ago

base::findInterval() ?! cool.