Compute snp density.