Skip to main content

GeneBe Client: A user-friendly system for annotating genetic variants

Project description

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

Please use GeneBe java client for VCF annotation. VCF support in Python was not reliable.

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.

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 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:
  1. Report New Issues:

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 .

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

genebe-0.2.6.tar.gz (3.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

genebe-0.2.6-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file genebe-0.2.6.tar.gz.

File metadata

  • Download URL: genebe-0.2.6.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for genebe-0.2.6.tar.gz
Algorithm Hash digest
SHA256 e8bd0a5944d5582de4689d9808ad96e16e6ed907dcb6272af1b9939b52099ff1
MD5 131e64647c370979e41a65bbd37b522e
BLAKE2b-256 9c73b027b428b3b29dc1413e531e5b616abec2acf0da2c7e7d0810a7ae031288

See more details on using hashes here.

File details

Details for the file genebe-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: genebe-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for genebe-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 111cae81b149c3dfb511a96ca57af55fb657f26b7f27685ba2a842c88a9fb4ab
MD5 7586bd8d384a3acca779a413cbfe6be3
BLAKE2b-256 1fefb9d268d486364c1c75a8359bb2075905094fec5af2b8c8a7d4cb73eedb12

See more details on using hashes here.

Supported by

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