- Set up a Google Cloud project
- Running on App Engine
- Running with paste and webapp2
- Code layout
- Project status
This Python client demonstrates a simple web-based genome browser that fetches data from the Google Genomics API, the NCBI Genomics API or the Local Readstore through a web interface, and displays a pileup of reads with support for zooming and basic navigation and search.
You can try out the sample genome browser, called GABrowse, now by going to https://gabrowse.appspot.com.
It can also be run locally without App Engine using the Python paste web application framework.
If you will run this application under App Engine (local or remote) or you will access data in Google Genomics, you must set up a Google Cloud Platform project.
- Follow instructions here to create a new project
- Follow instructions here to enable the
- Follow instructions here to find your Cloud "project ID"
You will need your project ID if you deploy to App Engine.
- Follow instructions here to install and authorize the Cloud SDK
The web application uses Application Default Credentials to authorize requests to the Google Genomics API.
- When running the web application locally, it will use your Cloud SDK user credentials.
- When running on App Engine, it will use the Cloud Project's App Engine Service Account.
Google App Engine provides an application framework for internet-based web applications.
To run the application on the development server, you will:
- Download the App Engine SDK
- Install Google's OAuth client libraries
- Launch the development server
- Open the application URL in your browser
Read about and follow the instructions for downloading and installing the Google App Engine SDK for Python
The App Engine environment allows for pure python libraries to be used at runtime. Documentation can be found here.
For this application execute the following in the root of your local copy:
mkdir lib pip install -t lib --upgrade oauth2client
On Mac OS X you can set up and run the application through the GoogleAppEngineLauncher UI. To use the command line or to run on Linux:
To run on Windows:
python c:\path\to\dev_appserver.py .
Once running, visit http://localhost:8080 in your browser to browse data from the API.
To deploy this application to App Engine, execute the following command:
appcfg.py -A YOUR_PROJECT_ID -V v1 update .
YOUR_PROJECT_ID with the project of your Google Cloud Project.
Once running, visit http://YOUR_PROJECT_ID.appspot.com in your browser to browse data from the API.
You can also run the server locally using the Python paste web server framework.
It is highly recommended that you install Python libraries in a virtualenv. This allows you to contain your installation and dependent libraries in one place.
The instructions here explicitly use a Python virtualenv and have only been tested in this environment.
If you have not installed
virtualenv, then do so with:
[sudo] pip install virtualenv
Create a virtualenv called
Install the required dependencies:
pip install WebOb Paste webapp2 jinja2 pip install urllib3[secure] httplib2shim pip install --upgrade oauth2client
google.appengine.tools.devappserver2.wsgi_server.BindError: Unable to bindmessage means that one of the default App Engine ports is unavailable. The default ports are 8080 and 8000. You can try different ports with these flags:
python dev_appserver.py --port 12080 --admin_port=12000 .
Your server will then be available at
- Problem with a non-Chrome browser?
Please file an issue. jQuery and d3 get us a lot of browser portability for free - but testing on all configurations is tricky, so just let us knowif there are issues!
- queries the Genomics API. It also serves up the HTML pages.
- provides some JS utility functions, and calls into
- handles the visualization of reads. It contains the most complex code and uses d3.js to display actual Read data.
The python client also depends on several external libraries:
- supplies a great set of default css, icons, and js helpers
main.html, jQuery is also loaded from an external
- Provide an easily deployable demo that demonstrates what Genomics API interop can achieve for the community.
- Provide an example of how to use the Genomics APIs to build a non-trivial python application.
This code wants to be in active development, but has few contributions coming in at the moment.
Currently, it provides a basic genome browser that can consume genomic data from any API provider. It deploys on App Engine (to meet the 'easily deployable' goal), and has a layman-friendly UI.
Awesome possible features include:
- Add more information to the read display (show inserts, highlight mismatches against the reference, etc)
- Possibly cleaning up the js code to be more plugin friendly - so that pieces could be shared and reused (d3 library? jquery plugin?)
- Staying up to date on API changes (readset searching now has pagination, etc)
- Better searching of Snpedia (or another provider - EBI?)
- Other enhancement ideas are very welcome
- (for smaller/additional tasks see the GitHub issues)