Skip to main content

variantgrid_api

PyPi version Python versions

Python API client for VariantGrid Open source Variant database and analysis platform

See changelog

Install

python3 -m pip install variantgrid_api

Example

from variantgrid_api.api_client import VariantGridAPI
from variantgrid_api.data_models import EnrichmentKit

api = VariantGridAPI(server="https://variantgrid.com", api_token="YOUR_API_TOKEN")
enrichment_kit = EnrichmentKit(name="idt_haem", version=1)
result = api.create_enrichment_kit(enrichment_kit)

Annotate a VCF and download it back

Upload a VCF, have VariantGrid import + annotate any novel variants, then download the cohort-level annotated export (all samples, single-sample VCFs included). Annotation can take a while, so the quickest way in is the vg_api command line tool: the first call uploads, and running the same command again downloads the result once it's ready.

$ export VARIANTGRID_API_TOKEN=YOUR_API_TOKEN
$ vg_api annotate_vcf input.vcf.gz -o results/
Uploaded input.vcf.gz (id=13256).
Annotating input.vcf.gz - run the same command again later to download.

$ vg_api annotate_vcf input.vcf.gz -o results/        # once it's done
Annotated vcf written to results/input.vcf_annotated_v254_GRCh38.vcf.gz

From Python it's upload_file() / poll_upload_status() / download_annotated(), or the blocking annotate_vcf() one-liner. See Annotate a VCF on the wiki for batches, the submit-now/download-later pattern, and all the options.

Testing

# Install required testing packages
python3 -m pip install -e ".[test]"
python3 -m pytest --cov=variantgrid_api

Download files

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

Source Distribution

variantgrid_api-1.4.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

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

variantgrid_api-1.4.0-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file variantgrid_api-1.4.0.tar.gz.

File metadata

  • Download URL: variantgrid_api-1.4.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for variantgrid_api-1.4.0.tar.gz
Algorithm Hash digest
SHA256 7dd306b055168c1c0b6739a9451bf241a6afef0a03f4c6149d317e8068464728
MD5 e34b92bd2ebe273105deb9b57c149a26
BLAKE2b-256 e37cb70af911905c1e6a0eb332c9ad2ad6757d829bce1d4fd7af0c3adf70ee30

See more details on using hashes here.

File details

Details for the file variantgrid_api-1.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for variantgrid_api-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70627df4004ff5ae0bb72ab19662b95d3561d7a99a7843816bbbc53ffdb0d80b
MD5 0d1061398454e159ae8c9a0e9661b842
BLAKE2b-256 6e5638d75d9e250df436e7d07b67998cada3c7e0e8fee6cb7a2cdbe7a15208da

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.1

2 files

1.0.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.5

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1

2 files

0.0.2

1 file

Supported by

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