API Beginner Guide
This guide provides instructions on using the Curate API to create, update, and search for variants and genes, and on exporting Curate data to a CSV.
Last updated
Was this helpful?
This guide provides instructions on using the Curate API to create, update, and search for variants and genes, and on exporting Curate data to a CSV.
Last updated
Was this helpful?
Operations from the Emedgene Curate's graphical user interface (GUI) can also be performed by using the Emedgene Curate's API.
Following are some basic examples of how to use Emedgene Curate's API with Python.
For instructions on using the API with other programming languages, please refer to their respective documentation.
An installed copy of Python ()
The Python package installer, pip ()
The requests library installed (run pip install requests
)
Each API call requires the user to have the corresponding role. See for more information.
In order to perform a secure session with Emedgene's API servers you should first accomplish the authentication phase and retrieve the bearer token. To accomplish this, follow the Authentication steps .
The different API commands can be found at https://<hostname>.emedgene.com/api/kms/apidoc/swagger or https://<hostname>.emg.illumina.com/api/kms/apidoc/swagger
It is useful to explore possible APIs and get an overview of the available parameters.
To create a new variant, send a POST
request with the required variant details.
Request Example (Python):
Response Fields:
The API response includes multiple fields, but the key values needed for future updates are:
id
: The unique identifier of the variant.
variant_interpretation_ids
: A list of interpretation IDs associated with the variant.
These fields are required for updating the variant later.
To retrieve variant details by chromosome position, send a GET
request.
Request Example (Python):
To modify a variant, use the PATCH
method with the variant ID and interpretation ID retrieved from the creation response.
Request Example (Python):
To delete a variant, use the DELETE
method with the variant ID from the response of the create, update, or search API responses.
New genes can only be created using a valid HGNC ID.
Request Example (Python):
Response Fields:
The API response contains multiple fields, but the key ones required for future updates are:
id
: The unique identifier of the gene.
gene_interpretations
: A list of interpretation IDs associated with the gene.
To retrieve gene details by HGNC ID, send a GET
request.
Request Example (Python):
It is also possible to search by NCBI ID in the same way as searching by HGNC ID.
To modify a gene, use the PATCH
method with the gene ID and interpretation ID retrieved from the creation or search response.
Request Example (Python):
In order to export all curated variants or genes as a CSV file, use the following API endpoints:
Variants Export: /api/kms/export/v1/export/variants
Genes Export: /api/kms/export/v1/export/genes
Each request returns a pre-signed URL, which can be used to download the exported file directly from a browser. Since its generation, the URL is valid for 12 hours.
Note: The export is updated every 24 hours, so any changes made in Curate will be reflected in the following day's export.
Request Example (Python):
Response Structure:
It's possible to download the file by pasting the response URL in the browser.
The variant CSV will provide the following fields:
Variant Type
Pathogenicity
Chromosome
Position
End
REF
ALT
Interpretation
Notes
Diseases (OMIM ID)
Overlap %
The gene CSV will provide the following fields:
Gene Name
Group Type
Chromosome (37)
Start (37)
End (37)
Chromosome (38)
Start (38)
End (38)
NCBI ID
HGNC ID
Strand
Locus type
Interpretation
Note
Transcript reference sequence
Created epoch
Replace <hostname>
with the correct API server hostname.
Replace <your-auth-token>
with a valid authentication token.
Ensure IDs used in update requests match those received from the initial response.
The examples in the API Reference page use curl (Client URL), while Python uses requests. To convert from curl to Python follow the converstion steps .