I'm trying to create a bim file of SNPs from a UKB bgen that exist in hapmap3. Here's my current code:
plink2 \
--sample $imputeddata/data_chr1.sample \
--bgen $imputeddata/imp_data_chr${1}_maf1_info4 \
--extract $resources/w_hm3.snplist \
--make-just-bim \
--out $projectdata/ukb_imp_hm3_chr${1}
I've been through https://www.cog-genomics.org/plink/2.0/input#oxford and tried a few things but am getting "Error: --sample must be used with --gen/--bgen/--data/--haps ... slurm_script: line 11: --bgen: command not found"
I originally didn't have the sample flag and got the error "--gen/--bgen cannot be used without --data or --sample."
I thought perhaps I need the --data flag as well. The website states that "--data normally causes the Oxford-format text genotype fileset prefix.gen + prefix.sample to be imported." but I don't understand this or what I need to specify. I tried --data ref-last but received "No --data REF/ALT mode specified ('ref-first', 'ref-last', or 'ref-unknown'). This will be required as of alpha 3. Error: --sample only accepts 1 parameter... line 12: --bgen: command not found"
I'm using PLINK v2.00a2LM 64-bit Intel (6 Oct 2019)
Thank you
I appear to have got it working...
Added ref-first/ref-last after the bgen file (here it's ref-first as it's UKB bgens; plink2 bgen to vcf ukbiobank)
Added .bgen suffix
I also reordered --bgen and --sample although I didn't think that should make a difference