Hi  all,

I have SNP data set: the first column is the ID and the the
subsequent pair of columns are the alleles for each
SNP1, SNP2 and So on. Each SNP has two columns.  Based on the alleles
I want make phenotype

if the alleles  are 1 1        then  genotype is 0
                  2 2        then  genotype is 1
and if it is          1 2 or 2 1 then  genotyep is 3

This is a sample data set but the actual has 13,000 SNP(26,000columns)


Geno data
AB95 1 1 2 2 2 2 2 2 1 1
AB82 2 2 2 2 2 2 2 2 2 2
AB95 2 1 2 2 2 2 2 2 1 1
AB59 1 1 2 2 1 2 1 2 1 2
AB32 2 1 2 2 2 2 2 2 1 2
AB46 2 1 2 2 1 2 1 1 2 2
AB61 1 1 2 2 1 2 1 2 1 2
AB32 2 2 1 2 2 2 2 2 1 2
AB35 2 2 1 2 2 2 2 2 2 2
AB43 2 2 1 2 2 2 2 2 2 2

Desired output
AB95  0   1   1   1   0
AB82  1   1   1   1   1
AB95  3   1   1   1   0
AB59  0   1   3   3   3
AB32  3   1   1   1   3
AB46  3   1   3   0   1
AB61  0   1   3   3   3
AB32  1   3   1   1   3
AB35  1   3   1   1   1
AB43  1   3   1   1   1

I would appreciate if you help me out here.
Thank you in advance

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to