I have a phased VCF file and I need to change the alleles of the SNPs so that the alleles coded as 0 represent the ancestral state while the alleles coded as 1 represent the derived state.

I got a list of ancestral and derive states for my SNPs in my VCF file and I want to change them using PLINK. 

If I have a list of ancestral alleles in a file `ancestral_snps.txt` , if I use the following command will I get the wanted output?

`plink --vcf myvcf.vcf --a1-allele ancestral_snps.txt --recode vcf --out myvcfancestral.vcf`

Or is it `--allele-a2` ?

I assume that this change won't affect the phasing of my data, right? As I basically only recoded the alleles.

**EDIT:**

Following Christopher Chang's comment:

If my `ancestral_snps.txt` file looks like this, specifying which allele is ancestral:

     C rs1001
     G rs1002
     A rs1003

If I use this command in `PLINK2`, will the ancestral alleles be coded as 0 in my phased VCF?

 `./plink2 --vcf myvcf.vcf --ref-allele force 1 2 ancestral_snps.txt --recode vcf --out myvcfancestral.vcf`

- If you want to preserve phase information, you'll need plink 2.0; this is impossible in 1.9 due to the limitations of the core file format.

- "--ref-allele force ancestral_snps.txt" should work.  Depending on the layout of the ancestral_snps file, you might need to specify some column numbers too; "plink2 --help ref-allele" provides usage details.