arrow-left

All pages
gitbookPowered by GitBook
1 of 8

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

ICA Integration

Please contact support.

Automatic Case Creation from ICA - Cyto Array Analysis

Seamless end-to-end workflow from scanner to tertiary analysis with no human intervention.

hashtag
Overview

This feature enables automatic case creation in Emedgene following the successful completion of specific array analysis events on ICA. The automation supports efficient and standardized case generation, ensuring timely downstream review and interpretation.

hashtag
When It Applies

This feature is triggered when a DRAGEN Array - Cytogenetics analysis with Emedgene tertiary interpretation analysis is completed successfully on ICA.

hashtag
Prerequisites

Before automatic case creation can occur, ensure the following conditions are met:

  1. The user needs to have access to BSSH and Emedgene in the same workgroup.

  2. The managed ICA project must be to the Emedgene workgroup:

    • The managed ICA project needs to be the one was created automatically by BSSH after running the first analysis (BSSH {workgroup name}, for example "BSSH MyWG").

hashtag
Automatic Case Creation Workflow

Upon successful analysis completion, the system will:

  1. Create a New Case in EMG

    • Case Type: Set to Array.

      • Note: No ROI file will be associated with the case.

hashtag
Limitations

Please note the following limitations of the automatic case creation feature:

  1. Supports only singleton cases

    • Cases involving multiple individuals (e.g., trios or families) are not supported.

  2. No phenotype support

hashtag
Benefits

  • Streamlined and seamless workflow between ICA and Emedgene.

  • Reduces manual intervention and potential for data entry errors.

