Generating a karyotype