This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Haplotype matrix to genotype matrix

Hello!

So I have a matrix like so

   SNP
Allele  C/G    A/C    C/G
1       0      1      1
2       0      0      1
3       0      1      0

of snps in alleles (1,2,3,ect...I have 20) and then a file of samples containing the haplotypes (eg. sample A has haplotype 1 and 2) and want to convert this to a genotype matrix for genetic association. Does anyone know how I could do this? So I would have a matrix like

   SNP
Sample    C/G    A/C    C/G
A         0      1      1
B         0      0      1
C         0      2      0

Where 2 would be heterozygous etc

Would really appreciate the help, been stuck on this for days!

snp haplotype r gene sequence

Yes it is, I reworded the question and posted again as I thought this post would be clearer.

Seems a bit specific, a Perl/Python script could probably do this easily.

0 answers

No answers yet.

Log in to answer this question.