Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cbioportal-api-client

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cbioportal-api-client - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

bin/cbioportal-api-client

65

dist/index.js

@@ -14,9 +14,3 @@ 'use strict';

});
exports.convertResponse = convertResponse;
exports.default = CbioPortal;
var _bluebird = require('bluebird');
var _bluebird2 = _interopRequireDefault(_bluebird);
var _requestPromise = require('request-promise');

@@ -26,3 +20,3 @@

var _csvtojson = require('csvtojson');
var _utils = require('./utils');

@@ -32,33 +26,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
* @module cbioportal-api-client
*/
/**
* Converts tab delimited responses to JSON format
*
* @param {string} response TSV string
* @return {Promise} Resolves with the response JSON
*/
function convertResponse(response) {
var responseConverter = new _csvtojson.Converter({
delimiter: '\t',
flatKeys: true
});
return new _bluebird2.default(function (resolve) {
responseConverter.fromString(response, function (err, result) {
if (err) {
throw new Error(err);
}
return resolve(result);
});
});
}
/**
* cbioPortal API Object Prototype. Used as the object prototype
* when creating an API client object via the module factory method.
*
* @see Use {@link module:cbioportal-api-client~CbioPortal|CbioPortal()} for object creation.
* @memberOf module:cbioportal-api-client
* @alias module:cbioportal-api-client~cbioPortal
* @see Use {@link module:cbioportal-api-client|CbioPortal()} for object creation.
* @type {Object}

@@ -98,3 +67,3 @@ */

return (0, _requestPromise2.default)(requestOpts).then(function (response) {
return convertResponse(response);
return (0, _utils.convertResponse)(response);
});

@@ -107,3 +76,4 @@ },

* @instance
* @return {Promise} resolves with JSON data
* @return {Promise} See fullfills/rejects
* @fulfills {Array} response data converted from TSV to JSON
*/

