cBio Portal API Client
cBio Portal API client. Parses tab separated responses into JSON format. Works in node and in the browser via a module loader such as Webpack.
This library can be used programatically or via the command line.
Installation
$ npm install cbioportal-api-client --save
Programmatic Usage
API Reference
import CbioPortal from 'cbioportal-api-client';
const cbioPortal = CbioPortal();
cbioPortal.getCancerStudies()
.then(response => {
console.log(response);
});
cbioPortal.getGeneticProfiles({ cancer_study_id: 'gbm_tcga' })
.then(response => {
console.log(response);
});
Command Line Usage
Note: Requires node.
$ npm install -g cbioportal-api-client
$ cbioportal-api-client --help
Usage: cbioportal-api-client [options] [command]
Commands:
getCancerStudies get cancer study meta-data
getTypesOfCancer get clinical cancer types
getGeneticProfiles [options] get genetic profile data for a cancer study.
getCaseLists [options] get case lists stored for a specific cancer study.
getProfileData [options] get genomic profile data for one or more genes.
You can get usage info for specific commands using [command] --help
Options:
-h, --help output usage information
-V, --version output the version number
-f, --format <format> response format
$ cbioportal-api-client getProfileData -s gbm_tcga_cnaseq -p gbm_tcga_mutations -g TP53
API Reference
Modules
- cbioportal-api-client ⇒
cbioPortal
Creates a new cBio Portal API client
- cbioportal-api-client/utils/convertResponse ⇒
Promise
Converts tab delimited responses to JSON format
- cbioportal-api-client/utils/summarizeAlterations
Exports utility functions for summarizing gene alterations
cbioportal-api-client ⇒ cbioPortal
Creates a new cBio Portal API client
See: cbioPortal
Param | Type | Description |
---|
config | Object | Configuration options object. |
config.includeRaw | Boolean | Include the raw TSV response |
Example
Basic usage:
import CbioPortal from 'cbioportal-api-client';
const cbioPortal = CbioPortal();
cbioPortal.getCancerStudies()
.then(response => {
console.log(response);
});
cbioportal-api-client~cbioPortal : Object
cbioPortal API Object Prototype. Used as the object prototype
when creating an API client object via the module factory method.
Kind: inner constant of cbioportal-api-client
See: Use CbioPortal() for object creation.
cbioPortal.getTypesOfCancer() ⇒ Promise
Retrieves a list of all the clinical types of cancer stored on the server.
Kind: instance method of cbioPortal
Returns: Promise
- See fullfills/rejects
Fulfills: Array
response data converted from TSV to JSON
cbioPortal.getCancerStudies() ⇒ Promise
Retrieves meta-data regarding cancer studies stored on the server.
Kind: instance method of cbioPortal
Returns: Promise
- See fullfills/rejects
Fulfills: Array
response data converted from TSV to JSON
cbioPortal.getGeneticProfiles(query) ⇒ Promise
Retrieves meta-data regarding all genetic profiles, e.g.
mutation or copy number profiles, stored about a specific cancer study.
Kind: instance method of cbioPortal
Returns: Promise
- See fullfills/rejects
Fulfills: Array
response data converted from TSV to JSON
Param | Type | Description |
---|
query | Object | |
query.cancer_study_id | string | Cancer study ID |
cbioPortal.getCaseLists(query) ⇒ Promise
Retrieves meta-data regarding all case lists stored about a specific cancer study.
For example, a within a particular study, only some cases may have sequence data, and another subset of cases may have been sequenced and treated with a specific therapeutic protocol.
Multiple case lists may be associated with each cancer study, and this method enables you to retrieve meta-data regarding all of these case lists.
Kind: instance method of cbioPortal
Fulfill: JSON formatted response
Param | Type | Description |
---|
query | Object | |
query.cancer_study_id | string | Cancer study ID |
cbioPortal.getProfileData(query) ⇒ Promise
Retrieves genomic profile data for one or more genes.
Kind: instance method of cbioPortal
Fulfill: JSON formatted response
Param | Type | Description |
---|
query | Object | |
options.case_set_id | string | A unique ID used to identify the case list ID in subsequent interface calls. This is a human readable ID. For example, "gbm_all" identifies all cases profiles in the TCGA GBM study. |
options.genetic_profile_id | Array.<string> | string | One or more genetic profile IDs |
options.gene_list | Array.<string> | string | One or more genes, specified as HUGO Gene Symbols or Entrez Gene IDs |
cbioportal-api-client/utils/convertResponse ⇒ Promise
Converts tab delimited responses to JSON format
Returns: Promise
- Resolves with the response JSON
Param | Type | Description |
---|
response | string | TSV string |
cbioportal-api-client/utils/summarizeAlterations
Exports utility functions for summarizing gene alterations
cbioportal-api-client/utils/summarizeAlterations.summarizeMutations(mutations) ⇒ Array
Summarize mutations
Kind: static method of cbioportal-api-client/utils/summarizeAlterations
Returns: Array
- Array of summaries
Param | Type | Description |
---|
mutations | Array | Array of mutation rows as parsed by this library |
cbioportal-api-client/utils/summarizeAlterations.summarizeCopyNumberAlterations(copyNumberAlterations) ⇒ Array
Summarize copy number alterations
Kind: static method of cbioportal-api-client/utils/summarizeAlterations
Returns: Array
- Array of summaries
Param | Type | Description |
---|
copyNumberAlterations | Array | Array of copy number alteration rows as parsed by this library |
cbioportal-api-client/utils/summarizeAlterations.summarizeAlterations(response) ⇒ Promise
Converts tab delimited responses to JSON format
Kind: static method of cbioportal-api-client/utils/summarizeAlterations
Returns: Promise
- Resolves with the response JSON
Param | Type | Description |
---|
response | string | TSV string |