TCGA Toolbox
TCGA Toolbox provides a scripting environment to retrieve, store, and analyze data from The Cancer Genome Atlas (TCGA) in the browser. It can be extended by loading modules, or used interactively from the browser's JavaScript console.
This is a work in progress. The code is hosted on GitHub.
Modules
TCGA Toolbox can be extended by loading remote scripts—either by specifying the URL or by selecting one from our trusted authors.
Load module by URL
Load module by author
Loaded modules
You have not loaded a module yet. Why not try RPPA, a module for real time analysis of reverse phase protein array data?
Share your workflow
Let other researchers reproduce your work by copying and sharing the following URL.
Documentation
TCGA Toolbox provides some useful functions scoped in the global TCGA
namespace to interact with TCGA.
Unless stated otherwise, the first argument of a callback function is reserved for an error object, a useful convention to allow error catching in asynchronous programming. If an error object is null
no error occurred.
Load scripts
TCGA.loadScript(url, callback) |
Loads one or more scripts over HTTPS (HTTP is not supported) using HTML script elements.url is a string or a string array of URLs, callback a function with two parameters, an error object and a string array of loaded scripts.
|
TCGA.modules(callback) |
Returns a list of loaded modules.callback is a function with two parameters, an error object and a string array of loaded modules.
|
Find data
TCGA.find(query, callback) |
Queries the TCGA RDF file index.query is a SPARQL query string, callback a function with two parameters, an error object and an object representing the SPARQL query results in the SPARQL 1.1 Query Results JSON Format.
|
Get data
TCGA.get(url, callback) |
Downloads the contents of a file from TCGA's open-access HTTP directory or any other data provider.url is a URL string, callback a function with two parameters, an error object and a string representing the contents of the requested file.
|
TCGA.get.json(url, callback) |
Same as TCGA.get , but parses the downloaded file to JSON.url is a URL string, callback a function with two parameters, an error object and an object representing the contents of the requested file as JSON.
|
TCGA.get.xml(url, callback) |
Same as TCGA.get , but parses the downloaded file to XML.url is a URL string, callback a function with two parameters, an error object and an object representing the contents of the requested file as XML.
|
TCGA.get.sparql(url, callback) |
Same as TCGA.get , but parses the downloaded file to the SPARQL 1.1 Query Results JSON Format.url is a URL string, callback a function with two parameters, an error object and an object representing the SPARQL query results as JSON.
|
TCGA.get.range(url, startByte, endByte, callback) |
Same as TCGA.get , but downloads only a subset of the file within the specified byte range.url is a URL string, startByte and endByte the integer range of bytes to download, and callback a function with two parameters, an error object and a string representing the partial contents of the requested file.
|
TCGA.get.archive(url, callback) |
Same as TCGA.get , but extracts the downloaded gzipped archive.url is a URL string, callback a function with two parameters, an error object and an object representing the contents of the requested archive.
|
TCGA.get.barcodes(uuids, callback) |
Maps UUIDs to barcodes using the TCGA Barcode to UUID Web Service.uuids is an array of UUIDs, callback a function with two parameters, an error object and an object representing the mapping.
|
TCGA.get.uuids(barcodes, callback) |
Maps barcodes to UUIDs using the TCGA Barcode to UUID Web Service.barcodes is an array of barcodes, callback a function with two parameters, an error object and an object representing the mapping.
|
Store data
TCGA.data.set(key, value, callback) |
Adds a key-value pair to the store.key is a string representing the key, value any type representing the value, and callback a function with one parameter, an error object.
|
TCGA.data.get(key, callback) |
Retrieves a key-value pair from the store.key is a string representing the key, callback a function with two parameters, an error object and any type representing the value.
|
TCGA.data.del(key, callback) |
Removes a key-value pair from the data.key is a string representing the key, callback a function with one parameter, an error object.
|
TCGA.data.exists(key, callback) |
Checks if a key-value pair with the specified key exists in the store.key is a string representing the key, callback a function with two parameters, an error object and a boolean indicating if it is in the store or not.
|
TCGA.data.keys(callback) |
Returns a list of all keys in the stores.callback is a function with two parameters, an error object and a string array of keys.
|
TCGA.data.clear(callback) |
Removes all key-value pairs from the store.callback is a function with one parameter, an error object.
|
User Interface
Load external stylesheets
TCGA.ui.loadStylesheet(url) |
Loads one or more external stylesheets using HTML link elements.url is a string or a string array of URLs.
|
Register tab in main menu
TCGA.ui.registerTab(options, callback) |
Registers a tab in the menu bar of the TCGA Toolbox.options is an object with the following properties: id is a string representing the ID of the tab (we recommend to name it after your module), title is a string representing the title of your module, content is the HTML fragment describing the tab pane, and switchTab is a boolean indicating whether the TCGA Toolbox should immediately switch to your tab after it was created.callback is a function with two parameters, an error object and the DOM element of the created tab pane.
|
Display notifications
TCGA.ui.toast.info(message, duration) |
Displays an info notification with the specified string message for the specified duration in milliseconds. |
TCGA.ui.toast.success(message, duration) |
Displays a success notification with the specified string message for the specified duration in milliseconds. |
TCGA.ui.toast.error(message, duration) |
Displays an error notification with the specified string message for the specified duration in milliseconds. |