LogoLogo
Illumina KnowledgeIllumina SupportSign In
  • Home
  • Get Started with Emedgene
    • Get started with Emedgene
    • How can Emedgene help you solve a case?
  • Emedgene analyze manual
    • Getting around the platform
      • Top navigation panel
      • Emedgene Applications menu
      • Dashboard
      • Settings
      • User roles
      • Help
      • Okta identity management
    • Managing data storage
      • Manage data storages
      • Manage Azure Blob data storage
      • Manage S3 credentials
      • Manage BaseSpace storage
      • Manage GCS storage (V37.0+)
      • Bring Your Own Bucket
      • Bring Your Own Key
    • Cases tab
      • Cases tab
      • Cases table
      • Case status
      • Browse and select cases
      • Case details
    • Creating a single case
      • Add a new case
      • Select sample type
      • Create a family tree
      • Family tree legend
      • Add a sample
      • Supported Variant callers
      • Adding patient info for the proband
      • Adding patient info for the non-proband samples
      • Secondary findings
      • Labeling a case
      • Gene list
      • Supported parental ethnicities
    • Creating multiple cases
      • Batch case upload from platform
      • CSV format requirements
      • Batch case upload via CLI
    • Reviewing a case
      • Individual case page
      • Individual case page: Top bar
      • Individual case page: Top bar
      • Candidates tab
      • Most Likely Candidates and Candidates
      • Genome Overview
      • Analysis tools tab
      • Variant table columns
      • Variant table
      • Variant search
      • Multiselection of variants and bulk actions (34.0+)
      • Download variants
      • Manually add variants to a delivered case
      • Filters/Presets panel
      • Filters
      • Presets
      • Preset groups
      • Variant Type Filters
      • Variant Effect Filters
      • Quality Filters
      • Polymorphism Filters
      • Gene Filters
      • Phenomatch Filters
      • Inheritance Filters
      • Zygosity Filters
      • User Filters
      • Evidence page
      • Phenotypic match strength
      • Lab tab
      • Versions tab
      • Editing an existing case
      • Finalizing a case
      • Clinical Report
      • Reflex genetic testing
      • Variant zygosity notations
      • STR calling and interpretation
    • Variant page
      • Variant page
      • Variant page top bar
      • Variant tagging widget
      • Variant activity panel
      • Desktop apps panel
      • Clinical Significance section
      • Summary section
      • Quality section
      • Visualization section
      • Population Statistics section
      • Related Cases section
      • CNV overlap percentage
      • Evidence section
      • ACMG SNV Classification wizard
      • Logic behind ACMG classification of SNVs
      • ACMG CNV Classification wizard
      • Variant page sidebar (2.29+)
    • Variant visualization setup
      • Enabling visualization for a VCF case
      • Integration between emedgene and desktop IGV
      • Loading alignment files to your desktop IGV (32.0+)
    • Analyze Network
      • Analyze Network Setup
      • Network sharing configuration
      • Case subject consent for extended sharing
      • Public vs Private network
      • Create a network
      • Set network data sharing policy
      • Leave a network
      • Delete a network
    • Settings
      • My settings
      • Management
      • User Management
      • Network
      • Organization Settings (33.0+)
    • Integrations
      • API Beginner Guide
      • Advanced API Implementations
      • API Key Generation
      • BSSH Integration
      • ICA Integration
      • Webhook Integration
  • Emedgene Curate Manual
    • Curate overview
      • Curate overview
      • Emedgene Applications menu
      • Curate navigation panel
      • Genome assemblies supported by Curate
    • Curate Variants
      • Curate Variants overview
      • Curate Variant table
      • Curate Variant page
      • How to add a variant to Curate
      • Curate Variant annotations in the case
    • Curate Genes (2.28+)
      • Curate Genes overview
      • Curate Gene table
      • Curate Gene page
      • How to add a gene to Curate
    • Import Curate annotations to the case (30.0+)
      • Import Curate Variant annotations to the case (30.0+)
      • Import Curate Gene annotations to the case (30.0+)
  • Frequently Asked Questions
    • All FAQ
      • Which browser should I use with Emedgene?
      • Emedgene annotations and update frequency
      • How do I use developer tools to collect logs?
      • Can I analyze Illumina Complete Long Reads in Emedgene?
      • How do I prepare VCF files generated by DRAGEN MANTA to be used as input for Emedgene?
      • Source of gnomAD data for small variants on GRCh38
      • How are MNVs handled on the platform?
      • Support for gene lists with up to 10,000 genes
      • Genomic Regions by Case Type
      • How do I analyze mtDNA variants?
      • Can I use exome data for CNV detection?
      • How does joint calling work on Emedgene?
      • What is the required format for a BED file defining a kit?
      • Which reference genomes can I use?
      • How do I move between organizations?
      • How do I check the version of my environment?
      • "Failed to generate report". What should I do?
      • How do I prepare VCF files generated by Dragen STR (ExpansionHunter) to be used as input?
      • How does Emedgene Analyze prioritize transcripts?
      • How does Emedgene Analyze merge variants from different sources?
      • Performance issue troubleshooting
      • How does Emedgene calculate variant effect and severity ?
      • How to I prepare metrics files generated by DRAGEN to be used as input for Emedgene
      • How are timekeeping and log timestamps kept accurate and consistent?
  • Release Notes
    • Workbench & Pipeline Updates
      • New in Emedgene V37.0 (February 20, 2025)
        • V37 Patches
      • New in Emedgene V36.0 (October 8 2024)
        • V36 Patches
      • New in Emedgene V35.0 (May 22nd 2024)
        • V35 Patches
      • New in Emedgene V34.0 (January 28th 2024)
        • V34 Patches
      • New in Emedgene V33.0 (September 6th 2023)
        • V33 Patches
      • New in Emedgene V32.0 (June 8th 2023)
        • New pipeline 32 (June 8th 2023)
        • V32 Patches
      • More release notes
        • New in emedgene 31 (March 1st 2023)
        • New in emedgene 30 (January 8th 2023)
        • New in emedgene 2.29 (August 25 2022)
        • New pipeline 5.29 (May 1st 2022)
        • New in emedgene 2.28 (May 1 2022)
        • New in emedgene 2.27 (March 7, 2022)
        • New in emedgene 2.26 (Dec 14, 2021)
        • New in emedgene 2.24-2.25 (Aug 11, 2021)
        • New in emedgene 2.23 (Jun 15, 2021)
        • New in emedgene 2.19-2.22 (Apr 8, 2021)
        • New in emedgene 2.16-2.19 (Dec 7, 2020)
        • New in emedgene 2.12-2.16 (Oct 18, 2020)
    • Knowledgebase Updates
      • 2025
        • Variant Databases (March 30th 2025)
        • Zoidberg 77 (March 17th 2025)
        • Zoidberg 76 (February 3rd 2025)
        • Zoidberg 75 (January 6th 2025)
      • 2024
        • Variant Databases (December 8th 2024)
        • Zoidberg 74 (December 2nd 2024)
        • Zoidberg 73 (October 21th 2024)
        • Variant Databases (September 22nd 2024)
        • Zoidberg 72 (September 10th 2024)
        • Variant Databases (July 21st 2024)
        • Zoidberg 71 (July 24th 2024)
        • Zoidberg 70 (June 3rd 2024)
        • Zoidberg 69 (April 19th 2024)
        • Variant Databases (April 9th 2024)
        • Zoidberg 68 (March 18th 2024)
        • Variant Databases (February 5th 2024)
        • Zoidberg 67 (January 28th 2024)
        • Variant Databases (January 5th 2024)
      • 2023
        • Zoidberg 66 (December 24th 2023)
        • Variant Databases (December 3rd 2023)
        • Zoidberg 65 (November 21th 2023)
        • Variant Databases (November 5th 2023)
        • Zoidberg 64 (October 24th 2023)
        • Variant Databases (October 8th 2023)
        • Zoidberg 63 (September 18th 2023)
        • Variant Databases (September 5th 2023)
        • Zoidberg 62 (August 23th 2023)
        • Zoidberg 61 (August 16th 2023)
        • Variant Databases (August 6th 2023)
        • Zoidberg 60 (July 30th 2023)
        • Variant Databases (July 2nd 2023)
        • Zoidberg 59 (June 18th 2023)
        • Variant Databases (June 4th 2023)
          • Variant Databases (May 7th 2023)
        • Zoidberg 58 (May 21th 2023)
        • Zoidberg 57 (April 16th 2023)
        • Variant Databases (April 2nd 2023)
        • Zoidberg 56 (March 19th 2023)
        • Variant Databases (March 11th 2023)
        • Zoidberg 55 (February 19th 2023)
        • Zoidberg 54 (January 16th 2023)
    • Change log
      • Change log pipeline v34
      • Change log pipeline 31
      • Change log workbench 31
      • Change log pipeline 30
      • Change log workbench 30
      • Change log workbench 2.29
      • Change log pipeline 5.29
      • Change log workbench 2.28
  • Legal
    • Privacy, Security & Compliance
    • Release Policy
