This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merge bgen,bgen.bgi,and .sample file from uk biobank

I have a list of files from UKbiobank imputed data. And I wonder how can I merge 22 chromosome data. Each chromosome has their own data looks like below:

ukb_imp_chr1_v3.bgen 
ukb_imp_chr1_v3.bgen.bgi 
ukb41999_imp_chr1_v3_s487296.sample

I tried to use plink2 but I don't see options that can read bgen.bgi.

plink2 \
 --bgen *imp*.bgen ref-first \
 --sample *imp*.sample \
 --pmerge-list list_bgen_imp.txt \
 --make-pgen --out ukb_imp_allChrs

I thought the index file(bgi) is important but don't know how to involved in my code...

plink2 ukbiobank ukbb

1 answer

  1. The .bgi index files are useful for finding specific variants within a .bgen file. However, there is no need to read the .bgi when you're converting an entire .bgen. (Which is pretty much the only thing plink2 ever does with .bgen files, so it does not currently have a flag for specifying a .bgi.)
  2. You probably have to run --pmerge-list separately, after you are done converting all the .bgen files.

Log in to answer this question.