BED to VCF flips ref/alt alleles for some loci

106 views
Skip to first unread message

Aarthi Mohan

unread,
May 28, 2024, 11:52:09 AM5/28/24
to plink2-users
Hi Chris,

I have converted SNParray VCFs -> BED -> merged BED -> converted back to multi-sample VCF 

For some of the records, I see that the ref and alt alleles are flipped in the VCF REF and ALT column even though the variant ID has the right order. I have checked the fasta for these handful of locations and the ref in the variant ID column is the right one. Any ideas why this is happening? 

1 784860 chr1:784860:T:C C T .
1 785910 chr1:785910:G:C G C .
1 788538 chr1:788538:G:A G A .
1 818725 chr1:818725:C:T C T .
1 819249 chr1:819249:A:G A G .
1 822354 chr1:822354:C:T T C .
1 837711 chr1:837711:C:T C T
.
1 837756 chr1:837756:G:T G T .
1 841171 chr1:841171:G:A A G .
1 843906 chr1:843906:C:A A C
.

Here are the steps I used: 
1. vcf -> bcftools norm -> bcf
2. bcf to BED using PLINK v2.00a6LM 64-bit Intel (16 May 2024)
plink2 --bcf /BQC2.snparray_norm.bcf.gz --set-all-var-ids chr@:#:$r:$a --new-id-max-allele-len 120 missing --memory 8000 require --threads 1 --make-bed  --allow-extra-chr --split-par hg38 --update-sex Clinical_Phenotype/BQC_sex_covid_uniq_records.tsv --out ancestry_snparray/BQC2.snparray
3. merge BED using (PLINK v1.90b7.2 64-bit (11 Dec 2023))
plink --merge-list  bqc_merge_list  --make-bed  --allow-extra-chr --memory 60000 --out merged/bqc_merged
4. BED to VCF using (PLINK v1.90b7.2 64-bit (11 Dec 2023))
plink --bfile merged/bqc_merged --allow-extra-chr --recode vcf-iid --out merged/bqc_merged_ecoded

Many thanks,
Aarthi

Christopher Chang

unread,
May 29, 2024, 1:59:36 AM5/29/24
to plink2-users
See the discussion at https://www.cog-genomics.org/plink/1.9/data#ax_allele .

You need to use e.g. plink2 --ref-from-fa or --ref-allele to restore REF/ALT allele order after the merge; plink 1.x normally does not preserve allele order.

Reply all
Reply to author
Forward
0 new messages