Entering edit mode
3.1 years ago
garyzhubc
•
0
How to retrieve the list of rsid from .bgen file? Is there a simple way in linux to browse .bgen file?
How to retrieve the list of rsid from .bgen file? Is there a simple way in linux to browse .bgen file?
If you have Python available, you can use the "bgen-reader" library (via "pip install bgen-reader")
from bgen_reader
with open_bgen("haplotypes.bgen", verbose=False) as bgen:
print(bgen.rsids)
Output:
['RS1' 'RS2' 'RS3' 'RS4']
See https://bgen-reader.readthedocs.io/en/latest/quickstart2.html
(I'm a contributor to bgen-reader)
Carl Kadie, Ph.D.
(Microsoft Research, retired)
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
@carlk: Welcome to Biostars! Please add links (e.g. linkedin) to your biostars profile. Do not include these links in your comments/answers.
I think you missed "import open_bgen" in the first line of the codes.