View a markdown version of this page

Post-deployment tasks - Guidance for Multi-Omics and Multi-Modal Data Integration and Analysis on AWS

Post-deployment tasks

After the stack has successfully deployed, complete these post-deployment tasks.

Post-deployment overview

Use the following steps to deploy this guidance on AWS. For detailed instructions, follow the links for each step.

Step 1. Confirm crawler completion

Step 2. Confirm Omics resource creation

Step 3. Launch the QuickSight resource stack

Step 4. Explore the data using QuickSight

Step 5. Make Amazon Omics data available in Athena

Step 6. Query data in the data lake

Step 1. Confirm crawler completion

Note

The Parquet version of the datasets are copied into the data lake bucket after the guidance is set up so that running these AWS Glue jobs is optional. We run the AWS Glue crawlers on these datasets automatically during setup of the guidance to create the tables in the data catalog. The AWS Glue jobs are provided for modification and reference.

The AWS Glue crawlers are launched after deployment completes. You must confirm that all crawlers are complete before proceeding with further steps to explore the data using QuickSight or Jupyter.

Use the following steps to verify the crawler status:

  1. Sign in to the AWS Glue console.

  2. Select Crawlers on the left navigation pane.

  3. Wait for all crawlers to show status as READY, and the Tables added column to each be 1 or larger.

Step 2. Confirm Omics resource creation

The Amazon Omics Reference, Variant, and Annotation stores are created. 1000 Genomes, the example VCF, and ClinVar Annotation data are loaded into the stores once the solution is deployed.

Follow these steps to verify resource creation:

  1. Sign into the Amazon Omics console

  2. Select Storage > Reference store in the left navigation page.

  3. Verify the presence of hg38 under Reference Genomes with Import status set to Active.

  4. Select Analytics > Variant stores in the left navigation page.

  5. Verify that Variant store with name omicsvariantstore has status set to Active.

  6. Choose omicsvariantstore and verify that there are two Job IDs with Import status set to Completed. These correspond to the import of the 1000 Genomes VCF and the example VCF.

  7. Select Analytics > Annotation stores in the left navigation page.

  8. Verify that Annotation store with the name omicsannotationstore has status set to Active.

  9. Choose omicsannotationstore and verify that there is a Job ID with Import status set to Completed. This corresponds to the import of the ClinVar VCF.

Step 3. Launch the QuickSight stack

Note

To create Quick resources, the AWS CloudFormation stack requires the user to input their QuickSight User ID. This User ID can be retrieved from Quick through the following steps:

  1. Sign in to Quick.

  2. Select the dropdown menu in the upper right of the display.

  3. Choose the menu option containing your username.

  4. In the resulting Account info screen, copy the entire text under the Username field.

To assist the user in exploring the use of Quick to analyze multi-omics data, the guidance provides a CloudFormation template that automatically creates the necessary QuickSight data source and dataset, as well as adds a policy to the QuickSight service IAM role to grant it permissions to access the relevant data resources.

Use the following steps to create Quick resources for this guidance:

  1. Sign in to the AWS CloudFormation console.

  2. Select Stacks in the left navigation pane, then select the Imaging stack.

  3. Select the Outputs tab, then select the link shown in the CreateQuicksightLink output. This opens the CloudFormation Create Stack wizard with the stack name and project name pre-filled.

    1. In the QuicksightUserId parameter field, paste in your username information from QuickSight.

    2. If during the setup process of Quick, you selected an alternate IAM role for the QuickSight service, you must update the QuicksightServiceRoleName with the correct name of the IAM role being used by QuickSight.

    3. Check the box to acknowledge that the template will create AWS Identity and Access Management (IAM) resources.

  4. Choose Create stack to deploy the stack.

  5. You can view the status of the stack in the AWS CloudFormation Console in the Status column. You should see a status of CREATE_COMPLETE in approximately 1 minute.

Step 4. Explore the data using QuickSight

