From 4c2f184407e43706e09054de16377c5c091447b3 Mon Sep 17 00:00:00 2001 From: Jason Hwee <1216418+hweej@users.noreply.github.com> Date: Sat, 26 Oct 2024 23:24:59 -0400 Subject: [PATCH 1/8] Modify FilesAndLinks table to use the new resource-data-all endpoint. --- .../studyView/resources/FilesAndLinks.tsx | 73 ++++++++++++++++--- 1 file changed, 64 insertions(+), 9 deletions(-) diff --git a/src/pages/studyView/resources/FilesAndLinks.tsx b/src/pages/studyView/resources/FilesAndLinks.tsx index ec4a728d121..8e171a80283 100644 --- a/src/pages/studyView/resources/FilesAndLinks.tsx +++ b/src/pages/studyView/resources/FilesAndLinks.tsx @@ -34,6 +34,26 @@ class FilesLinksTableComponent extends LazyMobXTable<{ const RECORD_LIMIT = 500; +function getResourceDataOfEntireStudy(studyClinicalData: { + [uniqueSampleKey: string]: ClinicalData[]; +}) { + // Need a better way to get just the studyId + const studyId = Object.values(studyClinicalData)[0][0]['studyId']; + + const allResources = internalClient.getAllStudyResourceDataInStudyPatientSampleUsingGET( + { + studyId: studyId, + projection: 'DETAILED', + } + ); + console.log(allResources); + // Need to filter out allResources to only the patients selected in the + // studyClinicalData + // TODO + + return allResources; +} + function getResourceDataOfPatients(studyClinicalData: { [uniqueSampleKey: string]: ClinicalData[]; }) { @@ -49,6 +69,7 @@ function getResourceDataOfPatients(studyClinicalData: { ) .flatten() .value(); + console.log(resourcesPerPatient); // All PROMISES return Promise.all(resourcesPerPatient).then(resourcesPerPatient => _(resourcesPerPatient) @@ -97,7 +118,7 @@ function buildItemsAndResources(resourceData: { async function fetchFilesLinksData( filters: StudyViewFilter, - sampleIdResourceData: { [sampleId: string]: ResourceData[] }, + // sampleIdResourceData: { [sampleId: string]: ResourceData[] }, searchTerm: string | undefined, sortAttributeId: string | undefined, sortDirection: 'asc' | 'desc' | undefined, @@ -112,18 +133,52 @@ async function fetchFilesLinksData( 0 ); - const resourcesForPatients = await getResourceDataOfPatients( + // Fetching resource data of patients + // const resourcesForPatients = await getResourceDataOfPatients( + // studyClinicalDataResponse.data // The studyViewFilterdata. The 42 patients + // ); + + const resourcesForEntireStudy = await getResourceDataOfEntireStudy( + // The studyViewFilterdata. The 42 patients, do we still need this if we only need the study id? Yes, we need to filter down to only these patients studyClinicalDataResponse.data ); - const resourcesForPatientsAndSamples: { [key: string]: ResourceData[] } = { - ...sampleIdResourceData, - ...resourcesForPatients, - }; + console.log('resourcesForEntireStudy', resourcesForEntireStudy); + + const reduced = resourcesForEntireStudy.reduce( + (map: { [key: string]: ResourceData[] }, resource) => { + if (resource.resourceDefinition.resourceType == 'PATIENT') { + if (map.hasOwnProperty(resource.patientId)) { + map[resource.patientId].push(resource); + } else { + map[resource.patientId] = [resource]; + } + } else if (resource.resourceDefinition.resourceType == 'SAMPLE') { + if (map.hasOwnProperty(resource.sampleId)) { + map[resource.sampleId].push(resource); + } else { + map[resource.sampleId] = [resource]; + } + } + + return map; + }, + {} + ); + console.log('Reduced', reduced); + + // console.log("resourcesForPatients", resourcesForPatients); + + // const resourcesForPatientsAndSamples: { [key: string]: ResourceData[] } = { + // ...sampleIdResourceData, + // ...resourcesForPatients, + // }; // we create objects with the necessary properties for each resource // calculate the total number of resources per patient. + // console.log("resourcesForPatientsAndSamples", resourcesForPatientsAndSamples); const { resourcesPerPatient, items } = buildItemsAndResources( - resourcesForPatientsAndSamples + // resourcesForPatientsAndSamples + reduced ); // set the number of resources available per patient. @@ -197,7 +252,7 @@ export class FilesAndLinks extends React.Component { await: () => [ this.props.store.selectedSamples, this.props.store.resourceDefinitions, - this.props.store.sampleResourceData, + // this.props.store.sampleResourceData, ], onError: () => {}, invoke: async () => { @@ -207,7 +262,7 @@ export class FilesAndLinks extends React.Component { const resources = await fetchFilesLinksData( this.props.store.filters, - this.props.store.sampleResourceData.result!, + // this.props.store.sampleResourceData.result!, this.searchTerm, 'patientId', 'asc', From e6da0c715938be59204f4f78022bab38793909f4 Mon Sep 17 00:00:00 2001 From: Jason Hwee <1216418+hweej@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:19:06 -0400 Subject: [PATCH 2/8] Add filtering logic based off studyview sample selection --- .../studyView/resources/FilesAndLinks.tsx | 66 ++++++++----------- 1 file changed, 28 insertions(+), 38 deletions(-) diff --git a/src/pages/studyView/resources/FilesAndLinks.tsx b/src/pages/studyView/resources/FilesAndLinks.tsx index 8e171a80283..073ed3f282c 100644 --- a/src/pages/studyView/resources/FilesAndLinks.tsx +++ b/src/pages/studyView/resources/FilesAndLinks.tsx @@ -39,18 +39,12 @@ function getResourceDataOfEntireStudy(studyClinicalData: { }) { // Need a better way to get just the studyId const studyId = Object.values(studyClinicalData)[0][0]['studyId']; - const allResources = internalClient.getAllStudyResourceDataInStudyPatientSampleUsingGET( { studyId: studyId, projection: 'DETAILED', } ); - console.log(allResources); - // Need to filter out allResources to only the patients selected in the - // studyClinicalData - // TODO - return allResources; } @@ -69,7 +63,6 @@ function getResourceDataOfPatients(studyClinicalData: { ) .flatten() .value(); - console.log(resourcesPerPatient); // All PROMISES return Promise.all(resourcesPerPatient).then(resourcesPerPatient => _(resourcesPerPatient) @@ -118,6 +111,7 @@ function buildItemsAndResources(resourceData: { async function fetchFilesLinksData( filters: StudyViewFilter, + selectedSamples: Array, // sampleIdResourceData: { [sampleId: string]: ResourceData[] }, searchTerm: string | undefined, sortAttributeId: string | undefined, @@ -133,52 +127,46 @@ async function fetchFilesLinksData( 0 ); - // Fetching resource data of patients - // const resourcesForPatients = await getResourceDataOfPatients( - // studyClinicalDataResponse.data // The studyViewFilterdata. The 42 patients - // ); + const selectedSamplesList = selectedSamples.map(item => item.sampleId); + const selectedPatientsList = [ + ...new Set(selectedSamples.map(item => item.patientId)), + ]; const resourcesForEntireStudy = await getResourceDataOfEntireStudy( - // The studyViewFilterdata. The 42 patients, do we still need this if we only need the study id? Yes, we need to filter down to only these patients studyClinicalDataResponse.data ); - console.log('resourcesForEntireStudy', resourcesForEntireStudy); - const reduced = resourcesForEntireStudy.reduce( - (map: { [key: string]: ResourceData[] }, resource) => { - if (resource.resourceDefinition.resourceType == 'PATIENT') { - if (map.hasOwnProperty(resource.patientId)) { - map[resource.patientId].push(resource); + const resourcesForPatientsAndSamples = resourcesForEntireStudy + .filter( + resource => + selectedSamplesList.includes(resource.sampleId) || + selectedPatientsList.includes(resource.patientId) + ) + .reduce((idMap: { [key: string]: ResourceData[] }, resource) => { + const { resourceType } = resource.resourceDefinition; + const { patientId, sampleId } = resource; + + if (resourceType == 'PATIENT') { + if (idMap.hasOwnProperty(patientId)) { + idMap[patientId].push(resource); } else { - map[resource.patientId] = [resource]; + idMap[patientId] = [resource]; } - } else if (resource.resourceDefinition.resourceType == 'SAMPLE') { - if (map.hasOwnProperty(resource.sampleId)) { - map[resource.sampleId].push(resource); + } else if (resourceType == 'SAMPLE') { + if (idMap.hasOwnProperty(sampleId)) { + idMap[sampleId].push(resource); } else { - map[resource.sampleId] = [resource]; + idMap[sampleId] = [resource]; } } - return map; - }, - {} - ); - console.log('Reduced', reduced); - - // console.log("resourcesForPatients", resourcesForPatients); - - // const resourcesForPatientsAndSamples: { [key: string]: ResourceData[] } = { - // ...sampleIdResourceData, - // ...resourcesForPatients, - // }; + return idMap; + }, {}); // we create objects with the necessary properties for each resource // calculate the total number of resources per patient. - // console.log("resourcesForPatientsAndSamples", resourcesForPatientsAndSamples); const { resourcesPerPatient, items } = buildItemsAndResources( - // resourcesForPatientsAndSamples - reduced + resourcesForPatientsAndSamples ); // set the number of resources available per patient. @@ -262,12 +250,14 @@ export class FilesAndLinks extends React.Component { const resources = await fetchFilesLinksData( this.props.store.filters, + this.props.store.selectedSamples.result, // this.props.store.sampleResourceData.result!, this.searchTerm, 'patientId', 'asc', RECORD_LIMIT ); + return Promise.resolve(resources); }, }); From 4ef97bf6b50d564aed6c1e99f05e0a13f30c83ef Mon Sep 17 00:00:00 2001 From: Jason Hwee <1216418+hweej@users.noreply.github.com> Date: Mon, 28 Oct 2024 18:53:14 -0400 Subject: [PATCH 3/8] Add missing typescript types --- .../studyView/resources/FilesAndLinks.tsx | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/src/pages/studyView/resources/FilesAndLinks.tsx b/src/pages/studyView/resources/FilesAndLinks.tsx index 073ed3f282c..51b165e7d9a 100644 --- a/src/pages/studyView/resources/FilesAndLinks.tsx +++ b/src/pages/studyView/resources/FilesAndLinks.tsx @@ -138,30 +138,36 @@ async function fetchFilesLinksData( const resourcesForPatientsAndSamples = resourcesForEntireStudy .filter( - resource => + (resource: ResourceData) => selectedSamplesList.includes(resource.sampleId) || selectedPatientsList.includes(resource.patientId) ) - .reduce((idMap: { [key: string]: ResourceData[] }, resource) => { - const { resourceType } = resource.resourceDefinition; - const { patientId, sampleId } = resource; - - if (resourceType == 'PATIENT') { - if (idMap.hasOwnProperty(patientId)) { - idMap[patientId].push(resource); - } else { - idMap[patientId] = [resource]; - } - } else if (resourceType == 'SAMPLE') { - if (idMap.hasOwnProperty(sampleId)) { - idMap[sampleId].push(resource); - } else { - idMap[sampleId] = [resource]; + .reduce( + ( + idMap: { [key: string]: ResourceData[] }, + resource: ResourceData + ) => { + const { resourceType } = resource.resourceDefinition; + const { patientId, sampleId } = resource; + + if (resourceType == 'PATIENT') { + if (idMap.hasOwnProperty(patientId)) { + idMap[patientId].push(resource); + } else { + idMap[patientId] = [resource]; + } + } else if (resourceType == 'SAMPLE') { + if (idMap.hasOwnProperty(sampleId)) { + idMap[sampleId].push(resource); + } else { + idMap[sampleId] = [resource]; + } } - } - return idMap; - }, {}); + return idMap; + }, + {} + ); // we create objects with the necessary properties for each resource // calculate the total number of resources per patient. From e029bb0f375250664fa5aa1c0042c6d9241c8441 Mon Sep 17 00:00:00 2001 From: Jason Hwee <1216418+hweej@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:19:37 -0400 Subject: [PATCH 4/8] Remove clinicalData request, rename variables, add relevant comments on filtering, clean up code superfluous comments. --- .../studyView/resources/FilesAndLinks.tsx | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/pages/studyView/resources/FilesAndLinks.tsx b/src/pages/studyView/resources/FilesAndLinks.tsx index 51b165e7d9a..25998a56fef 100644 --- a/src/pages/studyView/resources/FilesAndLinks.tsx +++ b/src/pages/studyView/resources/FilesAndLinks.tsx @@ -34,11 +34,10 @@ class FilesLinksTableComponent extends LazyMobXTable<{ const RECORD_LIMIT = 500; -function getResourceDataOfEntireStudy(studyClinicalData: { - [uniqueSampleKey: string]: ClinicalData[]; -}) { - // Need a better way to get just the studyId - const studyId = Object.values(studyClinicalData)[0][0]['studyId']; +function getResourceDataOfEntireStudy(studyIds: string[]) { + // Only handle the first studyId for now. Can be expanded to make a call per + // studyId. + const studyId = studyIds[0]; const allResources = internalClient.getAllStudyResourceDataInStudyPatientSampleUsingGET( { studyId: studyId, @@ -112,7 +111,6 @@ function buildItemsAndResources(resourceData: { async function fetchFilesLinksData( filters: StudyViewFilter, selectedSamples: Array, - // sampleIdResourceData: { [sampleId: string]: ResourceData[] }, searchTerm: string | undefined, sortAttributeId: string | undefined, sortDirection: 'asc' | 'desc' | undefined, @@ -127,20 +125,25 @@ async function fetchFilesLinksData( 0 ); - const selectedSamplesList = selectedSamples.map(item => item.sampleId); - const selectedPatientsList = [ + const selectedStudyIds = [ + ...new Set(selectedSamples.map(item => item.studyId)), + ]; + const selectedSampleIds = selectedSamples.map(item => item.sampleId); + const selectedPatientIds = [ ...new Set(selectedSamples.map(item => item.patientId)), ]; const resourcesForEntireStudy = await getResourceDataOfEntireStudy( - studyClinicalDataResponse.data + selectedStudyIds ); const resourcesForPatientsAndSamples = resourcesForEntireStudy + // Filter the resources to consist of only studyView selected samples + // Also keep patient level resources (e.g. Those don't have a sampleId) .filter( (resource: ResourceData) => - selectedSamplesList.includes(resource.sampleId) || - selectedPatientsList.includes(resource.patientId) + selectedSampleIds.includes(resource.sampleId) || + selectedPatientIds.includes(resource.patientId) ) .reduce( ( @@ -246,7 +249,6 @@ export class FilesAndLinks extends React.Component { await: () => [ this.props.store.selectedSamples, this.props.store.resourceDefinitions, - // this.props.store.sampleResourceData, ], onError: () => {}, invoke: async () => { @@ -257,7 +259,6 @@ export class FilesAndLinks extends React.Component { const resources = await fetchFilesLinksData( this.props.store.filters, this.props.store.selectedSamples.result, - // this.props.store.sampleResourceData.result!, this.searchTerm, 'patientId', 'asc', From c4f1df8ec047e28cc1cce8a9f4568150f6c93f5d Mon Sep 17 00:00:00 2001 From: Jason Hwee <1216418+hweej@users.noreply.github.com> Date: Wed, 30 Oct 2024 13:46:24 -0400 Subject: [PATCH 5/8] Update linear array lookup to a key Map lookup for optimization. Replace filter and reduce with lodash groupBy. --- .../studyView/resources/FilesAndLinks.tsx | 51 +++++-------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/src/pages/studyView/resources/FilesAndLinks.tsx b/src/pages/studyView/resources/FilesAndLinks.tsx index 25998a56fef..7ac0dfee1df 100644 --- a/src/pages/studyView/resources/FilesAndLinks.tsx +++ b/src/pages/studyView/resources/FilesAndLinks.tsx @@ -128,49 +128,26 @@ async function fetchFilesLinksData( const selectedStudyIds = [ ...new Set(selectedSamples.map(item => item.studyId)), ]; - const selectedSampleIds = selectedSamples.map(item => item.sampleId); - const selectedPatientIds = [ - ...new Set(selectedSamples.map(item => item.patientId)), - ]; + // sampleIds (+patientIds) for the selectedSamples + const selectedIds = new Map([ + ...new Map(selectedSamples.map(item => [item.sampleId, item.studyId])), + ...new Map(selectedSamples.map(item => [item.patientId, item.studyId])), + ]); + + // Fetch resources for entire study const resourcesForEntireStudy = await getResourceDataOfEntireStudy( selectedStudyIds ); - const resourcesForPatientsAndSamples = resourcesForEntireStudy - // Filter the resources to consist of only studyView selected samples - // Also keep patient level resources (e.g. Those don't have a sampleId) - .filter( - (resource: ResourceData) => - selectedSampleIds.includes(resource.sampleId) || - selectedPatientIds.includes(resource.patientId) + // Filter the resources to consist of only studyView selected samples + // Also keep patient level resources (e.g. Those don't have a sampleId) + const resourcesForPatientsAndSamples = _(resourcesForEntireStudy) + .filter(resource => + selectedIds.has(resource.sampleId || resource.patientId) ) - .reduce( - ( - idMap: { [key: string]: ResourceData[] }, - resource: ResourceData - ) => { - const { resourceType } = resource.resourceDefinition; - const { patientId, sampleId } = resource; - - if (resourceType == 'PATIENT') { - if (idMap.hasOwnProperty(patientId)) { - idMap[patientId].push(resource); - } else { - idMap[patientId] = [resource]; - } - } else if (resourceType == 'SAMPLE') { - if (idMap.hasOwnProperty(sampleId)) { - idMap[sampleId].push(resource); - } else { - idMap[sampleId] = [resource]; - } - } - - return idMap; - }, - {} - ); + .groupBy('patientId') + .value(); // we create objects with the necessary properties for each resource // calculate the total number of resources per patient. From f8aff8107250a767661f3ee83c1450e4ef8e710d Mon Sep 17 00:00:00 2001 From: Jason Hwee <1216418+hweej@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:12:20 -0400 Subject: [PATCH 6/8] Exchange string for actual property for typesafety. --- src/pages/studyView/resources/FilesAndLinks.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/studyView/resources/FilesAndLinks.tsx b/src/pages/studyView/resources/FilesAndLinks.tsx index 7ac0dfee1df..2f9ddb75404 100644 --- a/src/pages/studyView/resources/FilesAndLinks.tsx +++ b/src/pages/studyView/resources/FilesAndLinks.tsx @@ -146,7 +146,7 @@ async function fetchFilesLinksData( .filter(resource => selectedIds.has(resource.sampleId || resource.patientId) ) - .groupBy('patientId') + .groupBy(r => r.patientId) .value(); // we create objects with the necessary properties for each resource From 07f04bb8dd34e0eeff23a846b09c5f16b247793a Mon Sep 17 00:00:00 2001 From: Jason Hwee <1216418+hweej@users.noreply.github.com> Date: Thu, 31 Oct 2024 12:35:52 -0400 Subject: [PATCH 7/8] Remove unnecessary Map instantiation --- src/pages/studyView/resources/FilesAndLinks.tsx | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/pages/studyView/resources/FilesAndLinks.tsx b/src/pages/studyView/resources/FilesAndLinks.tsx index 2f9ddb75404..bc619c96984 100644 --- a/src/pages/studyView/resources/FilesAndLinks.tsx +++ b/src/pages/studyView/resources/FilesAndLinks.tsx @@ -14,7 +14,6 @@ import { getSampleViewUrlWithPathname, getPatientViewUrlWithPathname, } from 'shared/api/urls'; -import { getAllClinicalDataByStudyViewFilter } from '../StudyViewUtils'; import { StudyViewPageStore } from 'pages/studyView/StudyViewPageStore'; import { isUrl, remoteData } from 'cbioportal-frontend-commons'; import { makeObservable, observable, computed } from 'mobx'; @@ -116,23 +115,14 @@ async function fetchFilesLinksData( sortDirection: 'asc' | 'desc' | undefined, recordLimit: number ) { - const studyClinicalDataResponse = await getAllClinicalDataByStudyViewFilter( - filters, - searchTerm, - sortAttributeId, - sortDirection, - recordLimit, - 0 - ); - const selectedStudyIds = [ ...new Set(selectedSamples.map(item => item.studyId)), ]; // sampleIds (+patientIds) for the selectedSamples const selectedIds = new Map([ - ...new Map(selectedSamples.map(item => [item.sampleId, item.studyId])), - ...new Map(selectedSamples.map(item => [item.patientId, item.studyId])), + ...selectedSamples.map(item => [item.sampleId, item.studyId] as const), + ...selectedSamples.map(item => [item.patientId, item.studyId] as const), ]); // Fetch resources for entire study From 42ea8276bfb8c83347cc72bf2550ade725f5daf9 Mon Sep 17 00:00:00 2001 From: Jason Hwee <1216418+hweej@users.noreply.github.com> Date: Fri, 1 Nov 2024 14:49:47 -0400 Subject: [PATCH 8/8] Add latest typescript api definition files --- .../generated/CBioPortalAPIInternal-docs.json | 97 +++++++++++ .../src/generated/CBioPortalAPIInternal.ts | 153 ++++++++++++++++++ .../src/generated/GenomeNexusAPI-docs.json | 9 ++ .../src/generated/GenomeNexusAPI.ts | 4 + .../src/generated/OncoKbAPI-docs.json | 41 +++-- .../src/generated/OncoKbAPI.ts | 12 ++ 6 files changed, 306 insertions(+), 10 deletions(-) diff --git a/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal-docs.json b/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal-docs.json index b4a4c0dc49e..31052fbd0ac 100644 --- a/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal-docs.json +++ b/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal-docs.json @@ -2831,6 +2831,103 @@ "operationId": "getAllStudyResourceDataInStudyUsingGET" } }, + "/api/studies/{studyId}/resource-data-all": { + "get": { + "produces": [ + "application/json" + ], + "parameters": [ + { + "description": "Study ID e.g. acc_tcga", + "in": "path", + "name": "studyId", + "required": true, + "type": "string" + }, + { + "description": "Resource ID", + "in": "query", + "name": "resourceId", + "required": false, + "type": "string" + }, + { + "default": "SUMMARY", + "description": "Level of detail of the response", + "enum": [ + "ID", + "SUMMARY", + "DETAILED", + "META" + ], + "in": "query", + "name": "projection", + "required": false, + "type": "string" + }, + { + "default": 10000000, + "description": "Page size of the result list", + "format": "int32", + "in": "query", + "maximum": 10000000, + "minimum": 1, + "name": "pageSize", + "required": false, + "type": "integer" + }, + { + "default": 0, + "description": "Page number of the result list", + "format": "int32", + "in": "query", + "minimum": 0, + "name": "pageNumber", + "required": false, + "type": "integer" + }, + { + "description": "Name of the property that the result list is sorted by", + "enum": [ + "ResourceId", + "url" + ], + "in": "query", + "name": "sortBy", + "required": false, + "type": "string" + }, + { + "default": "ASC", + "description": "Direction of the sort", + "enum": [ + "ASC", + "DESC" + ], + "in": "query", + "name": "direction", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "items": { + "$ref": "#/definitions/ResourceData" + }, + "type": "array" + } + } + }, + "tags": [ + "Resource Data" + ], + "description": "Get all resource data for for all patients and all samples within a study", + "operationId": "getAllStudyResourceDataInStudyPatientSampleUsingGET" + } + }, "/api/studies/{studyId}/resource-definitions": { "get": { "produces": [ diff --git a/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal.ts b/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal.ts index d6793bfaaa4..7db0e3b4e3f 100644 --- a/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal.ts +++ b/packages/cbioportal-ts-api-client/src/generated/CBioPortalAPIInternal.ts @@ -6746,6 +6746,159 @@ export default class CBioPortalAPIInternal { return response.body; }); }; + getAllStudyResourceDataInStudyPatientSampleUsingGETURL(parameters: { + 'studyId': string, + 'resourceId' ? : string, + 'projection' ? : "ID" | "SUMMARY" | "DETAILED" | "META", + 'pageSize' ? : number, + 'pageNumber' ? : number, + 'sortBy' ? : "ResourceId" | "url", + 'direction' ? : "ASC" | "DESC", + $queryParameters ? : any + }): string { + let queryParameters: any = {}; + let path = '/api/studies/{studyId}/resource-data-all'; + + path = path.replace('{studyId}', parameters['studyId'] + ''); + if (parameters['resourceId'] !== undefined) { + queryParameters['resourceId'] = parameters['resourceId']; + } + + if (parameters['projection'] !== undefined) { + queryParameters['projection'] = parameters['projection']; + } + + if (parameters['pageSize'] !== undefined) { + queryParameters['pageSize'] = parameters['pageSize']; + } + + if (parameters['pageNumber'] !== undefined) { + queryParameters['pageNumber'] = parameters['pageNumber']; + } + + if (parameters['sortBy'] !== undefined) { + queryParameters['sortBy'] = parameters['sortBy']; + } + + if (parameters['direction'] !== undefined) { + queryParameters['direction'] = parameters['direction']; + } + + if (parameters.$queryParameters) { + Object.keys(parameters.$queryParameters).forEach(function(parameterName) { + var parameter = parameters.$queryParameters[parameterName]; + queryParameters[parameterName] = parameter; + }); + } + let keys = Object.keys(queryParameters); + return this.domain + path + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(queryParameters[key])).join('&')) : ''); + }; + + /** + * Get all resource data for for all patients and all samples within a study + * @method + * @name CBioPortalAPIInternal#getAllStudyResourceDataInStudyPatientSampleUsingGET + * @param {string} studyId - Study ID e.g. acc_tcga + * @param {string} resourceId - Resource ID + * @param {string} projection - Level of detail of the response + * @param {integer} pageSize - Page size of the result list + * @param {integer} pageNumber - Page number of the result list + * @param {string} sortBy - Name of the property that the result list is sorted by + * @param {string} direction - Direction of the sort + */ + getAllStudyResourceDataInStudyPatientSampleUsingGETWithHttpInfo(parameters: { + 'studyId': string, + 'resourceId' ? : string, + 'projection' ? : "ID" | "SUMMARY" | "DETAILED" | "META", + 'pageSize' ? : number, + 'pageNumber' ? : number, + 'sortBy' ? : "ResourceId" | "url", + 'direction' ? : "ASC" | "DESC", + $queryParameters ? : any, + $domain ? : string + }): Promise < request.Response > { + const domain = parameters.$domain ? parameters.$domain : this.domain; + const errorHandlers = this.errorHandlers; + const request = this.request; + let path = '/api/studies/{studyId}/resource-data-all'; + let body: any; + let queryParameters: any = {}; + let headers: any = {}; + let form: any = {}; + return new Promise(function(resolve, reject) { + headers['Accept'] = 'application/json'; + + path = path.replace('{studyId}', parameters['studyId'] + ''); + + if (parameters['studyId'] === undefined) { + reject(new Error('Missing required parameter: studyId')); + return; + } + + if (parameters['resourceId'] !== undefined) { + queryParameters['resourceId'] = parameters['resourceId']; + } + + if (parameters['projection'] !== undefined) { + queryParameters['projection'] = parameters['projection']; + } + + if (parameters['pageSize'] !== undefined) { + queryParameters['pageSize'] = parameters['pageSize']; + } + + if (parameters['pageNumber'] !== undefined) { + queryParameters['pageNumber'] = parameters['pageNumber']; + } + + if (parameters['sortBy'] !== undefined) { + queryParameters['sortBy'] = parameters['sortBy']; + } + + if (parameters['direction'] !== undefined) { + queryParameters['direction'] = parameters['direction']; + } + + if (parameters.$queryParameters) { + Object.keys(parameters.$queryParameters).forEach(function(parameterName) { + var parameter = parameters.$queryParameters[parameterName]; + queryParameters[parameterName] = parameter; + }); + } + + request('GET', domain + path, body, headers, queryParameters, form, reject, resolve, errorHandlers); + + }); + }; + + /** + * Get all resource data for for all patients and all samples within a study + * @method + * @name CBioPortalAPIInternal#getAllStudyResourceDataInStudyPatientSampleUsingGET + * @param {string} studyId - Study ID e.g. acc_tcga + * @param {string} resourceId - Resource ID + * @param {string} projection - Level of detail of the response + * @param {integer} pageSize - Page size of the result list + * @param {integer} pageNumber - Page number of the result list + * @param {string} sortBy - Name of the property that the result list is sorted by + * @param {string} direction - Direction of the sort + */ + getAllStudyResourceDataInStudyPatientSampleUsingGET(parameters: { + 'studyId': string, + 'resourceId' ? : string, + 'projection' ? : "ID" | "SUMMARY" | "DETAILED" | "META", + 'pageSize' ? : number, + 'pageNumber' ? : number, + 'sortBy' ? : "ResourceId" | "url", + 'direction' ? : "ASC" | "DESC", + $queryParameters ? : any, + $domain ? : string + }): Promise < Array < ResourceData > + > { + return this.getAllStudyResourceDataInStudyPatientSampleUsingGETWithHttpInfo(parameters).then(function(response: request.Response) { + return response.body; + }); + }; getAllResourceDefinitionsInStudyUsingGETURL(parameters: { 'studyId': string, 'projection' ? : "ID" | "SUMMARY" | "DETAILED" | "META", diff --git a/packages/genome-nexus-ts-api-client/src/generated/GenomeNexusAPI-docs.json b/packages/genome-nexus-ts-api-client/src/generated/GenomeNexusAPI-docs.json index 491e0aff186..6b4d73499e4 100644 --- a/packages/genome-nexus-ts-api-client/src/generated/GenomeNexusAPI-docs.json +++ b/packages/genome-nexus-ts-api-client/src/generated/GenomeNexusAPI-docs.json @@ -1606,6 +1606,15 @@ }, "ncitCode": { "type": "string" + }, + "synonyms": { + "type": "array", + "items": { + "type": "string" + } + }, + "uuid": { + "type": "string" } } }, diff --git a/packages/genome-nexus-ts-api-client/src/generated/GenomeNexusAPI.ts b/packages/genome-nexus-ts-api-client/src/generated/GenomeNexusAPI.ts index bf182857798..728174a2711 100644 --- a/packages/genome-nexus-ts-api-client/src/generated/GenomeNexusAPI.ts +++ b/packages/genome-nexus-ts-api-client/src/generated/GenomeNexusAPI.ts @@ -192,6 +192,10 @@ export type Drug = { 'ncitCode': string + 'synonyms': Array < string > + + 'uuid': string + }; export type EnsemblFilter = { 'geneIds': Array < string > diff --git a/packages/oncokb-ts-api-client/src/generated/OncoKbAPI-docs.json b/packages/oncokb-ts-api-client/src/generated/OncoKbAPI-docs.json index 731757ff0bc..312261803f0 100644 --- a/packages/oncokb-ts-api-client/src/generated/OncoKbAPI-docs.json +++ b/packages/oncokb-ts-api-client/src/generated/OncoKbAPI-docs.json @@ -112,7 +112,7 @@ "400": { "description": "Error, error message will be given.", "schema": { - "type": "string" + "$ref": "#/definitions/ApiHttpError" } } } @@ -157,7 +157,7 @@ "400": { "description": "Error, error message will be given.", "schema": { - "type": "string" + "$ref": "#/definitions/ApiHttpError" } } } @@ -218,7 +218,7 @@ "400": { "description": "Error, error message will be given.", "schema": { - "type": "string" + "$ref": "#/definitions/ApiHttpError" } } } @@ -263,7 +263,7 @@ "400": { "description": "Error, error message will be given.", "schema": { - "type": "string" + "$ref": "#/definitions/ApiHttpError" } } } @@ -324,7 +324,7 @@ "400": { "description": "Error, error message will be given.", "schema": { - "type": "string" + "$ref": "#/definitions/ApiHttpError" } } } @@ -369,7 +369,7 @@ "400": { "description": "Error, error message will be given.", "schema": { - "type": "string" + "$ref": "#/definitions/ApiHttpError" } } } @@ -480,7 +480,7 @@ "400": { "description": "Error, error message will be given.", "schema": { - "type": "string" + "$ref": "#/definitions/ApiHttpError" } } } @@ -525,7 +525,7 @@ "400": { "description": "Error, error message will be given.", "schema": { - "type": "string" + "$ref": "#/definitions/ApiHttpError" } } } @@ -633,7 +633,7 @@ "400": { "description": "Error, error message will be given.", "schema": { - "type": "string" + "$ref": "#/definitions/ApiHttpError" } } } @@ -678,7 +678,7 @@ "400": { "description": "Error, error message will be given.", "schema": { - "type": "string" + "$ref": "#/definitions/ApiHttpError" } } } @@ -1177,6 +1177,27 @@ } } }, + "ApiHttpError": { + "type": "object", + "properties": { + "detail": { + "type": "string" + }, + "message": { + "type": "string" + }, + "path": { + "type": "string" + }, + "status": { + "type": "integer", + "format": "int32" + }, + "title": { + "type": "string" + } + } + }, "CancerGene": { "type": "object", "properties": { diff --git a/packages/oncokb-ts-api-client/src/generated/OncoKbAPI.ts b/packages/oncokb-ts-api-client/src/generated/OncoKbAPI.ts index 05678a1b934..7719c131c06 100644 --- a/packages/oncokb-ts-api-client/src/generated/OncoKbAPI.ts +++ b/packages/oncokb-ts-api-client/src/generated/OncoKbAPI.ts @@ -78,6 +78,18 @@ export type QueryGene = { 'hugoSymbol': string +}; +export type ApiHttpError = { + 'detail': string + + 'message': string + + 'path': string + + 'status': number + + 'title': string + }; export type CancerGene = { 'entrezGeneId': number