## GeneBe Utils
PyGeneBe: A Python client seamlessly integrating with the GeneBe platform, offering efficient annotation of genetic variants through its API, while supporting pandas, VCF file formats, and HGVS parsing
Using this client, you can easily annotate your DNA variants with the GeneBe API. Annotations include:
* Gene, transcript, and effect
* ClinVar phenotype
* GnomAD frequency
* ACMG score
* ... if you need more, please let me know
### Usage
For more information about the usage, go to the https://pygenebe.readthedocs.io/en/latest/ documentation.
#### Command line usage
Check current options using `--help` switch
```
genebe --help
genebe annotate --help
```
##### Annotating VCF using `annotate` command
GeneBe client allows you to annotate your VCF file with ease. Use the following command:
```
genebe annotate --input input.vcf.gz --output output.vcf.gz
```
Remember that your VCF file must be in a single allelic format! Utilize bcftools (https://samtools.github.io/bcftools/) to split the file. The output VCF will contain additional fields.
To use VCF annoation you have to have `cyvcf2` package installed. Take a look at the Installation section below.
If your VCF file is large (over 10.000 variants), you may encounter request limits. To avoid this, create a GeneBe account with an API Key and provide your login/key using the --username and --api-key arguments. You can always check your limits with the account command. Update your annotation command as follows:
```
genebe annotate --input input.vcf.gz --output output.vcf.gz --username your_username --api-key your_api_key
```
For more information call
```
genebe annotate --help
```
##### Using `account` command
The account command displays information about your request history statistics and limits. To check your limits without specifying a username and API key, run:
```
genebe account
```
Alternatively, if you have a GeneBe account with an API key, use the following command:
```
genebe account --username your_username --api-key your_api_key
```
Replace "your_username" and "your_api_key" with your GeneBe account credentials.
For more details and options, you can refer to the help documentation:
```
genebe account --help
```
#### Python usage
GeneBe makes annotating DNA variants in pandas dataframe easy.
```python
import genebe as gnb
import pandas as pd
input_variants = ['7-69599651-A-G']
# annotate variants with transcripts etc. output as a list; use .netrc for user login and api key
list = gnb.annotate(input_variants,
use_ensembl=True,
use_refseq=False,
genome="hg38",
batch_size=500,
use_netrc=True,
output_format="list")
# output as a pandas dataframe, flat
df = gnb.annotate(input_variants,
use_ensembl=True,
use_refseq=False,
genome="hg38",
flatten_consequences=True,
batch_size=500,
use_netrc=True,
output_format="dataframe")
# parse HGVS, SPDI or other
input_variants_parse = [
"chrX:153803771:1:A",
"22 28695868 AG A",
"22-28695869--G",
"22-28695869-G-",
"NM_000277.2:c.1A>G",
"NM_000277.2:c.2T>C",
"AGT M259T",
"rs1228544607"]
parsed_variants = gnb.parse_variants(input_variants_parse, genome="hg38")
# annotate existing dataframe, using it's chr, pos, ref, alt columns and adding new columns
df = pd.DataFrame({'chr': ['6', '22'], 'pos': [160585140, 28695868], 'ref': ['T', 'AG'], 'alt': ['G', 'A']})
annotated_df = gnb.annotate(df,
genome='hg38',
use_ensembl=False,
use_refseq=True,
flatten_consequences=True,
output_format="dataframe")
# lift over variants from hg19 to hg38
input_variants = ['chr6-161006172-T-G']
from_genome = "hg19"
dest_genome = "hg38"
lifted_variants = gnb.lift_over_variants(input_variants, from_genome, dest_genome)
```
If you want to annotate thousands of variants, please log in to https://genebe.net, generate an API Key, and provide it using `username` and `api_key` or using the `.netrc` file.
Find out more usage examples in the `examples` directory.
### Installation
You can install GeneBe Utils using pip:
```
pip install genebe
```
If you wish to install faster `mmh3` implementation or use the option of annotating vcf files install using:
```
pip install genebe[cpp]
```
or install modules
```
pip install cyvcf2
pip install mmh3
```
in the environment.
This step will require build tools installed on your computer.
### Docker
There is a dockerized version of this package, available at https://hub.docker.com/r/genebe/pygenebe .
Usage example, reading from file `input.vcf` and writing output to `stdout`:
```
docker run -v input.vcf:/tmp/input.vcf --rm genebe/pygenebe:0.0.14 genebe annotate --input /tmp/input.vcf --output /dev/stdout
```
### Limits
If you wish to annotate thousands of variants, please log in to https://genebe.net, generate an API Key, and provide it using username and api_key.
The number of daily requests from a single IP is restricted to prevent abuse and excessive resource consumption on our server. Account holders with an API Key enjoy significantly higher limits (in the tens of thousands). If you require a higher daily request limit, please reach out to us via the https://genebe.net .
### Troubleshooting and issues
Experiencing issues? Follow these steps:
1. Check Existing Issues:
* If you encounter problems, explore existing issues on GitHub https://github.com/pstawinski/pygenebe for possible solutions.
2. Report New Issues:
* Unable to find a resolution? You can report the problem by creating a new issue with a clear description and details on https://github.com/pstawinski/pygenebe.
Your feedback is crucial for improving GeneBe client. Thank you for contributing to the community!
### Other
For more information about GeneBe, visit GeneBe website, https://genebe.net .
Raw data
{
"_id": null,
"home_page": "https://github.com/pstawinski/pygenebe",
"name": "genebe",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Piotr Stawinski",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/85/0d/b3c7252c1959171e09363bc84d4ca3f3bebb4dcf2578ebfe657b11644c9d/genebe-0.1.15.tar.gz",
"platform": null,
"description": "## GeneBe Utils\nPyGeneBe: A Python client seamlessly integrating with the GeneBe platform, offering efficient annotation of genetic variants through its API, while supporting pandas, VCF file formats, and HGVS parsing\n\nUsing this client, you can easily annotate your DNA variants with the GeneBe API. Annotations include:\n* Gene, transcript, and effect\n* ClinVar phenotype\n* GnomAD frequency\n* ACMG score\n* ... if you need more, please let me know\n\n### Usage\n\nFor more information about the usage, go to the https://pygenebe.readthedocs.io/en/latest/ documentation.\n\n#### Command line usage\n\nCheck current options using `--help` switch\n\n```\ngenebe --help\ngenebe annotate --help\n```\n\n\n##### Annotating VCF using `annotate` command\nGeneBe client allows you to annotate your VCF file with ease. Use the following command:\n\n```\ngenebe annotate --input input.vcf.gz --output output.vcf.gz\n```\n\nRemember that your VCF file must be in a single allelic format! Utilize bcftools (https://samtools.github.io/bcftools/) to split the file. The output VCF will contain additional fields.\n\nTo use VCF annoation you have to have `cyvcf2` package installed. Take a look at the Installation section below.\n\nIf your VCF file is large (over 10.000 variants), you may encounter request limits. To avoid this, create a GeneBe account with an API Key and provide your login/key using the --username and --api-key arguments. You can always check your limits with the account command. Update your annotation command as follows:\n\n```\ngenebe annotate --input input.vcf.gz --output output.vcf.gz --username your_username --api-key your_api_key\n```\n\nFor more information call\n\n```\ngenebe annotate --help\n```\n\n##### Using `account` command\n\nThe account command displays information about your request history statistics and limits. To check your limits without specifying a username and API key, run:\n\n```\ngenebe account\n```\n\nAlternatively, if you have a GeneBe account with an API key, use the following command:\n\n```\ngenebe account --username your_username --api-key your_api_key\n```\n\nReplace \"your_username\" and \"your_api_key\" with your GeneBe account credentials.\n\nFor more details and options, you can refer to the help documentation:\n\n```\ngenebe account --help\n```\n\n\n\n#### Python usage\n\nGeneBe makes annotating DNA variants in pandas dataframe easy.\n\n```python\nimport genebe as gnb\nimport pandas as pd\n\ninput_variants = ['7-69599651-A-G']\n\n# annotate variants with transcripts etc. output as a list; use .netrc for user login and api key\nlist = gnb.annotate(input_variants,\nuse_ensembl=True,\n use_refseq=False,\n genome=\"hg38\",\n batch_size=500,\n use_netrc=True,\n output_format=\"list\")\n\n\n# output as a pandas dataframe, flat\ndf = gnb.annotate(input_variants,\n use_ensembl=True,\n use_refseq=False,\n genome=\"hg38\",\n flatten_consequences=True,\n batch_size=500,\n use_netrc=True,\n output_format=\"dataframe\")\n\n\n# parse HGVS, SPDI or other\ninput_variants_parse = [\n \"chrX:153803771:1:A\",\n \"22 28695868 AG A\",\n \"22-28695869--G\",\n \"22-28695869-G-\",\n \"NM_000277.2:c.1A>G\",\n \"NM_000277.2:c.2T>C\",\n \"AGT M259T\",\n \"rs1228544607\"]\nparsed_variants = gnb.parse_variants(input_variants_parse, genome=\"hg38\")\n\n# annotate existing dataframe, using it's chr, pos, ref, alt columns and adding new columns\ndf = pd.DataFrame({'chr': ['6', '22'], 'pos': [160585140, 28695868], 'ref': ['T', 'AG'], 'alt': ['G', 'A']})\nannotated_df = gnb.annotate(df,\n genome='hg38',\n use_ensembl=False,\n use_refseq=True,\n flatten_consequences=True,\n output_format=\"dataframe\")\n\n\n# lift over variants from hg19 to hg38\ninput_variants = ['chr6-161006172-T-G']\nfrom_genome = \"hg19\"\ndest_genome = \"hg38\"\nlifted_variants = gnb.lift_over_variants(input_variants, from_genome, dest_genome)\n\n\n```\n\nIf you want to annotate thousands of variants, please log in to https://genebe.net, generate an API Key, and provide it using `username` and `api_key` or using the `.netrc` file.\n\nFind out more usage examples in the `examples` directory.\n\n### Installation\nYou can install GeneBe Utils using pip:\n\n```\npip install genebe\n```\n\nIf you wish to install faster `mmh3` implementation or use the option of annotating vcf files install using:\n\n```\npip install genebe[cpp]\n```\n\nor install modules\n\n```\npip install cyvcf2\npip install mmh3\n```\n\nin the environment.\n\nThis step will require build tools installed on your computer.\n\n### Docker\nThere is a dockerized version of this package, available at https://hub.docker.com/r/genebe/pygenebe .\n\nUsage example, reading from file `input.vcf` and writing output to `stdout`:\n```\ndocker run -v input.vcf:/tmp/input.vcf --rm genebe/pygenebe:0.0.14 genebe annotate --input /tmp/input.vcf --output /dev/stdout\n```\n\n### Limits\nIf you wish to annotate thousands of variants, please log in to https://genebe.net, generate an API Key, and provide it using username and api_key.\n\nThe number of daily requests from a single IP is restricted to prevent abuse and excessive resource consumption on our server. Account holders with an API Key enjoy significantly higher limits (in the tens of thousands). If you require a higher daily request limit, please reach out to us via the https://genebe.net .\n\n### Troubleshooting and issues\nExperiencing issues? Follow these steps:\n\n1. Check Existing Issues:\n\n* If you encounter problems, explore existing issues on GitHub https://github.com/pstawinski/pygenebe for possible solutions.\n\n2. Report New Issues:\n\n* Unable to find a resolution? You can report the problem by creating a new issue with a clear description and details on https://github.com/pstawinski/pygenebe.\n\nYour feedback is crucial for improving GeneBe client. Thank you for contributing to the community!\n\n### Other\n\nFor more information about GeneBe, visit GeneBe website, https://genebe.net .\n\n\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "GeneBe Client: A user-friendly system for annotating genetic variants",
"version": "0.1.15",
"project_urls": {
"Homepage": "https://github.com/pstawinski/pygenebe"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6cbd253aea64abc7047f08bad19538a3a8367e7ac0485d2beb2be2d21b268bb8",
"md5": "493440756c8f2b1ec2354273ec684b60",
"sha256": "18f20dde8313cd7b14991f6fbbb443be67e135f654ce991eade145b19ccf4f99"
},
"downloads": -1,
"filename": "genebe-0.1.15-py3-none-any.whl",
"has_sig": false,
"md5_digest": "493440756c8f2b1ec2354273ec684b60",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 19019,
"upload_time": "2024-08-31T16:43:34",
"upload_time_iso_8601": "2024-08-31T16:43:34.381022Z",
"url": "https://files.pythonhosted.org/packages/6c/bd/253aea64abc7047f08bad19538a3a8367e7ac0485d2beb2be2d21b268bb8/genebe-0.1.15-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "850db3c7252c1959171e09363bc84d4ca3f3bebb4dcf2578ebfe657b11644c9d",
"md5": "433ffa3c70c38d636cf75448ec3085f1",
"sha256": "c39870312f75c979efa5b880d6459da6f124ca244d1ff367209eb4bb3b9880a9"
},
"downloads": -1,
"filename": "genebe-0.1.15.tar.gz",
"has_sig": false,
"md5_digest": "433ffa3c70c38d636cf75448ec3085f1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 2971059,
"upload_time": "2024-08-31T16:43:38",
"upload_time_iso_8601": "2024-08-31T16:43:38.788207Z",
"url": "https://files.pythonhosted.org/packages/85/0d/b3c7252c1959171e09363bc84d4ca3f3bebb4dcf2578ebfe657b11644c9d/genebe-0.1.15.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-31 16:43:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pstawinski",
"github_project": "pygenebe",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "genebe"
}