Hello,
I am new to plink and am learning as I go.
I am trying to calculate an LD matrix for a list of variants while using a bgen file as my reference population. See the command below:
./plink2/plink2 --r2 bin --bgen ukb_imp_chr1_v3_qc2.bgen --ld-snp-list rsids --ld-window-r2 0.8 --out samplesnp_ld
PLINK v2.00a3LM 64-bit Intel (4 Aug 2021) www.cog-genomics.org/plink/2.0/
(C) 2005-2021 Shaun Purcell, Christopher Chang GNU General Public License v3
Logging to samplesnp_ld.log.
Options in effect:
--bgen ukb_imp_chr1_v3_qc2.bgen
--ld-snp-list rsids
--ld-window-r2 0.8
--out samplesnp_ld
--r2 bin
Start time: Sat Aug 7 15:40:36 2021
Error: --bgen now requires a REF/ALT mode ('ref-first', 'ref-last', or
'ref-unknown'). As of this writing, raw UK Biobank files are ref-first, while
older and PLINK-exported BGEN files are more likely to be ref-last.
For more info, try "plink2 --help <flag name>" or "plink2 --help | more".
I am wondering if anyone might know how to deal with this problem. I have not found any posts where this was an error. I have only seen this being a warning see: plink2 bgen to vcf ukbiobank
Is it possible to flip the variants and create a copy bgen file for this to work. Or is this file format irreconcilable with the latest version of plink2?
Apologies- please see the updated version of my command:
Ultimately I am trying to do LD clumping on a list of variants contained in the
rsids
file. This seems much more intuitive with plink1.9:Only to find 1.9 does not really seem to work for this task...
Could you give a hint as to how to perform LD clumping on bgen files?
Yes, --r2 isn't implemented yet in plink 2.0, sorry about the inconvenience. However, you can use plink 2.0 --make-bed to create a fileset readable by plink 1.9, and then use plink 1.9 --r2; that's more efficient than following the advice in the 1.9 error message (though the error-message advice would also work).