Skip to main content

Python wrapper around a BGEN library

Project description

cbgen

Python wrapper around a BGEN library. (cbgen documentation).

BGEN is a file format for storing large genetic datasets. It supports both unphased genotypes and phased haplotype data with variable ploidy and number of alleles. It was designed to provide a compact data representation without sacrificing variant access performance. This Python package is a wrapper around the bgen library, a low-memory footprint reader that efficiently reads bgen files. It fully supports the bgen format specifications: 1.2 and 1.3; as well as their optional compressed formats.

Installation

pip install cbgen

Usage example

>>> import cbgen
>>>
>>> bgen = cbgen.bgen_file(cbgen.example.get("haplotypes.bgen"))
>>> bgen.create_metafile("haplotypes.bgen.metafile")
>>> mf = cbgen.bgen_metafile("haplotypes.bgen.metafile")
>>> print(mf.npartitions)
1
>>> print(mf.nvariants)
4
>>> print(mf.partition_size)
4
>>> part = mf.read_partition(0)
>>> gt = bgen.read_genotype(part.variants.offset[0])
>>> print(gt.probability)
[[1. 0. 1. 0.]
 [0. 1. 1. 0.]
 [1. 0. 0. 1.]
 [0. 1. 0. 1.]]
>>> mf.close()
>>> bgen.close()

Authors

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cbgen-1.0.6.tar.gz (12.4 kB view details)

Uploaded Source

Built Distributions

cbgen-1.0.6-cp312-cp312-win_amd64.whl (319.7 kB view details)

Uploaded CPython 3.12 Windows x86-64

cbgen-1.0.6-cp312-cp312-musllinux_1_2_x86_64.whl (914.9 kB view details)

Uploaded CPython 3.12 musllinux: musl 1.2+ x86-64

