{"id":21433551,"url":"https://github.com/limix/cbgen","last_synced_at":"2025-07-14T13:31:17.708Z","repository":{"id":42571490,"uuid":"287176170","full_name":"limix/cbgen","owner":"limix","description":"Python wrapper around bgen C library.","archived":false,"fork":false,"pushed_at":"2024-06-17T15:21:48.000Z","size":588,"stargazers_count":1,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-07T18:58:11.537Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/limix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-08-13T03:56:04.000Z","updated_at":"2024-06-17T15:11:15.000Z","dependencies_parsed_at":"2023-11-09T00:31:19.956Z","dependency_job_id":"3ae02d57-bb15-4368-9bbd-1861aa78b4c4","html_url":"https://github.com/limix/cbgen","commit_stats":{"total_commits":114,"total_committers":1,"mean_commits":114.0,"dds":0.0,"last_synced_commit":"6e8600a781c9e6e2a0079297f5e8bc9382061deb"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fcbgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fcbgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fcbgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/limix%2Fcbgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/limix","download_url":"https://codeload.github.com/limix/cbgen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225980902,"owners_count":17554919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T23:28:46.040Z","updated_at":"2024-11-22T23:28:46.556Z","avatar_url":"https://github.com/limix.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cbgen\n\nPython wrapper around a BGEN library.\n([cbgen documentation](https://cbgen.readthedocs.io)).\n\n[BGEN](https://www.well.ox.ac.uk/~gav/bgen_format/) is a file format for\nstoring large genetic datasets. It supports both unphased genotypes and phased\nhaplotype data with variable ploidy and number of alleles. It was designed to\nprovide a compact data representation without sacrificing variant access\nperformance. This Python package is a wrapper around the [bgen\nlibrary](https://github.com/limix/bgen), a low-memory footprint reader that\nefficiently reads bgen files. It fully supports the bgen format specifications:\n1.2 and 1.3; as well as their optional compressed formats.\n\n## Installation\n\n```bash\npip install cbgen\n```\n\n## Usage example\n\n```python\n\u003e\u003e\u003e import cbgen\n\u003e\u003e\u003e\n\u003e\u003e\u003e bgen = cbgen.bgen_file(cbgen.example.get(\"haplotypes.bgen\"))\n\u003e\u003e\u003e bgen.create_metafile(\"haplotypes.bgen.metafile\")\n\u003e\u003e\u003e mf = cbgen.bgen_metafile(\"haplotypes.bgen.metafile\")\n\u003e\u003e\u003e print(mf.npartitions)\n1\n\u003e\u003e\u003e print(mf.nvariants)\n4\n\u003e\u003e\u003e print(mf.partition_size)\n4\n\u003e\u003e\u003e part = mf.read_partition(0)\n\u003e\u003e\u003e gt = bgen.read_genotype(part.variants.offset[0])\n\u003e\u003e\u003e print(gt.probability)\n[[1. 0. 1. 0.]\n [0. 1. 1. 0.]\n [1. 0. 0. 1.]\n [0. 1. 0. 1.]]\n\u003e\u003e\u003e mf.close()\n\u003e\u003e\u003e bgen.close()\n```\n\n## Authors\n\n* [Carl Kadie](https://github.com/CarlKCarlK)\n* [Danilo Horta](https://github.com/horta)\n\n## License\n\nThis project is licensed under the [MIT License](https://raw.githubusercontent.com/limix/cbgen/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimix%2Fcbgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flimix%2Fcbgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimix%2Fcbgen/lists"}