Create a Cloud Storage Bucket
Run the Genomics Pipeline
Verify that the BAI file is generated
Clean up (delete the storage bucket)
Cloud Life Sciences: Qwik Start
Cloud Life Sciences (formerly Google Genomics) enables the life sciences community to process biomedical data at scale. Cloud Life Sciences is a suite of services and tools for managing, processing, and transforming life sciences data. It also enables advanced insights and operational workflows using highly scalable and compliant infrastructure.Through this and other add-ons, you can apply the same technologies that power Google Search and Maps to securely store, process, explore, and share large, complex datasets.
In this lab you’ll learn how to run a pipeline that uses the Cloud Life Sciences Pipelines API to create an index file (BAI file) from a large binary file containing DNA sequences (BAM file).
This is an introductory level lab that shows you the basics of setting up and using this Google Cloud service. It assumes little or no prior experience with Cloud Life Sciences.
Setup and Requirements
Before you click the Start Lab button
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you.
This hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.
What you need
To complete this lab, you need:
- Access to a standard internet browser (Chrome browser recommended).
- Time to complete the lab.
Note: If you already have your own personal Google Cloud account or project, do not use it for this lab.
Note: If you are using a Chrome OS device, open an Incognito window to run this lab.
How to start your lab and sign in to the Google Cloud Console
Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is a panel populated with the temporary credentials that you must use for this lab.
Copy the username, and then click Open Google Console. The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Open the tabs in separate windows, side-by-side.
In the Sign in page, paste the username that you copied from the left panel. Then copy and paste the password.
Important: You must use the credentials from the left panel. Do not use your Google Cloud Training credentials. If you have your own Google Cloud account, do not use it for this lab (avoids incurring charges).
Click through the subsequent pages:
- Accept the terms and conditions.
- Do not add recovery options or two-factor authentication (because this is a temporary account).
- Do not sign up for free trials.
After a few moments, the Cloud Console opens in this tab.
Activate Cloud Shell
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
In the Cloud Console, in the top right toolbar, click the Activate Cloud Shell button.
It takes a few moments to provision and connect to the environment. When you are connected, you are already authenticated, and the project is set to your PROJECT_ID. For example:
gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
You can list the active account name with this command:
You can list the project ID with this command:
The Life Sciences API
Enable the Cloud Life Sciences API.
In the Google Cloud console, from the Navigation menu click on APIs & Services > Library:
In the Search for APIs and Services search bar, type "life sciences". Click on the Cloud Life Sciences API tile, then click Enable.
Run the pipeline
Create PROJECT and BUCKET environment variables. The BUCKET variable points to a Cloud Storage bucket that uses your project name with
Create the bucket using the
Test Completed Task
Click Check my progress to verify your performed task. If you have successfully created a cloud storage bucket, you will see an assessment score.
Create BAM and BAI environment variables. This BAM variable points to a sample BAM file in a public bucket. The BAI variable points to the output location where the BAI will be saved:
Run a pipeline using the
gcloudcommand-line tool, providing a BAM file as the input and a BAI file as the output:
The pipeline invokes the Pipelines API, creates a Compute Engine VM instance, and then runs the pipeline process on the instance. After the process finishes, the instance is automatically shut down and the BAI file is copied to your Cloud Storage bucket.
If successful, the command returns the following:
Copy the OPERATION_ID, you’ll use it in the next step.
The pipeline will take a few minutes to finish. Run the following command to track its status, replacing OPERATION_ID with the value you saved from the previous step:
After the operation finishes, it prints the following message:
Test Completed Task
Click Check my progress to verify your performed task. If you have successfully run a Genomics pipeline, you will see an assessment score.
Verify that the BAI file was generated:
The command should return the following:
You've just run a pipeline using the Cloud Life Sciences Pipelines API to create a BAI file from a BAM file.
Test Completed Task
Click Check my progress to verify your performed task. If you have successfully run a Genomics pipeline and processed data is generated in bucket, you will see an assessment score.
All materials for this lab will be removed when you end this lab, but it is good to know how to clean up if you are testing in your own environment.
gsutil rm command to delete the BAI file:
Delete the bucket using the
gsutil rb command:
Test Completed Task
Click Check my progress to verify your performed task. If you have successfully deleted a cloud storage bucket, you will see an assessment score.
You have run a pipeline that uses the Cloud Life Sciences Pipelines API to create an index file (BAI file) from a large binary file containing DNA sequences (BAM file).
Take your next lab
This lab is part of a series of labs called Qwik Starts. These labs are designed to give you a little taste of the many features available with Google Cloud. Search for "Qwik Starts" in the lab catalog to find the next lab you'd like to take!
Next Steps / Learn More
SAM (Sequence Alignment/Map) is a file format for storing the large nucleotide sequences found in genomes. SAMtools provide various utilities to manipulate these files, such as sorting, merging, indexing and generating data on these sequences. SAMtools is open-source and hosted on GitHub.
More information on Cloud Life Sciences.
Google Cloud Training & Certification
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated October 05, 2021
Lab Last Tested October 05, 2021
Copyright 2022 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.