diff --git a/README.md b/README.md index d311e3c..c93bde2 100644 --- a/README.md +++ b/README.md @@ -69,32 +69,18 @@ $ cbioportal-api-client getProfileData -s gbm_tcga_cnaseq -p gbm_tcga_mutations ## API Reference -## Modules - -
-
cbioportal-api-clientcbioPortal
-

Creates a new cBio Portal API client

-
-
cbioportal-api-client/utils/convertResponsePromise
-

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](#module_cbioportal-api-client..cbioPortal) +**See**: [cbioPortal](#module_cbioportal-api-client..cbioPortal) | Param | Type | Description | | --- | --- | --- | | config | Object | Configuration options object. | | config.includeRaw | Boolean | Include the raw TSV response | -**Example** +**Example** Basic usage: ```javascript @@ -124,8 +110,8 @@ cbioPortal.getCancerStudies() 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](#module_cbioportal-api-client) -**See**: Use [CbioPortal()](#module_cbioportal-api-client) for object creation. +**Kind**: inner constant of [cbioportal-api-client](#module_cbioportal-api-client) +**See**: Use [CbioPortal()](#module_cbioportal-api-client) for object creation. * [~cbioPortal](#module_cbioportal-api-client..cbioPortal) : Object * [.getTypesOfCancer()](#module_cbioportal-api-client..cbioPortal+getTypesOfCancer) ⇒ Promise @@ -141,9 +127,9 @@ when creating an API client object via the module factory method. #### cbioPortal.getTypesOfCancer() ⇒ Promise Retrieves a list of all the clinical types of cancer stored on the server. -**Kind**: instance method of [cbioPortal](#module_cbioportal-api-client..cbioPortal) -**Returns**: Promise - See fullfills/rejects -**Fulfills**: Array response data converted from TSV to JSON +**Kind**: instance method of [cbioPortal](#module_cbioportal-api-client..cbioPortal) +**Returns**: Promise - See fullfills/rejects +**Fulfills**: Array response data converted from TSV to JSON ----- @@ -151,9 +137,9 @@ Retrieves a list of all the clinical types of cancer stored on the server. #### cbioPortal.getCancerStudies() ⇒ Promise Retrieves meta-data regarding cancer studies stored on the server. -**Kind**: instance method of [cbioPortal](#module_cbioportal-api-client..cbioPortal) -**Returns**: Promise - See fullfills/rejects -**Fulfills**: Array response data converted from TSV to JSON +**Kind**: instance method of [cbioPortal](#module_cbioportal-api-client..cbioPortal) +**Returns**: Promise - See fullfills/rejects +**Fulfills**: Array response data converted from TSV to JSON ----- @@ -162,9 +148,9 @@ Retrieves meta-data regarding cancer studies stored on the server. 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](#module_cbioportal-api-client..cbioPortal) -**Returns**: Promise - See fullfills/rejects -**Fulfills**: Array response data converted from TSV to JSON +**Kind**: instance method of [cbioPortal](#module_cbioportal-api-client..cbioPortal) +**Returns**: Promise - See fullfills/rejects +**Fulfills**: Array response data converted from TSV to JSON | Param | Type | Description | | --- | --- | --- | @@ -182,8 +168,8 @@ For example, a within a particular study, only some cases may have sequence data 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](#module_cbioportal-api-client..cbioPortal) -**Fulfill**: JSON formatted response +**Kind**: instance method of [cbioPortal](#module_cbioportal-api-client..cbioPortal) +**Fulfill**: JSON formatted response | Param | Type | Description | | --- | --- | --- | @@ -197,8 +183,8 @@ Multiple case lists may be associated with each cancer study, and this method en #### cbioPortal.getProfileData(query) ⇒ Promise Retrieves genomic profile data for one or more genes. -**Kind**: instance method of [cbioPortal](#module_cbioportal-api-client..cbioPortal) -**Fulfill**: JSON formatted response +**Kind**: instance method of [cbioPortal](#module_cbioportal-api-client..cbioPortal) +**Fulfill**: JSON formatted response | Param | Type | Description | | --- | --- | --- | @@ -210,71 +196,3 @@ Retrieves genomic profile data for one or more genes. ----- - -## 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](#module_cbioportal-api-client/utils/summarizeAlterations) - * [.summarizeMutations(mutations)](#module_cbioportal-api-client/utils/summarizeAlterations.summarizeMutations) ⇒ Array - * [.summarizeCopyNumberAlterations(copyNumberAlterations)](#module_cbioportal-api-client/utils/summarizeAlterations.summarizeCopyNumberAlterations) ⇒ Array - * [.summarizeAlterations(response)](#module_cbioportal-api-client/utils/summarizeAlterations.summarizeAlterations) ⇒ Promise - - ------ - - -### cbioportal-api-client/utils/summarizeAlterations.summarizeMutations(mutations) ⇒ Array -Summarize mutations - -**Kind**: static method of [cbioportal-api-client/utils/summarizeAlterations](#module_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](#module_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](#module_cbioportal-api-client/utils/summarizeAlterations) -**Returns**: Promise - Resolves with the response JSON - -| Param | Type | Description | -| --- | --- | --- | -| response | string | TSV string | - - ------ - diff --git a/lib/utils/index.js b/lib/utils/index.js index 7e40883..55249ca 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -1,4 +1,4 @@ -import SummarizeAlterations from './summarizeAlterations'; +import * as SummarizeAlterations from './summarizeAlterations'; import ConvertResponse from './convertResponse'; export const summarizeAlterations = SummarizeAlterations; diff --git a/lib/utils/summarizeAlterations.js b/lib/utils/summarizeAlterations.js index ee2fd15..db8fc09 100644 --- a/lib/utils/summarizeAlterations.js +++ b/lib/utils/summarizeAlterations.js @@ -11,7 +11,14 @@ import _merge from 'lodash/merge'; /** * Exports utility functions for summarizing gene alterations * - * @exports summarizeAlterations + * @example + * ```javascript + * import { + * summarizeMutations, + * summarize + * } from 'cbioportal-api-client/dist/utils/summarizeAlterations'; + * ``` + * * @module cbioportal-api-client/utils/summarizeAlterations */ diff --git a/package.json b/package.json index 0cc0f51..117d7ab 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "coverage": "npm run clean:coverage && babel-node node_modules/.bin/isparta cover --report lcov --report text --report html test/index.js", "coveralls": "cat ./coverage/lcov.info | coveralls", "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 -d 2 --partial \"./docs/partials/**/*.hbs\" --separators -l JavaScript > README.md", + "docs": "jsdoc2md --src \"lib/index.js\" -t docs/README.md.hbs -d 2 --partial \"./docs/partials/**/*.hbs\" --separators -l JavaScript > README.md", "lint": "eslint lib", "precommit": "npm run docs", "prepublish": "in-publish && npm run build || not-in-publish",