This is a test version of Biostars. For the public version, visit https://www.biostars.org.
plink2 extract subset of samples from .bgen file

Hi Biostars,

I try to extract a subset of samples from a .bgen file using plink2. Output format should also be .bgen.
Searched the manpages without success. Can anybody help me?

snp software error

1 answer

plink2 \
  --bgen <.bgen filename> ref-last \
  --sample <.sample filename> \
  --keep <file with sample IDs to keep> \
  --export bgen-1.3 \
  --out <output filename prefix>

Note that this only preserves dosages, not genotype probabilities. If you care about preserving the raw probabilities in the .bgen file, you cannot use plink2.

Log in to answer this question.