Population genetics and ecology