Useful functions used in geneticanalysis