Once the QuickSight template has completed, you can create a QuickSight Analysis to explore the data graphically with interactive filters. The steps below are recommended; however, feel free to follow your own path when exploring this data.

  1. Open the QuickSight console from the AWS Management Console by searching for QuickSight.

  2. In the Datasets tab, locate the new dataset with your selected project name and choose it to open.

  3. Choose Create analysis.

  4. Your analysis will begin with a pre-selected AutoGraph visual. Change this to a Horizontal Bar Chart by selecting the appropriate icon in the Visual types panel.

  5. From the Fields list, drag the age_at_dx_numeric field to the Y axis field well at the top of the screen. Your visual will now show Count of Records by Age_at_dx_numeric.

  6. The visual by default will zoom into the data, which you can navigate using the vertical scroll bar in the visual tile.

  7. To view the entire data set, with the visual selected, choose the Format visual gear icon in the small context menu that appears to the upper right of the visual. Then, expand the Y-axis settings and uncheck Show data zoom.

  8. Next, we will add a second visual to look at an additional field.

  9. Choose the + Add button in the upper-left and select Add visual.

  10. From the Visual types panel, choose the Heat map visual type.

  11. Drag the egfr_mutation_status field from the Fields list to the Rows field well, and drag the eml4_alk_translocation_status field to the Columns field well.

  12. The visual now shows a heat map of the number of patients who have had their tumors tested for EML4-ALK translocation and EGFR mutation status. Because there are a substantial number of patients without test results, let’s add some filters to the data set to clean this up.

  13. Select the Filter tab and ensure that you have the newly created heat map visual selected.

  14. Choose the + button in the Filters section to add a new filter and select eml4_alk_translocation_status as the field to filter.

  15. Choose the newly created filter and change the following settings:

    1. Change the Only this visual dropdown to All visuals of this dataset.

    2. In the Include list, unselect the [Not Available] and [Unknown] options.

  16. Choose Apply to see the effect of the new filter, and then choose Close.

  17. Repeat steps 11 through 13, but this time select the egfr_mutation_status field.

  18. Next, create a pivot table that shows the number of data records available for each category of patients in our filtered cohort.

  19. Choose the + Add button in the upper-left and select Add visual.

  20. From the Visual types panel, choose the Pivot table visual type.

  21. Drag both the egfr_mutation_status and eml4_alk_translocation_status fields from the Fields list to the Columns fields well.

  22. In the Values fields well, change it to “Row” mode by selecting Row, then drag all of the num_..._records fields into the Values field well.

  23. For each entry in the Values field well, change the Aggregate function from Sum to Count by choosing the dropdown arrow, then selecting Count from the Aggregate menu.

  24. Finally, create a table listing the patient IDs that are in the current analysis. This can be exported as a CSV file to create a cohort for further analysis.

  25. Choose the + Add button in the upper-left and select Add visual.

  26. From the Visual types panel, choose the Table visual type.

  27. Drag the bcr_patient_barcode field into the Value field well. You can add additional fields such as those we have used in the filters or other visuals.

  28. To export the list of patients as a CSV file, in the small context menu that appears to the upper right of the visual, choose the Menu options () icon, then select Export to CSV.

Step 5. Make Amazon Omics data available in Athena and SageMaker Notebook