Powered by GitBook
On this page
  • Getting Started
  • Use cases
  • Automating Case Management: Creation and Status Check
  • Assigning Participants
  • Retrieving Case Info, Tags, Variants, and Changing Status
  • Managing Finalized Cases and Generating Reports
  • Creating a Custom Preset Group with Additional Gene Panels

Was this helpful?

Export as PDF
  1. Emedgene analyze manual
  2. Integrations

Advanced API Implementations

This page provides several code examples demonstrating how to use the platform for common scenarios. While you don't need to follow or implement every example, they can serve as useful starting points

PreviousAPI Beginner GuideNextAPI Key Generation

Last updated 3 months ago

Was this helpful?

Getting Started

Before exploring the examples, make sure to log in to the platform. More information on this can be found in the .

After authentication, you will receive a token, which remains valid for a certain period of time.

For more information on advanced features, parameters, and additional examples, be sure to check out our Swagger documentation by going to https://<hostname>.emg.illumina.com/api/apidoc/swagger#/

Use cases

  • Automating Case Management: Creation and Status Check

  • Assigning Participants

  • Retrieving Case Info, Tags, Variants, and Changing Status

  • Managing Finalized Cases and Generating Reports

  • Creating a Custom Preset Group with Additional Gene Panels

Automating Case Management: Creation and Status Check

