Allele swapping in haps file

49 views
Skip to first unread message

Katherine Fawcett

unread,
Feb 5, 2021, 10:36:18 AM2/5/21
to plink2-users
Hello,

I am trying to convert a vcf to a haps file using Plink2, but some alleles are swapped in the output.  I have tried using --ref-allele 'force' but it still changes them round.  I have also used several different versions of Plink2, including the latest.

Best wishes,

Kath

Christopher Chang

unread,
Feb 5, 2021, 10:59:20 AM2/5/21
to plink2-users
Can you please post a .log file and an example dataset so I can try to replicate what you're seeing?

Christopher Chang

unread,
Feb 5, 2021, 1:07:32 PM2/5/21
to plink2-users
Since you have provided neither a .log file nor a clarification of what you mean by "some alleles are swapped", I'm going to guess on behalf of future readers that you mean "ALL alleles are swapped" relative to the VCF.  From the --export documentation:

"For biallelic formats where it's unspecified whether the REF/major allele should appear first or second, --export defaults to second for compatibility with PLINK 1.9. Use the 'ref-first' modifier to change this."

The .haps format does not define whether REF should be first or second, so it's covered by this rule.  "--export haps ref-first" puts REF alleles first.
On Friday, February 5, 2021 at 7:36:18 AM UTC-8 Katherine Fawcett wrote:
Reply all
Reply to author
Forward
0 new messages