text: user14687: I have 10,000 controls and 3000 cases and the .bgen file has genotype of 200,000 individuals. I would like to extract only those individuals from the .bgen file that are either cases or controls using plink for downstream analyses. How can i do that?
  
  user12128: You can use qctool for this. If you create a list of IDs in list.txt (one ID per line), you can filter the .bgen file(s) by running
   qctool -g yourdata.bgen -s yourdata.sample -incl-samples list.txt -og yourdata_filtered.bgen
  
  
  
original_text: 14687: <p>I have 10,000 controls and 3000 cases and the .bgen file has genotype of 200,000 individuals. I would like to extract only those individuals from the .bgen file that are either cases or controls using plink for downstream analyses. How can i do that?</p>
   12128: <p>You can use <a href="https://www.well.ox.ac.uk/%7Egav/qctool_v2/" rel="nofollow noreferrer">qctool</a> for this. If you create a list of IDs in <code>list.txt</code> (one ID per line), you can filter the .bgen file(s) by running</p>
  <pre><code> qctool -g yourdata.bgen -s yourdata.sample -incl-samples list.txt -og yourdata_filtered.bgen
  
  </code></pre>
  