This example demonstrates how to automate case management, including case creation, checking if the case status is "finalized," and generating a report.

Step 1: Create the Payload

First, construct a JSON payload with all the necessary case data.

Refer to the API documentation for more details on required fields, or go to https://<hostname>.emg.illumina.com/api/apidoc/swagger#/Cases/post__api_cases_v2_cases

Step 2: Send a POST Request

To create a case, send a POST request using the payload. Remember to replace any values enclosed in < > with your specific data.

import requests

route_case_creation_url = 'https://<hostname>.emg.illumina.com/api/cases/v2/cases/'
payload = {
    "sharing_level": 0,
    "should_upload": False,
    "test_data": {
        "analysis_type": None,
        "boostGenes": False,
        "consanguinity": False,
        "disease_penetrance": 100,
        "disease_severity": "",
        "diseases": [],
        "gene_list": {
            "id": 1,
            "type": "all",
            "visible": False
        },
        "incidental_findings": None,
        "inheritance_modes": [],
        "labels": [],
        "notes": "",
        "patients": {
            "other": [],
            "proband": {
                "dead": False,
                "detailed_ethnicity": {
                    "maternal": [],
                    "paternal": []
                },
                "fastq_sample": "<proband sample name>",
                "gender": "<proband gender>",
                "healthy": False,
                "id": "proband",
                "ignore": False,
                "notes": "",
                "phenotypes": [
                    {
                        "id": "phenotypes/<EMG_PHENOTYPE_0011856>",
                        "name": "Pica"
                    },
                    {
                        "id": "phenotypes/<EMG_PHENOTYPE_0000969>",
                        "name": "Edema"
                    }
                ],
                "quality": "",
                "relationship": "Test Subject",
                "zygosity": ""
            }
        },
        "sample_type": "<fastq or vcf>",
        "samples": [
            {
                "directoryPath": "",
                "fastq": "<proband sample name>",
                "sampleFiles": [
                    {
                        "filename": "<proband file 1>.fastq.gz",
                        "path": "<full path/proband file 1>.fastq.gz",
                        "size": <file size>,
                        "status": "uploaded",
                        "storage_id": <storage provider id>
                    },
                    {
                        "filename": "<proband file 2>.fastq.gz",
                        "path": "<full path/proband file 2>.fastq.gz",
                        "size": <file size>,
                        "status": "uploaded",
                        "storage_id": <storage provider id>
                    }
                ],
                "sampleType": "<fastq or vcf>",
                "status": "uploaded",
                "storage_id": <storage provider id>
            }
        ],
        "selected_preset_set": None,
        "sequence_info": {
            "intersect_bed_id": None,
            "kit": "<kit name>",
            "kit_id": <kit id>
        },
        "type": "<case type>"
    }
}