@@ -118,3 +88,4 @@ getTypesOfCancer: function getTypesOfCancer() {

* @instance
* @return {Promise} resolves with JSON data
* @return {Promise} See fullfills/rejects
* @fulfills {Array} response data converted from TSV to JSON
*/

@@ -132,3 +103,4 @@ getCancerStudies: function getCancerStudies() {

* @param {string} query.cancer_study_id Cancer study ID
* @return {Promise(data)} resolves with JSON data
* @return {Promise} See fullfills/rejects
* @fulfills {Array} response data converted from TSV to JSON
*/

@@ -151,4 +123,4 @@ getGeneticProfiles: function getGeneticProfiles(_ref) {

* @param {string} query.cancer_study_id Cancer study ID
* @return {Promise(data)}
*/
* @return {Promise}
* @fulfill JSON formatted response */
getCaseLists: function getCaseLists(_ref2) {

@@ -164,7 +136,8 @@ var cancer_study_id = _ref2.cancer_study_id;

* @instance
* @param {Object} query
* @param {string} options.case_set_id 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.
* @param {Array.<string>|string} options.genetic_profile_id One or more genetic profile IDs
* @param {Array.<string>|string} options.gene_list One or more genes, specified as HUGO Gene Symbols or Entrez Gene IDs
* @return {Promise(data)}
*/
* @return {Promise}
* @fulfill JSON formatted response */
getProfileData: function getProfileData(_ref3) {

@@ -197,2 +170,4 @@ var case_set_id = _ref3.case_set_id;

*
* @module cbioportal-api-client
* @see {@link module:cbioportal-api-client~cbioPortal|cbioPortal}
* @param {Object} config Configuration options object.

@@ -211,2 +186,4 @@ * @param {Boolean} config.includeRaw Include the raw TSV response

});
}
}
exports.default = CbioPortal;

@@ -8,38 +8,12 @@ /**

import Promise from 'bluebird';
import Request from 'request-promise';
import { Converter } from 'csvtojson';
import { convertResponse } from './utils';
/**
* @module cbioportal-api-client
*/
/**
* Converts tab delimited responses to JSON format
*
* @param {string} response TSV string
* @return {Promise} Resolves with the response JSON
*/
export function convertResponse (response) {
const responseConverter = new Converter({
delimiter: '\t',
flatKeys: true
});
return new Promise(resolve => {
responseConverter.fromString(response, (err, result) => {
if (err) {
throw new Error(err);
}
return resolve(result);
});
});
}
/**
* cbioPortal API Object Prototype. Used as the object prototype
* when creating an API client object via the module factory method.
*
* @see Use {@link module:cbioportal-api-client~CbioPortal|CbioPortal()} for object creation.
* @memberOf module:cbioportal-api-client
* @alias module:cbioportal-api-client~cbioPortal
* @see Use {@link module:cbioportal-api-client|CbioPortal()} for object creation.
* @type {Object}

@@ -76,3 +50,4 @@ */

* @instance
* @return {Promise} resolves with JSON data
* @return {Promise} See fullfills/rejects
* @fulfills {Array} response data converted from TSV to JSON
*/

@@ -87,3 +62,4 @@ getTypesOfCancer () {

* @instance
* @return {Promise} resolves with JSON data
* @return {Promise} See fullfills/rejects
* @fulfills {Array} response data converted from TSV to JSON
*/

@@ -101,3 +77,4 @@ getCancerStudies () {

* @param {string} query.cancer_study_id Cancer study ID
* @return {Promise(data)} resolves with JSON data
* @return {Promise} See fullfills/rejects
* @fulfills {Array} response data converted from TSV to JSON
*/

@@ -118,4 +95,5 @@ getGeneticProfiles ({ cancer_study_id }) {

* @param {string} query.cancer_study_id Cancer study ID
* @return {Promise(data)}
*/
* @return {Promise}
* @fulfill JSON formatted response */
getCaseLists ({ cancer_study_id }) {

@@ -129,7 +107,9 @@ return this.get('CaseLists', { cancer_study_id });

* @instance
* @param {Object} query
* @param {string} options.case_set_id 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.
* @param {Array.<string>|string} options.genetic_profile_id One or more genetic profile IDs
* @param {Array.<string>|string} options.gene_list One or more genes, specified as HUGO Gene Symbols or Entrez Gene IDs
* @return {Promise(data)}
*/
* @return {Promise}
* @fulfill JSON formatted response */
getProfileData ({ case_set_id, genetic_profile_id, gene_list }) {

@@ -159,2 +139,4 @@ return this.get('ProfileData', { case_set_id, genetic_profile_id, gene_list });

*
* @module cbioportal-api-client
* @see {@link module:cbioportal-api-client~cbioPortal|cbioPortal}
* @param {Object} config Configuration options object.

@@ -164,3 +146,3 @@ * @param {Boolean} config.includeRaw Include the raw TSV response

*/
export default function CbioPortal ({ includeRaw = false } = {}) {
function CbioPortal ({ includeRaw = false } = {}) {
return Object.assign(Object.create(cbioPortal), {

@@ -170,1 +152,3 @@ includeRaw

}
export default CbioPortal;
{
"name": "cbioportal-api-client",
"version": "0.1.1",
"version": "0.2.0",
"description": "cBio Portal API client with promises and response parsing",
"main": "dist/index.js",
"bin": {
"cbioportal-api-client": "./bin/cbioportal-api-client.js"
},
"scripts": {
"build": "npm run clean:dist && babel lib -d dist",
"build": "npm run docs && npm run clean:dist && babel lib -d dist",
"build:dev": "nodemon -w lib --exec \"npm run docs && npm run clean:dist && babel lib -d dist\"",
"clean": "npm run clean:dist && npm run clean:coverage",

@@ -14,3 +18,3 @@ "clean:dist": "rimraf dist",

"dev": "nodemon -w lib -w test --exec \"npm run -s lint && npm run -s test:dev\"",
"docs": "jsdoc2md --src lib/**/*.js -t docs/README.md.hbs -l JavaScript > README.md",
"docs": "jsdoc2md --src \"lib/**/*.js\" -t docs/README.md.hbs -d 2 --partial \"./docs/partials/**/*.hbs\" --separators -l JavaScript > README.md",
"lint": "eslint lib",

@@ -37,2 +41,3 @@ "precommit": "npm run docs",

"babel-eslint": "^5.0.0-beta6",
"babel-plugin-transform-es2015-modules-commonjs": "^6.4.5",
"blue-tape": "^0.1.11",

@@ -43,3 +48,3 @@ "coveralls": "^2.11.6",

"isparta": "^4.0.0",
"jsdoc": "git+https://github.com/jsdoc3/jsdoc.git",
"jsdoc": "^3.4.0",
"jsdoc-to-markdown": "^1.3.3",

@@ -58,6 +63,8 @@ "nock": "^5.2.1",

"bluebird": "^3.1.1",
"commander": "^2.9.0",
"csvtojson": "^0.5.1",
"in-publish": "^2.0.0",
"lodash": "^4.0.0",
"request-promise": "^2.0.0"
}
}
# cBio Portal API Client
[![Build Status](https://img.shields.io/circleci/project/nathanmarks/cbioportal-api-client/master.svg?style=flat-square)](https://circleci.com/gh/nathanmarks/cbioportal-api-client) [![Coverage Status](https://img.shields.io/coveralls/nathanmarks/cbioportal-api-client/master.svg?style=flat-square)](https://coveralls.io/github/nathanmarks/cbioportal-api-client?branch=master)
[cBio Portal API](http://www.cbioportal.org/web_api.jsp) client. Parses tab separated responses into JSON format and works in node and also in the browser via a module loader such as Webpack.
[cBio Portal API](http://www.cbioportal.org/web_api.jsp) client. Parses tab separated responses into JSON format. Works in node and in the browser via a module loader such as [Webpack](http://webpack.github.io).
This library can be used programatically or via the command line.
#### Installation
```bash
$ npm install cbioportal-api-client --save
```
#### Programmatic Usage
[API Reference](#api-reference)
```javascript
import CbioPortal from 'cbioportal-api-client';
const cbioPortal = CbioPortal();
cbioPortal.getCancerStudies()
.then(response => {
console.log(response); // Prints array of cancer studies returned from API
});
cbioPortal.getGeneticProfiles({ cancer_study_id: 'gbm_tcga' })
.then(response => {
console.log(response); // Prints array of genetic profiles returned from the 'gbm_tcga' study
});
```
#### Command Line Usage
**Note:** Requires node.
```bash
# global install to use anywhere
$ npm install -g cbioportal-api-client
# print usage info using --help
$ 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
# example API call, sends JSON formatted response to stdout
$ cbioportal-api-client getProfileData -s gbm_tcga_cnaseq -p gbm_tcga_mutations -g TP53
```
---
## API Reference
* [cbioportal-api-client](#module_cbioportal-api-client)
* [module.exports(config)](#exp_module_cbioportal-api-client--module.exports) ⇒ <code>cbioPortal</code> ⏏
* _static_
* [.convertResponse(response)](#module_cbioportal-api-client--module.exports.convertResponse) ⇒ <code>Promise</code>
* _inner_
* [~cbioPortal](#module_cbioportal-api-client--module.exports..cbioPortal) : <code>Object</code>
* [.getTypesOfCancer()](#module_cbioportal-api-client--module.exports..cbioPortal+getTypesOfCancer) ⇒ <code>Promise</code>
* [.getCancerStudies()](#module_cbioportal-api-client--module.exports..cbioPortal+getCancerStudies) ⇒ <code>Promise</code>
* [.getGeneticProfiles(query)](#module_cbioportal-api-client--module.exports..cbioPortal+getGeneticProfiles) ⇒ <code>Promise(data)</code>
* [.getCaseLists(query)](#module_cbioportal-api-client--module.exports..cbioPortal+getCaseLists) ⇒ <code>Promise(data)</code>
* [.getProfileData()](#module_cbioportal-api-client--module.exports..cbioPortal+getProfileData) ⇒ <code>Promise(data)</code>
<a name="exp_module_cbioportal-api-client--module.exports"></a>
### module.exports(config) ⇒ <code>cbioPortal</code> ⏏
## Modules
<dl>
<dt><a href="#module_cbioportal-api-client">cbioportal-api-client</a> ⇒ <code>cbioPortal</code></dt>
<dd><p>Creates a new cBio Portal API client</p>
</dd>
<dt><a href="#module_cbioportal-api-client/utils/convertResponse">cbioportal-api-client/utils/convertResponse</a> ⇒ <code>Promise</code></dt>
<dd><p>Converts tab delimited responses to JSON format</p>
</dd>
<dt><a href="#module_cbioportal-api-client/utils/summarizeAlterations">cbioportal-api-client/utils/summarizeAlterations</a></dt>
<dd><p>Exports utility functions for summarizing gene alterations</p>
</dd>
</dl>
<a name="module_cbioportal-api-client"></a>
## cbioportal-api-client ⇒ <code>cbioPortal</code>
Creates a new cBio Portal API client
**Kind**: Exported function
**See**: [cbioPortal](#module_cbioportal-api-client..cbioPortal)

@@ -46,47 +110,60 @@ | Param | Type | Description |

```
<a name="module_cbioportal-api-client--module.exports.convertResponse"></a>
#### module.exports.convertResponse(response) ⇒ <code>Promise</code>
Converts tab delimited responses to JSON format
**Kind**: static method of <code>[module.exports](#exp_module_cbioportal-api-client--module.exports)</code>
**Returns**: <code>Promise</code> - Resolves with the response JSON
* [cbioportal-api-client](#module_cbioportal-api-client) ⇒ <code>cbioPortal</code>
* [~cbioPortal](#module_cbioportal-api-client..cbioPortal) : <code>Object</code>
* [.getTypesOfCancer()](#module_cbioportal-api-client..cbioPortal+getTypesOfCancer) ⇒ <code>Promise</code>
* [.getCancerStudies()](#module_cbioportal-api-client..cbioPortal+getCancerStudies) ⇒ <code>Promise</code>
* [.getGeneticProfiles(query)](#module_cbioportal-api-client..cbioPortal+getGeneticProfiles) ⇒ <code>Promise</code>
* [.getCaseLists(query)](#module_cbioportal-api-client..cbioPortal+getCaseLists) ⇒ <code>Promise</code>
* [.getProfileData(query)](#module_cbioportal-api-client..cbioPortal+getProfileData) ⇒ <code>Promise</code>
| Param | Type | Description |
| --- | --- | --- |
| response | <code>string</code> | TSV string |
<a name="module_cbioportal-api-client--module.exports..cbioPortal"></a>
#### module.exports~cbioPortal : <code>Object</code>
-----
<a name="module_cbioportal-api-client..cbioPortal"></a>
### cbioportal-api-client~cbioPortal : <code>Object</code>
cbioPortal API Object Prototype. Used as the object prototype
when creating an API client object via the module factory method.
**Kind**: inner constant of <code>[module.exports](#exp_module_cbioportal-api-client--module.exports)</code>
**See**: Use [CbioPortal()](module:cbioportal-api-client~CbioPortal) for object creation.
**Kind**: inner constant of <code>[cbioportal-api-client](#module_cbioportal-api-client)</code>
**See**: Use [CbioPortal()](#module_cbioportal-api-client) for object creation.
* [~cbioPortal](#module_cbioportal-api-client--module.exports..cbioPortal) : <code>Object</code>
* [.getTypesOfCancer()](#module_cbioportal-api-client--module.exports..cbioPortal+getTypesOfCancer) ⇒ <code>Promise</code>
* [.getCancerStudies()](#module_cbioportal-api-client--module.exports..cbioPortal+getCancerStudies) ⇒ <code>Promise</code>
* [.getGeneticProfiles(query)](#module_cbioportal-api-client--module.exports..cbioPortal+getGeneticProfiles) ⇒ <code>Promise(data)</code>
* [.getCaseLists(query)](#module_cbioportal-api-client--module.exports..cbioPortal+getCaseLists) ⇒ <code>Promise(data)</code>
* [.getProfileData()](#module_cbioportal-api-client--module.exports..cbioPortal+getProfileData) ⇒ <code>Promise(data)</code>
* [~cbioPortal](#module_cbioportal-api-client..cbioPortal) : <code>Object</code>
* [.getTypesOfCancer()](#module_cbioportal-api-client..cbioPortal+getTypesOfCancer) ⇒ <code>Promise</code>
* [.getCancerStudies()](#module_cbioportal-api-client..cbioPortal+getCancerStudies) ⇒ <code>Promise</code>
* [.getGeneticProfiles(query)](#module_cbioportal-api-client..cbioPortal+getGeneticProfiles) ⇒ <code>Promise</code>
* [.getCaseLists(query)](#module_cbioportal-api-client..cbioPortal+getCaseLists) ⇒ <code>Promise</code>
* [.getProfileData(query)](#module_cbioportal-api-client..cbioPortal+getProfileData) ⇒ <code>Promise</code>
<a name="module_cbioportal-api-client--module.exports..cbioPortal+getTypesOfCancer"></a>
##### cbioPortal.getTypesOfCancer() ⇒ <code>Promise</code>
-----
<a name="module_cbioportal-api-client..cbioPortal+getTypesOfCancer"></a>
#### cbioPortal.getTypesOfCancer() ⇒ <code>Promise</code>
Retrieves a list of all the clinical types of cancer stored on the server.
**Kind**: instance method of <code>[cbioPortal](#module_cbioportal-api-client--module.exports..cbioPortal)</code>
**Returns**: <code>Promise</code> - resolves with JSON data
<a name="module_cbioportal-api-client--module.exports..cbioPortal+getCancerStudies"></a>
##### cbioPortal.getCancerStudies() ⇒ <code>Promise</code>
**Kind**: instance method of <code>[cbioPortal](#module_cbioportal-api-client..cbioPortal)</code>
**Returns**: <code>Promise</code> - See fullfills/rejects
**Fulfills**: <code>Array</code> response data converted from TSV to JSON
-----
<a name="module_cbioportal-api-client..cbioPortal+getCancerStudies"></a>
#### cbioPortal.getCancerStudies() ⇒ <code>Promise</code>
Retrieves meta-data regarding cancer studies stored on the server.
**Kind**: instance method of <code>[cbioPortal](#module_cbioportal-api-client--module.exports..cbioPortal)</code>
**Returns**: <code>Promise</code> - resolves with JSON data
<a name="module_cbioportal-api-client--module.exports..cbioPortal+getGeneticProfiles"></a>
##### cbioPortal.getGeneticProfiles(query) ⇒ <code>Promise(data)</code>
**Kind**: instance method of <code>[cbioPortal](#module_cbioportal-api-client..cbioPortal)</code>
**Returns**: <code>Promise</code> - See fullfills/rejects
**Fulfills**: <code>Array</code> response data converted from TSV to JSON
-----
<a name="module_cbioportal-api-client..cbioPortal+getGeneticProfiles"></a>
#### cbioPortal.getGeneticProfiles(query) ⇒ <code>Promise</code>
Retrieves meta-data regarding all genetic profiles, e.g.
mutation or copy number profiles, stored about a specific cancer study.
**Kind**: instance method of <code>[cbioPortal](#module_cbioportal-api-client--module.exports..cbioPortal)</code>
**Returns**: <code>Promise(data)</code> - resolves with JSON data
**Kind**: instance method of <code>[cbioPortal](#module_cbioportal-api-client..cbioPortal)</code>
**Returns**: <code>Promise</code> - See fullfills/rejects
**Fulfills**: <code>Array</code> response data converted from TSV to JSON

@@ -98,4 +175,7 @@ | Param | Type | Description |

<a name="module_cbioportal-api-client--module.exports..cbioPortal+getCaseLists"></a>
##### cbioPortal.getCaseLists(query) ⇒ <code>Promise(data)</code>
-----
<a name="module_cbioportal-api-client..cbioPortal+getCaseLists"></a>
#### cbioPortal.getCaseLists(query) ⇒ <code>Promise</code>
Retrieves meta-data regarding all case lists stored about a specific cancer study.

@@ -107,3 +187,4 @@

**Kind**: instance method of <code>[cbioPortal](#module_cbioportal-api-client--module.exports..cbioPortal)</code>
**Kind**: instance method of <code>[cbioPortal](#module_cbioportal-api-client..cbioPortal)</code>
**Fulfill**: JSON formatted response

@@ -115,10 +196,15 @@ | Param | Type | Description |

<a name="module_cbioportal-api-client--module.exports..cbioPortal+getProfileData"></a>
##### cbioPortal.getProfileData() ⇒ <code>Promise(data)</code>
-----
<a name="module_cbioportal-api-client..cbioPortal+getProfileData"></a>
#### cbioPortal.getProfileData(query) ⇒ <code>Promise</code>
Retrieves genomic profile data for one or more genes.
**Kind**: instance method of <code>[cbioPortal](#module_cbioportal-api-client--module.exports..cbioPortal)</code>
**Kind**: instance method of <code>[cbioPortal](#module_cbioportal-api-client..cbioPortal)</code>
**Fulfill**: JSON formatted response
| Param | Type | Description |
| --- | --- | --- |
| query | <code>Object</code> | |
| options.case_set_id | <code>string</code> | 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. |

@@ -128,1 +214,72 @@ | options.genetic_profile_id | <code>Array.&lt;string&gt;</code> &#124; <code>string</code> | One or more genetic profile IDs |

-----
<a name="module_cbioportal-api-client/utils/convertResponse"></a>
## cbioportal-api-client/utils/convertResponse ⇒ <code>Promise</code>
Converts tab delimited responses to JSON format
**Returns**: <code>Promise</code> - Resolves with the response JSON
| Param | Type | Description |
| --- | --- | --- |
| response | <code>string</code> | TSV string |
-----
<a name="module_cbioportal-api-client/utils/summarizeAlterations"></a>
## cbioportal-api-client/utils/summarizeAlterations
Exports utility functions for summarizing gene alterations
* [cbioportal-api-client/utils/summarizeAlterations](#module_cbioportal-api-client/utils/summarizeAlterations)
* [.summarizeMutations(mutations)](#module_cbioportal-api-client/utils/summarizeAlterations.summarizeMutations) ⇒ <code>Array</code>
* [.summarizeCopyNumberAlterations(copyNumberAlterations)](#module_cbioportal-api-client/utils/summarizeAlterations.summarizeCopyNumberAlterations) ⇒ <code>Array</code>
* [.summarizeAlterations(response)](#module_cbioportal-api-client/utils/summarizeAlterations.summarizeAlterations) ⇒ <code>Promise</code>
-----
<a name="module_cbioportal-api-client/utils/summarizeAlterations.summarizeMutations"></a>
### cbioportal-api-client/utils/summarizeAlterations.summarizeMutations(mutations) ⇒ <code>Array</code>
Summarize mutations
**Kind**: static method of <code>[cbioportal-api-client/utils/summarizeAlterations](#module_cbioportal-api-client/utils/summarizeAlterations)</code>
**Returns**: <code>Array</code> - Array of summaries
| Param | Type | Description |
| --- | --- | --- |
| mutations | <code>Array</code> | Array of mutation rows as parsed by this library |
-----
<a name="module_cbioportal-api-client/utils/summarizeAlterations.summarizeCopyNumberAlterations"></a>
### cbioportal-api-client/utils/summarizeAlterations.summarizeCopyNumberAlterations(copyNumberAlterations) ⇒ <code>Array</code>
Summarize copy number alterations
**Kind**: static method of <code>[cbioportal-api-client/utils/summarizeAlterations](#module_cbioportal-api-client/utils/summarizeAlterations)</code>
**Returns**: <code>Array</code> - Array of summaries
| Param | Type | Description |
| --- | --- | --- |
| copyNumberAlterations | <code>Array</code> | Array of copy number alteration rows as parsed by this library |
-----
<a name="module_cbioportal-api-client/utils/summarizeAlterations.summarizeAlterations"></a>
### cbioportal-api-client/utils/summarizeAlterations.summarizeAlterations(response) ⇒ <code>Promise</code>
Converts tab delimited responses to JSON format
**Kind**: static method of <code>[cbioportal-api-client/utils/summarizeAlterations](#module_cbioportal-api-client/utils/summarizeAlterations)</code>
**Returns**: <code>Promise</code> - Resolves with the response JSON
| Param | Type | Description |
| --- | --- | --- |
| response | <code>string</code> | TSV string |
-----
require('app-module-path').addPath(__dirname + './../');
require('./lib');
require('./utils/summarizeAlterations');

@@ -63,1 +63,15 @@ import Test from 'blue-tape';

});
Test('cbioPortal.getProfileData()', t => {
Nock('http://www.cbioportal.org')
.get('/webservice.do')
.query({ cmd: 'getProfileData', case_set_id: 'gbm_tcga_cnaseq' })
.replyWithFile(200, __dirname + '/responses/getProfileData.tsv');
return cbioPortal.getProfileData({ case_set_id: 'gbm_tcga_cnaseq' })
.then(response => {
t.ok(Array.isArray(response), 'should return an array');
t.ok(response[0].GENE_ID, 'should return profile data');
t.equals(response.length, 1, 'should have a single row');
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc