Useful functions used in genetic analysis