cbgen-1.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (767.5 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

cbgen-1.0.6-cp312-cp312-macosx_14_0_arm64.whl (380.3 kB view details)

Uploaded CPython 3.12 macOS 14.0+ ARM64

cbgen-1.0.6-cp312-cp312-macosx_13_0_x86_64.whl (554.3 kB view details)

Uploaded CPython 3.12 macOS 13.0+ x86-64

cbgen-1.0.6-cp311-cp311-win_amd64.whl (243.9 kB view details)

Uploaded CPython 3.11 Windows x86-64

cbgen-1.0.6-cp311-cp311-musllinux_1_2_x86_64.whl (729.1 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.2+ x86-64

cbgen-1.0.6-cp311-cp311-musllinux_1_2_aarch64.whl (345.4 kB view details)

Uploaded CPython 3.11 musllinux: musl 1.2+ ARM64

cbgen-1.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (578.9 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

cbgen-1.0.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (180.6 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

cbgen-1.0.6-cp311-cp311-macosx_14_0_arm64.whl (289.0 kB view details)

Uploaded CPython 3.11 macOS 14.0+ ARM64

cbgen-1.0.6-cp311-cp311-macosx_13_0_x86_64.whl (419.5 kB view details)

Uploaded CPython 3.11 macOS 13.0+ x86-64

cbgen-1.0.6-cp310-cp310-win_amd64.whl (167.6 kB view details)

Uploaded CPython 3.10 Windows x86-64

cbgen-1.0.6-cp310-cp310-musllinux_1_2_x86_64.whl (543.9 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.2+ x86-64

cbgen-1.0.6-cp310-cp310-musllinux_1_2_aarch64.whl (345.4 kB view details)

Uploaded CPython 3.10 musllinux: musl 1.2+ ARM64

cbgen-1.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (391.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

cbgen-1.0.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (180.6 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

cbgen-1.0.6-cp310-cp310-macosx_14_0_arm64.whl (197.7 kB view details)

Uploaded CPython 3.10 macOS 14.0+ ARM64

cbgen-1.0.6-cp310-cp310-macosx_13_0_x86_64.whl (284.7 kB view details)

Uploaded CPython 3.10 macOS 13.0+ x86-64

cbgen-1.0.6-cp39-cp39-win_amd64.whl (91.2 kB view details)

Uploaded CPython 3.9 Windows x86-64

cbgen-1.0.6-cp39-cp39-musllinux_1_2_x86_64.whl (358.8 kB view details)

Uploaded CPython 3.9 musllinux: musl 1.2+ x86-64

cbgen-1.0.6-cp39-cp39-musllinux_1_2_aarch64.whl (345.4 kB view details)

Uploaded CPython 3.9 musllinux: musl 1.2+ ARM64

cbgen-1.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (203.1 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

cbgen-1.0.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (180.6 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

cbgen-1.0.6-cp39-cp39-macosx_14_0_arm64.whl (106.4 kB view details)

Uploaded CPython 3.9 macOS 14.0+ ARM64

cbgen-1.0.6-cp39-cp39-macosx_13_0_x86_64.whl (149.9 kB view details)

Uploaded CPython 3.9 macOS 13.0+ x86-64

File details

Details for the file cbgen-1.0.6.tar.gz.

File metadata

  • Download URL: cbgen-1.0.6.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for cbgen-1.0.6.tar.gz
Algorithm Hash digest
SHA256 edcf856c9b0cafae7f6e999ed5d08aacdf1e09dadec766b79990fe5861e8cf7e
MD5 22231b1341072c36edee151882958410
BLAKE2b-256 a097cc69e0d0accb46965332ae247f3289832e546f8d30cb77218d6eb0f47b48

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: cbgen-1.0.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 319.7 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for cbgen-1.0.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e56d6a01fb71d5c7fbf7039cc23089edd7a749fafb9f2898efffeacbd14a2bba
MD5 593281c1919ac861d6a4891438d3784f
BLAKE2b-256 eceb493f97d94704a5078770477d03924c6bd74c2d98d041d25848f4b735034d

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e1279d9881844018d27d6cd3ec8475e08d68136a1862c8eadf41745b373393d1
MD5 4172db58e1463e774635aa86587eab2d
BLAKE2b-256 a9246613c31e2346bd583ebbd4f32eccca4cd894364daf751ed0b632665013b3

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8e95a3b83d58343f5a7026dcee9dfce7ab9845406feb8b1c065151636b9fbefc
MD5 0cd0ee6aa3fc8d40d571b9fd850317b2
BLAKE2b-256 a5363e8550e6d05baea8eb2eae8c27887e81ea0085f8246d13e030d73f9f87fd

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 07d8d9209d24005f8f492b82f3793ac4ac8596263b07c5f68b7ab3e57eb0bc83
MD5 b8e85be897da989b59290987dc4534b2
BLAKE2b-256 c0157c42414b690d937ca6c4c75d08964e1e7bb19d9bb2fc06b5698ee18e53b8

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 e05037fabfd12711836b0cd26da961fc271b56080871e3508177c6c08b1247b1
MD5 c3a20122bc20058663f4542f2c77b9f9
BLAKE2b-256 09ce6abc744f0b17d24ce47fd177b81aafc0a8afe005439b18e57db6caa564f3

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: cbgen-1.0.6-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 243.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for cbgen-1.0.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 733a11d2eb2b06adf4ef0dd7675ce18e011c12df99e42fea93b3222efad5293b
MD5 1081d25cbceda0eb48ee20e7f72deb50
BLAKE2b-256 4084f0660542361cfe3a97e553d61e91d92bb26ea04a87cdd7d06522f1852dcf

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 fc40d9e917155125057adbad5477537a3974a7908080b60715449298f5c686d7
MD5 1422783133647c6bd0cd201ce06af4f6
BLAKE2b-256 c4bbfa9ed88dca04be210707e00bf329a337b78cbfc154c4cfa0250a7f589b0b

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp311-cp311-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp311-cp311-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 9beb0fe67968020344b47c0f5f648418202ead39b1cc599adc481a49daace99b
MD5 0f0f22808c8d99f65214b97e9b6686ea
BLAKE2b-256 b87b10cff399b0255d1426a1498aeb2eda7a94167a034fbd9f0bca5da2c66fdd

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9c04f5860e7c35296777af14b0749c3b0c0210825644ac98cae9f169822a40bd
MD5 86b045caaf16260b671017b7df53e8fa
BLAKE2b-256 1aaa7b37e68dda0f95b5fde96d20aab5163c61f35268914d4df110923953fbb4

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 85560c53ea769902e9516b86d6bd2f3e6718dcac8ce4c3d7c0ac9fb43863b19f
MD5 335391972d4b43f5be291aa16cc0ce43
BLAKE2b-256 adcc0a735cc723989189177d00a57937e44184b57ca42245570b0b8e86720d57

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 a0ddcaa25f19ea383931605d4627da06339662d0ef5bc07fda706d2592a11b31
MD5 5f4461d4db63ed9fa3088ae43922346e
BLAKE2b-256 8171260966997bdad39615e3430375fbca020ca103c1f601ec95f969e0b02296

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 b97ab995397d56fa007dfd4e3d01f0ee7bc02ee5685b4e174161615af6a1dad0
MD5 7ba1a47002f4eb9f6e52b5f79a4a907d
BLAKE2b-256 ff05360448e10fbe7bed04450d2e2f9df6c8ddfa6e86beb367e426eb6b06fb49

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: cbgen-1.0.6-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 167.6 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for cbgen-1.0.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 d4f599d86f35d219093e885c35efb74b64e9d0d8a5a6ff6f5e73d87f1e7eb158
MD5 c7b8585ad5aa098ba30f12ce846eee2e
BLAKE2b-256 e96a489bbf9b822572dc130ac10342314d5c05c88957cfef30a08d250700294a

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 de6da1a148478851ed50a6dca99c6e48d5cf1a98560eea1fbfceaaa42d7c7269
MD5 de63c9303a241694e7c1fcf1dafb4c03
BLAKE2b-256 6e383c6d281b4d14dc99e8536dbc3840e43884a4c2ec51853c471c165e849320

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp310-cp310-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp310-cp310-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e0b7a71d7bc7b0427b4e21e2d775a3700f122115c2617fbbe47436994e0f38cd
MD5 30fa743e488823b3fab2881f146f8818
BLAKE2b-256 a5327b3d8a0efe32b67833b491faafd9dfc895d0ccf66e3e55ba1d07218be06d

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 332852813515c293956640ac0fce95bb9a4813d37792981aca4ecca49c8a8b8b
MD5 42999037eae11448a8872e7df3bf1990
BLAKE2b-256 7c1f460de7436623ab3687f22bb03116d03bd5fbb34505a379853e210e50427d

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0fe460460c29af60f3b1b378683d9ae559f8986b3dd5cc23a030ce108f569ab0
MD5 f198a6c31cc8b1f08d4e8937325902b3
BLAKE2b-256 ec55b07aa26859e22982c823822fbd384d136bbeeec386c826d685e0d1acfe0f

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4d13799e89bbdc80cdb782c15592e3056381dfdeddd9b67fc21c6e5c96e52432
MD5 2c1eaa8edb094cc5a009d122ea38300e
BLAKE2b-256 5e490f9e0e73d9f4b3578b511af00857f4274219fc411a0433fa96f8aad91091

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 6175728aa6db4ef235f67b35e8a2d6cd7d73bd7f9595cca3e584a7c70d210984
MD5 a2afbf0c063bf1fd0de36d2ea00cb9ae
BLAKE2b-256 0cd90e8b194ff5c223eb85fa84f84eb215f578835b6cadbdd39940a0dc8c9a81

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: cbgen-1.0.6-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 91.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for cbgen-1.0.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 80526b425586272f5d5c721de3e7c6595f9f855e94b023bd5377d54667349fde
MD5 fd29cf2b5ef323a8c13f84734317c7a8
BLAKE2b-256 68861d5388c64fef248beed558fdba295596d1f16c5e0a6b2b0e37b00f8d56a7

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp39-cp39-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f2dfcad5b7432c62db50c8c2ebde9fe107720af87a613c3366f78550a9de3761
MD5 1c4a1a6d41a55e7f2ba4d65d84f05430
BLAKE2b-256 e0ee4cb92a53646970d0dea3ef007620176a89ff484a69745b9fbc22f20136d5

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp39-cp39-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp39-cp39-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 6b61998d7aaa1fe75162096a5b5bb3d2997bca7814290c4d75576396175dec16
MD5 43d16b69b06af64148b7d4390edd478d
BLAKE2b-256 07dc3ca8b3aa7cf18ab38e103db129763c171479f931fda734f9c302faafec78

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d26b6034e15a6c67c5b1d3caf127e2a79ed08bd90d23c8a157ff5652231acf0a
MD5 2b5cacbaa3c923a1cb341b8438a1371b
BLAKE2b-256 ae377c8c79b2913461fe3a81e6bff48a49a83592266065e47330da0ef70d016f

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7e2e3c9ed4461791e056efb17d8bbf9559f0ef68d90a3366f788ec69858e252f
MD5 af6461c97dbd33b732b02a17d9a50095
BLAKE2b-256 a9e0462f0cde8b72b5170c5d7e441325d0969be22e2fa249b1d2c04c56cc6637

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f4eb1f07398a37daaf40327de5e491ede311a933d26f6868e1f3d74982c5d569
MD5 dd90ad6d7a3f316b2843f9b569b247fa
BLAKE2b-256 b39bff50f251077b0972bd9a262ed9ae781b565d83adc799d6ce6bcd1ca28a05

See more details on using hashes here.

File details

Details for the file cbgen-1.0.6-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for cbgen-1.0.6-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 f32275bbd77c32a40129e0d37450de019f74fefecdd337217116d1a4cdf21713
MD5 2daa2acabee7b6c01d4945eb2f5e4e27
BLAKE2b-256 9ad4207566dd60778e5c868dc887bddc0cc20a9c4ebdb06bd451669d12064ef7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page