How to delete a variant with API in Emedgene Curate
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
Since v38 of the Emedgene platform, deleting a variant in Curate is a self-serve functionality. It requires the use of the API in a browser page that lets a user send the request to delete the variant.
Instructions on the use of API in Emedgene and Curate can be found here and here, respectively.
In order to delete a variant in Curate, a user first needs to use one of two python scripts provided in the documentation to create a Bearer Token - it will be used to log in to the API page. Here, the script using credentials as the log in method will be used.
Install python3 programming language, as well as a library called "requests" (this can be done in the console terminal with pip install requests
).
Adequate permissions must be given in Admin Console. For instance, the Curate variant deletion requires a role with the scope "kms_delete_variant".
In the following script, replace your-domain, your-email and your-password by the organisation and login credentials. Save the script with the .py file extension, eg, 'emg_credentials_script.py'.
import requests
route_login_platform = 'https://your-domain.emg.illumina.com/api/auth/v2/api_login/'
payload = {"username": 'your-email', "password": 'your-password'}
response = requests.post(route_login_platform, json=payload)
access_token = response.json().get('access_token')
token_type = response.json().get('token_type')
print(f'{token_type.capitalize()} {access_token}')
In the console terminal, run the script with python3 emg_credentials_script.py, and copy the string of characters after "Bearer", excluding the space.
Navigate to the Swagger API page in a browser: https://your-domain.emg.illumina.com/api/kms/apidoc/swagger
Select the button "Authorize" in the upper right corner, and paste the Bearer Token, then select "Authorize".
Once done, scroll down to the "Delete variant from Curate" option and select it. Select "try it out" and delete the "roles" field (it should be empty).
In "variant_id", copy the number from the variant to be deleted from Curate. This ID can be found in the curate URL, for example in https://your-domain.emg.illumina.com/kms/v1/#/variants/1133871/1133848?ref=GRCh38, 1133871 is the variant_id. Select "Execute" to delete the variant.
For any feedback or questions regarding this article (Illumina Knowledge Article #9725), contact Illumina Technical Support [email protected].