Question: How to make combinations of genotypes given an allele dataframe?
0
gravatar for kristopherfernandez
13 months ago by
kristopherfernandez10 wrote:

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
matrix dataframe pandas python • 406 views
ADD COMMENTlink written 13 months ago by kristopherfernandez10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1893 users visited in the last hour