Entering edit mode
5.6 years ago
kristopherfernandez
▴
10
Given a pandas data frame where (I'm new to this so I'm not even sure how to represent this here):
Name SNP1 SNP2 SNP3 SNP4
Allele1 A C T G
Allele2 C T G A
Allele3 C G A A
How do I create all the combinations of alleles (possible genotypes): Allele1/Allele1, Allele1/Allele2, Allele1/Allele3, Allele2/Allele2, Allele2/Allele3, Allele3/Allele3, like so:
Name SNP1 SNP2 SNP3 SNP4
Allele1/1 AA CC TT GG
Allele1/2 AC CT TG GA
Allele1/3 AC CG TA GA
Allele2/2 CC TT GG AA
Allele2/3 CC TG GA AA
Allele3/3 CC GG AA AA
See Method to get all possible combinations of genotypes for a group of SNPs