Once the Omics resources are created and verified, you can make the data in the Omics Variant Store and Omics Annotation Store available in Athena for querying through AWS Lake Formation.

  1. Navigate to AWS Lake Formation, you should see the variant store and annotation store resource shares listed under Data catalog > Tables with the names for the Omics stores. In this case, omicsvariantstore and omicsannotationstore.

  2. Select omicsvariantstore, choose Actions and choose Create resource link. Give the resource link a name, such as variants. This will be the table name that will show up in Athena. This table can be added to the existing solution database >genomicsanalysis. Once created, repeat the process for the annotation store omicsannotationstoreand give it a name, such as annotations.

  3. Once resource links are created, select the newly created table variants under Tables, choose Actions and select Grant on target. Select the user and role that you want to allow access.

    Note

    To allow query from the SageMaker Notebook created as part of the solution, select the IAM Role created for the SageMaker notebook instance. To identify the IAM Role name, navigate to AWS Identity and Access Management (IAM) console, select Roles under Access management in the left navigation page, search for RunbookRole. You should get a result with the full name of the IAM Role used by the SageMaker notebook instance.

  4. Next, under LF-Tags or catalog resources, select Named data catalog resources and choose the resource link created for the database, such as <account-id>-<variant-store-id>-variant. Select All tables. Under Table permissions, check the Select and Describe box under Table permissions and Grantable permissions. Select All data access under Data permissions and choose Grant. Repeat the process for the annotations table.

  5. After the previous step completes successfully, navigate to Amazon Athena in the console, select AwsDataCatalog under Data source and genomicsanalysis under Database. Verify that you are able to see the newly created tables variants and annotations under Tables and views. Also verify that you have selected Workgroup genomicsanalysis-aws-region. You are now ready to run a query against all the data in these databases.

Step 6. Query data in the data lake

Note

An Amazon SageMaker AI notebook instance is provisioned with an example Jupyter notebook that demonstrates how to work with data in a genomics data lake. The notebook uses Amazon Athena to identify genomic variants related to drug response for a given cohort of individuals. The following query is run against data in the data lake using the PyAthena driver to 1) filter by samples in a subpopulation, 2) aggregate variant frequencies for the subpopulation-of-interest, 3) join on the ClinVar dataset, 4) filter by variants that have been implicated in drug-response, 5) order by highest frequency variants.

You can generate an example cohort creation and drug response by running each step in the provided demonstration Jupyter Notebooks.

Option 1: Use the provided Jupyter Notebooks

Use the following steps to run the notebook:

  1. Sign in to the Amazon SageMaker AI console.

  2. Select Notebook Instances under the Notebook category on the left pane.

  3. Select your notebook instance and choose Open Jupyter.

  4. To explore cohort creation, clinical dataset enrichment, and imaging visualization, select cohort-creation.ipynb.

  5. Run each step in the notebook.

  6. To explore the creation of a drug response report, in the main Jupyter window, select runbook.ipynb.

  7. Run each step in the notebook.

Option 2: Run the drug response report query in the Amazon Athena console

Use the following setups to run the query in the Amazon Athena console:

  1. Sign in to the Amazon Athena console.

  2. Under Data Source select the AwsDataCatalog data source on the left pane.

  3. Under Database select the genomicsanalysis database on the left pane.

  4. In the query window paste the query below.

  5. Select Run Query.

    SELECT count(*)/cast(numsamples AS DOUBLE) AS genotypefrequency ,cv.attributes['RS'] as rs_id ,cv.attributes['CLNDN'] as clinvar_disease_name ,cv.attributes['CLNSIG'] as clinical_significance ,sv.contigname ,sv.start ,sv."end" ,sv.referenceallele ,sv.alternatealleles ,sv.calls FROM {variant_table_name} sv CROSS JOIN (SELECT count(1) AS numsamples FROM (SELECT DISTINCT vs.sampleid FROM {variant_table_name} vs WHERE vs.sampleid LIKE 'NA12%')) JOIN {annotation_table_name} cv ON sv.contigname = cv.contigname AND sv.start = cv.start AND sv."end" = cv."end" AND sv.referenceallele = cv.referenceallele AND sv.alternatealleles = cv.alternatealleles AND cv.attributes['CLNSIG'] LIKE '%response%' AND sv.sampleid LIKE 'NA12%' GROUP BY sv.contigname ,sv.start ,sv."end" ,sv.referenceallele ,sv.alternatealleles ,sv.calls ,cv.attributes['RS'] ,cv.attributes['CLNDN'] ,cv.attributes['CLNSIG'] ,numsamples ORDER BY genotypefrequency DESC LIMIT 50