The scientific study of the principles of heredity and the variation of inherited traits among related organisms.