I have performed an analysis that yields the probability that a diploid DNA sequence is inherited from species A (genotype = AA), inherited from species B (genotype = BB) or one copy from each species is inherited (genotype = AB). The analysis yields three vectors of probabilities ranging from 0 to 1. I'll paste the header below so you can see what the output data look like. I need to convert these probabilities into an assignment of 0, 1, or 2, where 0 = AA, 1 = AB, and 2 = BB.
Can anyone suggest a strategy that uses unix or R tools to convert the genotype probabilities to genotypes that uses all three columns of information? I have to convert 19 files of these into genotypes.
snp probAncestry(1,1) probAncestry(1,2) probAncestry(2,2) S1_11928 0.98880 0.01117 0.00003 S1_28339 0.99042 0.00956 0.00002 S1_30258 0.99061 0.00937 0.00002 S1_37984 0.99138 0.00860 0.00002 S1_38081 0.99139 0.00860 0.00002 S1_39977 0.99157 0.00841 0.00002 S1_39988 0.99157 0.00841 0.00002
edit: clarified example data as output