This ensures EMG has access to the analysis outputs and metadata from the managed ICA project.

  • Enabling ICA Notifications for the BSSH Project:

    To ensure proper integration with EMG, ICA notifications must be enabled for the specific BSSH project. EMG relies on these notifications to detect when an analysis has successfully completed.

    To configure an SNS notification in your managed ICA project, follow these steps:

    • In the ICA portal, in the managed project, navigate to the Notifications section via the left-hand menu.

    • Click + Create, then select ICA Event.

    • Fill in the required fields as follows:

      • Event: Analysis Success

      • Type: SNS

  • Run a BSSH analysis according to the DRAGEN Array user guidearrow-up-right

  • Sample Type: Set to VCF.

  • Phenotype: Automatically marked as Healthy, with no phenotypes assigned.

  • Attach Files to the Case Each automatically generated case will include:

    • VCF file (mandatory)

    • Visualization files:

      • LRR bedgraph

      • BAF bedgraph

    • gt_summary JSON file (containing metadata and quality information)

  • Extract and Apply Metadata from Sample Sheet

    • If available, Gender/Sex is extracted and applied to the case.

    • If not available, the case is labeled as Sex: Unknown.

  • Exclude Failed Analyses

    • Analyses marked as failed will not trigger case creation in Emedgene.

  • All cases will be marked as Healthy, with no phenotypes included, regardless of the sample metadata.

    connected

    BSSH Integration

    Please contact Tech Support with the subject "BaseSpace Emedgene Connect app" for assistance.

    hashtag
    Prerequisites

    1. Have a BaseSpace account

    2. Have an Emedgene account

    3. Add this BaseSpace as a Storage Provider in Emedgene -

    4. Add your BaseSpace user to the Emedgene Connect App whitelist

      1. Go to

        https://<domain>.api.basespace.illumina.com/v1pre3/users/current

      2. Send the Href value to Tech Support with the subject "BaseSpace Emedgene Connect app" "Href": "v1pre3/users/00000000"

    hashtag
    Workflow setup

    1. On BaseSpace, go to Apps and search for Emedgene Connect Beta under All Categories

    1. Click on the app and press Launch Application

    1. Fill out the application setup

      1. Choose an Analysis Name - this will be used for the setup analysis run

      2. Choose a Biosample and Project for the setup - other projects and biosamples can be used later on

    1. When the app launches, an additional URL will be printed to the logs. Copy this URL to another tab and give the requested access to the app. The access granted will created the workflows used later in the BioSample Workflow Sheet.

    2. Once the app setup analysis is completed successfully, press View Files next to the Logs window.

    1. Go to Files and find the BioSample Workflow CSV template in the outputs directory.

    hashtag
    BioSample Workflow Sheet setup

    • Columns A-J hold the data to queue the Emedgene Connect Beta app launch.

      • BioSample Name

      • Default Project - the BaseSpace project to save the outputs to. Can be different than the project used for setting up the app.

    hashtag
    Sample Sheet setup

    • Sample_ID needs to match the BioSampleName in the BioSample Workflow Sheet

    • ProjectName needs to match the Default Project in the BioSample Workflow Sheet

    hashtag
    Run upload

    Upload the run with the Sample Sheet to BaseSpace via CLI (Command Line interface).

    To set up the BaseSpace CLI see .

    <bs-path> upload run -n '<RunName>' -t <Instrument> . --concurrency=high

    1. <RunName> should be set to the RunName from the Sample Sheet Headers

    2. <Instrument> should be set to the InstrumentPlatform from the Sample Sheet Headers

    3. <bs-path> should be set to the output of the command which bs

    hashtag
    Next Steps

    Once BCL Convert is completed for a BioSample from the BioSample Workflow sheet, the selected Analysis Workflow from the BioSample Workflow sheet will launch the Emedgene Connect Beta.

    Address: Provide the correct address based on your region (contact support if unsure).

  • Payload Version: v4

  • AWS Region: This will be auto-populated based on the provided address.

  • (Recommended) Click Send Test Message to verify the configuration.

  • Click Save to complete the setup.

  • Enter the Emedgene URL in which to create cases
  • Enter your API key

  • Enable Setup Mode

  • Choose a Workflow name - this will be used in the BioSample Workflow sheet

  • Press Launch Application

  • Analysis Group - used for pedigree grouping, define a group id and set it for all pedigree samples.
  • Analysis Workflow - in the proband row only set the workflow name define in the app setup and the size of the pedigree. emedgene-create-case_1 - singleton emedgene-create-case_3 - trio

  • From column K onwards holds the data for the Emedgene Batch Upload. This data should follow the .

  • Upload the BioSample Workflow Sheet on BaseSpace under Biosamples.

  • instructions
    herearrow-up-right
    Batch Upload CSV requirements

    Integrations

    API Key Generation

    You can generate an API Key from your account console and use it with the API and command-line interface. Each user can create up to 10 API Keys. These keys are managed through the product dashboard, which you can access by logging into the Platform Dashboard (https://<domain>.login.illumina.com), navigating to the profile dropdown, and selecting "Manage API Keys."

    To generate a new API Key, click Generate. You will need to name the API Key and decide whether to include all workgroups or select specific workgroups. The chosen workgroups will be accessible using this API Key.

    After generating the API Key, it will be displayed (initially hidden). You can reveal the key to copy or download it to a file for secure storage. Remember, once you close the window, the key will no longer be accessible through the domain login page, so ensure it is stored securely for future use.

    Store your API Key securely and refer to it when using the command-line interface or APIs.

    For more information on how to use your API Key with Emedgene API, check out the .

    Webhook Integration

    hashtag
    Emedgene Integration Using Webhooks

    Emedgene allows seamless integration with other platforms via webhooks. By configuring webhooks, you can receive real-time updates on genomic data analyses. When an event occurs, Emedgene pushes relevant data to your specified URL, enabling automated workflows and immediate data synchronization with your systems. This integration simplifies data sharing and enhances the efficiency of your operations by keeping your platforms in sync with insights from Emedgene.

    circle-info

    API Beginner Guide
    Emedgene only supports webhooks for case status change, However there are plans to support any event in the platform. Please reachout to [email protected] for additional support of other events.

    hashtag
    Example: Lab Workflow for Confirmation Test

    When a confirmation test is required between analyst reviews, a webhook can notify the lab instantly. Here’s a sample workflow:

    1. Initial Analysis: An analyst completes the primary genomic data analysis.

    2. Webhook Trigger: Upon saving the analysis, a webhook is triggered, sending data to the lab’s system.

    3. Notification: The lab receives a notification prompting them to perform a confirmation test.

    4. Confirmation Test: The lab conducts the confirmation test and updates their system.

    5. Webhook Response: A webhook sends the test results back to Emedgene for further analysis and final review by another analyst.

    This ensures prompt action and efficient data flow between the lab and analysts.

    hashtag
    Example: Saving a Report When a Case is Finalized

    When a case is finalized in emedgene, you can use webhooks to pull reports through the API. Here’s an example workflow:

    1. Webhook Configuration: Set up a webhook to trigger when a case status changes to "finalized."

    2. Webhook Payload: The webhook sends a payload to your specified URL with details of the finalized case.

    3. API Request: Your server intercepts the webhook and makes an API request to emedgene to pull the final report.

    4. Save Report: The server processes the API response and saves the report in your desired format and location.

    By automating this process, you ensure timely and consistent retrieval of finalized reports.

    hashtag
    Setting Up a Webhook in Emedgene

    1. Navigate to Settings: Go to the Settings section in Emedgene.

    2. Navigate to Management: Under the Settings menu, select Management.

    3. Scrool to Webhooks: Click on Webhooks within the Management page.

    1. Add Webhook: Press the "Add webhook" button.

    2. Configure Webhook Details: Enter the required webhook details such as URL, and secrets in the headers.

    3. Save and Test: Save the webhook configuration and run a test to ensure it is working correctly.

    This configuration enables efficient communication and data integration through webhooks.

    hashtag
    Troubleshoot and re-deliver webhooks

    1. View Webhook Logs: After configuring the webhook, press the "Manage" button to see the log of all sent events.

    2. Inspect and Re-deliver: Click on an event to view its details, and use the "Re-deliver" button to resend the webhook event if necessary.

    3. If there are no events you will have to change a case to the right status in order to create a test event.

    API Beginner Guide

    hashtag
    API Introduction

    Any operation from the Emedgene graphical user interface (GUI) can also be performed by using the Emedgene API.

    Following are some basic examples of how to use Emedgene API with Python.

    For instructions on using the API with other programming languages, please refer to their respective documentation.

    Drawing
    Drawing
    hashtag
    Prerequisites
    • An installed copy of Python (https://www.python.org/arrow-up-right)

    • The Python package installer, pip (https://pip.pypa.io/arrow-up-right)

    • The requests library installed (run pip install requests)

    hashtag
    Authentication

    In order to perform a secure session with Emedgene API servers you should first accomplish the authentication phase and retrieve the bearer token. The bearer token is further required to perform API requests on associated resources without extra identification. The token is valid for a predefined time. Once the bearer token is not valid, you will need to revalidate the token and accomplish the authentication phase again.

    There are two ways to get your authentication token for your user before executing API calls:

    hashtag
    Emedgene Domain users - https://<hostname>.emedgene.com

    To generate the authorization token, use your username and password as follows:

    This is your Bearer token that will be used for the following API requests.

    hashtag
    Illumina Domain users - https://<hostname>.emg.illumina.com

    For Illumina domain users there are two options to authenticate your user and retrieve the Bearer token.

    1. Illumina credentials - use your username and password

    1. Using your API Key to generate the authentication token. To generate an API Key take a look API Key Generating. Copy your API Key to the code below instead of 'my-api-key'.

    Either of these options will produce your Bearer token that will be used for the following API requests.

    hashtag
    API Reference

    The different API commands can be found at https://<hostname>.emedgene.com/api/apidoc/swagger or https://<hostname>.emg.illumina.com/api/apidoc/swagger

    It is useful to explore possible APIs and get an overview of the available parameters.

    hashtag
    Creating Python requests from curl

    The examples in the API Reference page use curl (Client URL), while Python uses requests.

    In order to get the curl command:

    1. Find the endpoint you want to use on the API Reference page.

    2. Select Try it out.

    3. Enter the necessary parameters.

    4. Select Execute.

    5. Copy the resulting curl command.

    Let's break down the parts of a curl command:

    -X specifies the request method to use when communicating with the HTTP server. By default, curl performs a GET request, but you can use the -X option to set a different method, such as POST, PUT, DELETE, etc.

    -H allows you to pass custom headers to the server.

    -d is used to send data in a POST request to the server. This option implies using the POST method.

    To translate a POST command to a Python request:

    Translating a GET command would be similar:

    hashtag
    Examples

    In the examples below, <hostname>.emedgene.com and <hostname>.emg.illumina.com are used indifferently.

    The following examples will build the requests step-by-step, allowing you to execute them individually to understand their functionality, using the output of one request as the input for the next.

    You can also use the GUI to obtain all the parameters or record them after executing the individual API calls in this section. Then, use these values to construct your final API call.

    hashtag
    Get list of cases

    This example can be used as a simple way to verify your connection.

    hashtag
    Checking the response

    To validate the API request was completed successfully, check the HTTP response code.

    HTTP 200 means the API call was successful. Learn more about HTTP response code herearrow-up-right.

    In order to pretty-print the JSON response and view it in a formatted way:

    Tip: when returning lists (like lists of cases) Emedgene API uses pagination. It is possible to get the next items from the list using from and size, shown below.

    hashtag
    Get list of storage providers

    Now that we are able to retrieve information with the API, let's continue by using it for a more practical request like retrieving the list of storage providers your user can access files from.

    Your storage provider holds the sample files accessible for creating samples in a case.

    hashtag
    Create new case

    To create a new case, multiple parameters need to be defined such as samples, the relationship between samples, phenotypes, genes and more. All the required details can be found in the API Reference page under /api/cases/v2/cases .

    Once the complete JSON defining the case details is complete, the case can be created as follows:

    Once the case was created successfully, the response code expected is HTTP 201.

    Use the case name to retrieve information about the case.

    hashtag
    Check the status of a case

    In order to know if the case has completed successfully, check the status as follows:

    hashtag
    Get more information about a case

    To get more information about a case, use the same API call as above without any test_fields

    The response can be used to find which test fields are of interest and use them in the next API calls:

    hashtag
    Get candidates of completed case

    To retrieve the candidate variants of the completed case:

    To retrieve candidate variants of the completed case with details such as transcript data, pathogenicity, ACMG tags and more:

    route_login_platform = 'https://<hostname>.emedgene.com/api/auth/v2/api_login/'
    payload = {"username": user_name, "password": 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}')
    route_login_platform = 'https://<hostname>.emg.illumina.com/api/auth/v2/api_login/'
    payload = {"username": user_name, "password": password}
    response = requests.post(route_login_platform, json=payload)
    access_token = response.json().get('access_token')
    token_type = response.json().get('token_type')
    bearer_token = f'{token_type.capitalize()} {access_token}'
    print(bearer_token)
    import base64
    
    api_key = 'my-api-key'
    route_token_platform = 'https://<hostname>.login.illumina.com/platform-services-manager/Token'
    
    # Prepare the API Key
    client_id_apikey = f'emedgene:{api_key}'
    client_id_apikey_bytes = client_id_apikey.encode("ascii")
    client_id_apikey_base64_bytes_encoded = base64.b64encode(client_id_apikey_bytes)
    client_id_decoded = client_id_apikey_base64_bytes_encoded.decode("ascii")
    
    # Use the API Key
    headers = {
        'Authorization': f'Basic {client_id_decoded}'
    }
    params = {
        "audience": "emedgene", 
        "grant_type": "api_key"
    }
    response = requests.post(route_token_platform, params=params, headers=headers)
    
    access_token = response.json().get('access_token')
    token_type = response.json().get('token_type')
    bearer_token = f'{token_type.capitalize()} {access_token}'
    print(bearer_token)
    curl -X 'POST' 'https://<hostname>.emg.illumina.com/api/some/command/path/' 
       -H 'Authorization': 'Bearer your-auth-token'  
       -d '{"DataName": "DataValue", ...}' 
    import requests
    url = 'https://<hostname>.emg.illumina.com/api/some/command/path'
    headers = {
        'Authorization': 'Bearer your-auth-token',
    }
    data = {
        'DataName': 'DataValue',
    }
    response = requests.post(url=url, headers=headers, json=data)
    import requests
    url = 'https://<hostname>.emg.illumina.com/api/some/command/path'
    headers = {
        'Authorization': 'Bearer your-auth-token',
    }
    response = requests.get(url=url, headers=headers)
    import requests
    
    headers = {
        'Authorization': 'Bearer your-auth-token',
    }
    
    # Store the API response in a response variable
    response = requests.get('https://<hostname>.emg.illumina.com/api/test', headers=headers)
    # Display the response status code
    print(f"Response status code: {response.status_code}")
    
    # Display the data from the request
    print(response.json().get("hits"))
    import json
    
    # Print JSON data in readable format with indentation and sorting.
    print(json.dumps(response.json().get("hits"), indent=3, sort_keys=True))
    import requests
    
    params = {
        'from': 5,    # get the 6th case
        'size': 10    # get 10 cases
    }
    
    headers = {
        'Authorization': 'Bearer your-auth-token',
    }
    
    # Store the API response in a response variable
    response = requests.get('https://<hostname>.emg.illumina.com/api/test', params=params, headers=headers)
    url = 'https://<hostname>.emg.illumina.com/api/storage'
    headers = {
        'Authorization': 'Bearer your-auth-token',
    }
    response = requests.get(url, headers=headers)
    print(response.json().get("hits"))
    url = 'https://<hostname>.emedgene.com/api/cases/v2/cases'
    headers = {
        'Authorization': 'Bearer your-auth-token' 
    }
    data = {...}
    response = requests.post(url, json=data, headers=headers)
    case_name = response.json().get("name")
    url = f'https://<hostname>.emg.illumina.com/api/test/{case_name}?test_fields=status'
    headers = {
        'Authorization': 'Bearer your-auth-token' 
    }
    response = requests.get(url, headers=headers)
    print(response.json())
    url = f'https://<hostname>.emg.illumina.com/api/test/{case_name}'
    headers = {
        'Authorization': 'Bearer your-auth-token' 
    }
    response = requests.get(url, headers=headers)
    print(response.json())
    url = f'https://<hostname>.emg.illumina.com/api/test/{case_name}?test_fields=status&test_fields=participants&test_fields=patients'
    headers = {
        'Authorization': 'Bearer your-auth-token' 
    }
    response = requests.get(url, headers=headers)
    print(response.json())
    url = f'https://<hostname>.emg.illumina.com/api/candidates/{case_name}'
    headers = {
        'Authorization': 'Bearer your-auth-token' 
    }
    response = requests.get(url, headers=headers)
    print(response.json().get("hits"))
    url = f'https://<hostname>.emg.illumina.com/api/test/{case_name}/export'
    headers = {
        'Authorization': 'Bearer your-auth-token' 
    }
    response = requests.get(url, headers=headers)
    print(response.json().get("hits"))

    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

    hashtag
    Getting Started

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

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

    circle-info

    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#/

    hashtag
    Use cases

    • Automating Case Management: Creation and Status Check

    • Assigning Participants

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

    hashtag
    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.

    hashtag
    Step 1: Create the Payload

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

    circle-info

    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

    hashtag
    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.

    hashtag
    Step 3: Retrieve Case Status and Name

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

    hashtag
    Assigning Participants

    hashtag
    Step 1: Retrieve Participant IDs by Email

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

    hashtag
    Step 2: Assign Participants to the Case

    Finally, assign participants to the case using their IDs.

    hashtag
    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.

    hashtag
    Step 1: Obtain the Case Name

    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.

    hashtag
    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.

    hashtag
    Step 3: Send a GET Request to Retrieve Case Tags

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

    circle-info

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

    hashtag
    Step 4: Update Case Status to a Custom Status

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

    hashtag
    Managing Finalized Cases and Generating Reports

    hashtag
    Step 1: Retrieve Cases Finalized in the Last 24 Hours

    Retrieve cases that were finalized within the last 24 hours.

    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.

    hashtag
    Step 2: Generate a Report

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

    circle-info

    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

    hashtag
    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.

    hashtag
    Step 1: Create a Case with an Existing Preset Group

    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 .

    hashtag
    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:

    circle-info

    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

    Managing Finalized Cases and Generating Reports
  • Creating a Custom Preset Group with Additional Gene Panels

  • Automating Case Management: Creation
    webhooks
    Automating Case Management: Creation
    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)
    # Check response status:
    status = response.json().get("Status")
    
    # Get the case name:
    case_name = response.json().get("name")
    import requests
    
    # Define the email addresses you want to search for
    emails_to_search = ["[email protected]", "[email protected]"]
    
    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"))
    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()}")
    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())
    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())
    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()}")
    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()
    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())
    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}")