added default parameter ploidy=2 to indexToGenotype