I don't think this is correct. If you're trying to get the data into VCF, 0 is used to denote the reference base, 1 the first alternative and 2 the second alternative. You will want to in some way detect what the reference is, then assign the values to the genotype based on which allele it is. The numbers are not usually arbitrarily assigned, as is suggested here.
Note that I don't know how to do what you're asking, but I am fairly sure that this answer is incorrect.