Haplotype matrix to genotype matrix
0
0
Entering edit mode
8.8 years ago
emmapead2 ▴ 60

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 • 2.9k views
ADD COMMENT
0
Entering edit mode

Isn't this post a duplicate Haplotype to Genotype data and linking to SNP?

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2440 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6