headers = {'Authorization': 'Bearer <your-auth-token>'}
response = requests.post(route_case_creation_url, json=payload, headers=headers)

Step 3: Retrieve Case Status and Name

After creating the case, you can retrieve the status and name from the API response.

# Check response status:
status = response.json().get("Status")

# Get the case name:
case_name = response.json().get("name")

Assigning Participants

Step 1: Retrieve Participant IDs by Email

Before assigning participants to cases, you can retrieve their IDs by searching for their email addresses.

import requests

# Define the email addresses you want to search for
emails_to_search = ["user1@example.com", "user2@example.com"]

participant_ids = []
user_url = 'https://<hostname>.emg.illumina.com/api/user/org_users/'
response = requests.get(user_url, headers=headers)
if response.status_code == 200:
    users = response.json().get("hits", [])
    for user in users:
        if user.get("email") in emails_to_search:
            participant_ids.append(user.get("id"))

Step 2: Assign Participants to the Case

Finally, assign participants to the case using their IDs.

assign_url = f'https://<hostname>.emg.illumina.com/api/participant/{case_name}'

payload = {"action": "assign", "ids": participant_ids}

response = requests.post(url=assign_url, json=payload, headers=headers)

if response.status_code == 200:
    print(f"Participants {participant_ids} assigned to case {case_name}.")
else:
    print(f"Failed to assign participants to case {case_name}. Response: {response.json()}")

Retrieving Case Info, Tags, Variants, and Changing Status

This example demonstrates how to retrieve tagged variants and the associated variant information from a case, and change the case status.

Step 1: Obtain the Case Name

Step 2: Retrieve case info

Use this API route to get some basic information on a case: creation time, creator, last updated time, case name, case status.

import requests

url = 'https://<hostname>.emg.illumina.com/api/test/{case_name}/info'
headers = {
    'Authorization': 'Bearer <your-auth-token>'
}

response = requests.get(url=url, headers=headers)

# Output the case information
print(response.json())

Step 3: Send a GET Request to Retrieve Case Tags

To pull the case data, including tagged variants, send a GET request.

import requests

url = 'https://<hostname>.emg.illumina.com/api/candidates/{case_name}'
headers = {
    'Authorization': 'Bearer <your-auth-token>'
}

response = requests.get(url=url, headers=headers)

# Output the variants with tags and their information
print(response.json())

