Skip to main content

Python client library for the Dnaerys genome variant store

Project description

PyPI version Python versions License Documentation

Dnaerys Python Client

Python client library for Dnaerys, a high-performance distributed genome variant database. Dnaerys stores indexed variant and sample data for large cohorts and serves queries with millisecond latency, including VEP annotations, allele frequencies, and pathogenicity predictions. This library wraps the gRPC API into Pythonic methods with streaming iteration, pagination, and frozen dataclass results. It is designed for bioinformaticians and data scientists working with cohort-scale genomic data.

Full documentation: dnaerys-python.readthedocs.io

Requirements

Python 3.12 or later.

Installation

pip install dnaerys
pip install dnaerys[pandas]   # for to_dataframe() support

Quick Start

from dnaerys import (
    DnaerysClient, Region, AnnotationFilter, Consequence, Impact,
)

tp53 = Region("chr17", 7661779, 7687546)

with DnaerysClient("db.dnaerys.org:443") as client:
    ann = AnnotationFilter(
        impact=[Impact.HIGH, Impact.MODERATE],
        consequence=[Consequence.MISSENSE_VARIANT],
        clin_significance=["PATHOGENIC", "LIKELY_PATHOGENIC"],
    )

    stream = client.select_variants(
        region=tp53,
        annotations=ann,
        limit=10,
    )

    for variant in stream:
        print(variant)

    # Check response metadata
    print(f"Elapsed: {stream.metadata.elapsed_ms}ms")

Features

  • Streaming iteration — variant results arrive as lazy iterators with constant memory usage.
  • Paginationpaginate_* methods serve fixed-size pages with transparent buffer refills.
  • Annotation filtering — filter by VEP annotations, AF, CADD, AlphaMissense, PolyPhen, SIFT, ClinVar significance, and more.
  • Inheritance queries — detect de novo, heterozygous dominant, and homozygous recessive variants across trios.
  • Kinship analysis — KING-based kinship estimation for cohorts, duos, trios, and external samples.
  • Frozen dataclasses — all result types are immutable, slotted, and hashable; safe to cache, copy, and use as dict keys.
  • Clean exception hierarchy — gRPC status codes map to specific exception classes with is_retryable flags.
  • pandas integration — call to_dataframe() on any variant stream to get a DataFrame.

Documentation

Full documentation including API reference, pagination guide, annotation filter reference, and connection options is available at dnaerys-python.readthedocs.io. The API reference covers all 27 public methods on DnaerysClient.

License

Apache License 2.0 — see LICENSE for details.

Contributing

Contributions are welcome. Please open an issue to discuss proposed changes before submitting a pull request. Bug reports and feature requests can be filed at github.com/dnaerys/dnaerys-python/issues.

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

dnaerys-0.2.0.tar.gz (90.0 kB view details)

Uploaded Source

Built Distribution

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

dnaerys-0.2.0-py3-none-any.whl (63.0 kB view details)

Uploaded Python 3

File details

Details for the file dnaerys-0.2.0.tar.gz.

File metadata

  • Download URL: dnaerys-0.2.0.tar.gz
  • Upload date:
  • Size: 90.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dnaerys-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8287b7f5bbbd16012544a33102124743a19f3ebd691c240f5dd9470322bb06b0
MD5 e51a258f98fabd59108d011aec7bab7c
BLAKE2b-256 85072dac98f76aff62cb39e780ea5df1ab7c40814723d42a6d4eee380051dcd9

See more details on using hashes here.

File details

Details for the file dnaerys-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: dnaerys-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 63.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dnaerys-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2d2ce7dd0ad1eb54f5ca7ae616bdaed5dc8dce40c7b6a5e23ff449449c8aab1
MD5 03f5f90d79924ae340cf17d2d689f687
BLAKE2b-256 6674365595df1885c554c99129725ad14b90a1ca926012e3fe28bbfada7bb834

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