variantgrid_api
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, wait for VariantGrid to import + annotate any novel variants, then download the cohort-level annotated export (all samples, single-sample VCFs included). The whole flow is a one-liner:
from variantgrid_api.api_client import VariantGridAPI
api = VariantGridAPI(server="https://variantgrid.com", api_token="YOUR_API_TOKEN")
# export_type is "vcf" (gzipped *.vcf.gz) or "csv" (zipped *.csv.zip)
path = api.annotate_vcf("input.vcf", export_type="vcf", dest_path="/data/results/")
print(f"Annotated VCF written to {path}")
There's also a vg_api annotate_vcf command line tool (first call uploads, run it again to download once
ready), a step-by-step form (upload_file → wait_for_annotation → download_annotated), and a "submit now,
download later" pattern for long-running jobs. See
Annotate a VCF on the wiki.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file variantgrid_api-1.3.1.tar.gz.
File metadata
- Download URL: variantgrid_api-1.3.1.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eec18014e3cbc03aab8896110a98d688541cbc15f0a0e7b2b788eb566f60114c
|
|
| MD5 |
75fe0f9935b99e5ef40905aefbcfc3b2
|
|
| BLAKE2b-256 |
4587676b60bd67dbabac77627e503cf7eff60537dcf6cf6ef150ca2d35690834
|
File details
Details for the file variantgrid_api-1.3.1-py3-none-any.whl.
File metadata
- Download URL: variantgrid_api-1.3.1-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6688942bcf919030caadceb1d8b81f4fd5d0c3348d489e1a4e3309bf0e4e0b7
|
|
| MD5 |
beb7f1e7c3ad2faeb754a4a8103b3507
|
|
| BLAKE2b-256 |
c61dc9b7cea67de69ce871541cb2d029f2ce54fefb8e5300881fcfe12724eaf8
|