For more information, check out the Swagger documentation at https://<hostname>.emg.illumina.com/api/apidoc/swagger#/Candidates/get__api_candidates_%7Bcase_name%7D

Step 4: Update Case Status to a Custom Status

After retrieving the case, update the status to "custom_status_1".

case_name = case.get("name")
update_url = f'https://<hostname>.emg.illumina.com/api/test/{case_name}'

payload = {"status": "custom_status_1"}

response = requests.put(url=update_url, json=payload, headers=headers)

if response.status_code == 200:
    print(f"Case {case_name} updated to 'custom_status_1'.")
else:
    print(f"Failed to update case {case_name}. Response: {response.json()}")

Managing Finalized Cases and Generating Reports

Step 1: Retrieve Cases Finalized in the Last 24 Hours

Retrieve cases that were finalized within the last 24 hours.

from datetime import datetime, timedelta

# Calculate the date 24 hours ago
from_status_change_date = (datetime.now() - timedelta(days=1)).isoformat()

url = f'https://<hostname>.emg.illumina.com/api/test?from_status_change_date={from_status_change_date}&status=finalized'

response = requests.get(url=url, headers=headers)

finalized_cases = response.json()

Step 2: Generate a Report

Reports can only be generated for finalized cases. To generate a report, send the following GET request:

url = 'https://<hostname>.emg.illumina.com/api/test/{case_name}/reports/English/null/?candidates=true&full_export=true&incidental=true'
headers = {
    'Authorization': 'Bearer <your-auth-token>'
}
response = requests.get(url=url, headers=headers)
print(response.json())

For more information, check out the Swagger documentation at https://<hostname>.emg.illumina.com/api/apidoc/swagger#/Reports/get__api_test_v2_%7Bcase_name%7D_reports_%7Breport_type%7D_%7Breport_id%7D

Creating a Custom Preset Group with Additional Gene Panels

This example demonstrates how to create a custom preset group by combining an existing preset group (created with a case) and adding additional gene lists, HPO terms, inheritance modes, or other data on top of it using the v35 functionality.

Step 1: Create a Case with an Existing Preset Group

Step 2: Create a Custom Preset Group

Once the case is created, use the API to add custom gene lists on top of the existing preset group associated with the case. Here's the Python code to achieve this:

import requests

case_name = "EMG123456789"
url = f'https://<hostname>.emg.illumina.com/api/test/<case_name>/preset_group'

headers = {'Authorization': 'Bearer <your-api-key>'}

# Define the gene lists to be added on top of the existing preset group
first_gene_list_name = "my gene list"
first_gene_list_id = 1
second_gene_list_name = "my gene list 2"
second_gene_list_id = 2

data = {
    "name": "<name-of-new-custom-preset-group>",
    "filter": {
        "search": [
            {
                "id": first_gene_list_id,
                "name": first_gene_list_name,
                "type": "gene list",
                "value": first_gene_list_name
            },
            {
                "id": second_gene_list_id,
                "name": second_gene_list_name,
                "type": "gene list",
                "value": second_gene_list_name
            }
        ]
    }
}

response = requests.post(url, json=data, headers=headers)

if response.status_code == 201:
    print("Custom preset group created successfully.")
else:
    print(f"Failed to create custom preset group. Status code: {response.status_code}")

For more information, check out the Swagger documentation at https://<hostname>.emg.illumina.com/api/apidoc/swagger#/Cases/post__api_test_%7Bcase_name%7D_preset_group

If you don't have the case name yet, follow the steps outlined in Steps 1 and 2 of to create a case and retrieve the case name.

Another option for retrieving a finalized case is to use . This option allows to receive notifications on case status change instead of checking via API.

Before creating a custom preset group, ensure that a case has already been created using an existing preset group. For details on how to create a case, refer to .

API Beginner Guide
webhooks
Automating Case Management: Creation
Automating Case Management: Creation