Measuring genetic diversity in ecological studies