From 25bdd5574ef254972ad9a98bb1a197df402daf16 Mon Sep 17 00:00:00 2001 From: Ana Mailyan Date: Sat, 30 Mar 2019 21:08:30 +0000 Subject: [PATCH 1/5] Adding HPFS metadata_participant fields to Cases Table, fixing links on Projects, Files, Cases pages --- data/schema.graphql | 45 ++++++++++++++++++ .../CaseAggregations/CaseAggregations.js | 24 ++++++++++ .../CaseAggregations.relay.js | 18 ++++++++ .../FilesTable/FilesTable.model.js | 5 +- .../ProjectsTable/ProjectsTable.model.js | 2 +- .../RepoCasesTable/RepoCasesTable.model.js | 46 ++++++++++++++++--- .../RepoCasesTable/RepoCasesTable.relay.js | 10 ++++ src/packages/@ncigdc/utils/constants.js | 2 +- 8 files changed, 141 insertions(+), 11 deletions(-) diff --git a/data/schema.graphql b/data/schema.graphql index d40b4399e8..56ad30e8c5 100644 --- a/data/schema.graphql +++ b/data/schema.graphql @@ -618,6 +618,8 @@ type Case implements Node { submitter_slide_ids: String annotations: CaseAnnotations demographic: Demographic + metadata_participant: MetadataParticipant + metadata_sample: [MetadataSample] diagnoses: Diagnoses files: CaseFiles exposures: Exposures @@ -629,6 +631,46 @@ type Case implements Node { score: Int } +type MetadataParticipant{ + participant: Int + age_2012: Int + totMETs1: String + weight_lbs: String +} + +type MetadataSample{ + + id: Int + project: String + sample: String + participant: Int + DaysSince1Jan12: Int + drAlcohol: Float + drB12: Float + drCalories: Float + drCarbs: Float + drCholine: Float + drFat: Float + drFiber: Float + drFolate: Float + drIron: Float + drProtein: Float + participant: Int + q2Alcohol: String + q2B12: String + q2Calories: String + q2Carbs: String + q2Choline: String + q2Fat: String + q2Fiber: String + q2Folate: String + q2Iron: String + q2Protein: String + Time: String + week: Int +} + + type CaseAggregations { updated_datetime: Aggregations submitter_analyte_ids: Aggregations @@ -657,6 +699,9 @@ type CaseAggregations { demographic__demographic_id: Aggregations demographic__ethnicity: Aggregations demographic__year_of_death: NumericAggergations + metadata_participant__age_2012: Aggregations + metadata_participant__totMETs1: Aggregations + metadata_participant__weight_lbs: Aggregations lost_to_followup: Aggregations state: Aggregations case_id: Aggregations diff --git a/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.js b/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.js index d3ee25a8bf..e1b21bd84f 100644 --- a/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.js +++ b/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.js @@ -31,6 +31,9 @@ export type TProps = { facets: { facets: string }, parsedFacets: Object, aggregations: { + metadata_participant__age_2012: { buckets: [TBucket] }, + metadata_participant__totMETs1: { buckets: [TBucket] }, + metadata_participant__weight_lbs: { buckets: [TBucket] }, demographic__ethnicity: { buckets: [TBucket] }, demographic__gender: { buckets: [TBucket] }, demographic__race: { buckets: [TBucket] }, @@ -80,6 +83,27 @@ const presetFacets = [ doc_type: 'cases', type: 'terms', }, + { + title: 'Age in 2012', + field: 'metadata_participant.age_2012', + full: 'cases.metadata_participant.age_2012', + doc_type: 'cases', + type: 'keyword', + }, + { + title: 'totMETs1', + field: 'metadata_participant.totMETs1', + full: 'cases.metadata_participant.totMETs1', + doc_type: 'cases', + type: 'keyword', + }, + { + title: 'Weight Lbs', + field: 'metadata_participant.weight_lbs', + full: 'cases.metadata_participant.weight_lbs', + doc_type: 'cases', + type: 'keyword', + }, { title: 'Gender', field: 'demographic.gender', diff --git a/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.relay.js b/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.relay.js index 700556895c..4360f0583d 100644 --- a/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.relay.js +++ b/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.relay.js @@ -77,6 +77,24 @@ export default (Component: ReactClass<*>) => key } } + metadata_participant__age_2012 { + buckets { + doc_count + key + } + } + metadata_participant__totMETs1 { + buckets { + doc_count + key + } + } + metadata_participant__weight_lbs { + buckets { + doc_count + key + } + } demographic__gender { buckets { doc_count diff --git a/src/packages/@ncigdc/modern_components/FilesTable/FilesTable.model.js b/src/packages/@ncigdc/modern_components/FilesTable/FilesTable.model.js index 41bc0dd0a9..b01d53eb78 100644 --- a/src/packages/@ncigdc/modern_components/FilesTable/FilesTable.model.js +++ b/src/packages/@ncigdc/modern_components/FilesTable/FilesTable.model.js @@ -45,12 +45,13 @@ const filesTableModel = [ { name: 'File Name', id: 'file_name', + file_id: 'file_id', sortable: true, downloadable: true, th: () => File Name, td: ({ node }) => ( - + {node.file_name} @@ -65,7 +66,7 @@ const filesTableModel = [ {uniq( node.cases.hits.edges.map(e => e.node.project.project_id), ).map(pId => ( - + {pId} ))} diff --git a/src/packages/@ncigdc/modern_components/ProjectsTable/ProjectsTable.model.js b/src/packages/@ncigdc/modern_components/ProjectsTable/ProjectsTable.model.js index 9ae4eac249..cb8524e012 100644 --- a/src/packages/@ncigdc/modern_components/ProjectsTable/ProjectsTable.model.js +++ b/src/packages/@ncigdc/modern_components/ProjectsTable/ProjectsTable.model.js @@ -41,7 +41,7 @@ const projectsTableModel = [ th: () => Project, td: ({ node }) => ( - + {node.project_id} diff --git a/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.model.js b/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.model.js index 093affe6e1..f3bc63c39e 100644 --- a/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.model.js +++ b/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.model.js @@ -110,7 +110,7 @@ const casesTableModel = [ ), td: ({ node, index }) => ( - + {node.project.project_id} @@ -129,18 +129,50 @@ const casesTableModel = [ td: ({ node }) => {node.primary_site}, }, { - name: 'Gender', - id: 'demographic.gender', + name: 'Age in 2012', + id: 'metadata_participant.age_2012', sortable: true, downloadable: true, th: () => ( - - Gender + + Age in 2012 ), td: ({ node }) => ( - - {_.capitalize(node.demographic.gender) || '--'} + + {_.capitalize(node.metadata_participant.age_2012) || '--'} + + ), + }, + { + name: 'Weight Lbs', + id: 'metadata_participant.weight_lbs', + sortable: true, + downloadable: true, + th: () => ( + + Weight Lbs + + ), + td: ({ node }) => ( + + {_.capitalize(node.metadata_participant.weight_lbs) || '--'} + + ), + }, + { + name: 'totMETs1', + id: 'metadata_participant.totMETs1', + sortable: true, + downloadable: true, + th: () => ( + + totMETs1 + + ), + td: ({ node }) => ( + + {_.capitalize(node.metadata_participant.totMETs1) || '--'} ), }, diff --git a/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.relay.js b/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.relay.js index a5397913d3..c04894b92c 100644 --- a/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.relay.js +++ b/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.relay.js @@ -85,6 +85,16 @@ export default (Component: React.Class<*>) => ethnicity race } + metadata_participant { + age_2012 + weight_lbs + totMETs1 + } + metadata_sample { + week + drFiber + drCalories + } summary { data_categories { file_count diff --git a/src/packages/@ncigdc/utils/constants.js b/src/packages/@ncigdc/utils/constants.js index 6238ddaee8..6303668919 100644 --- a/src/packages/@ncigdc/utils/constants.js +++ b/src/packages/@ncigdc/utils/constants.js @@ -7,7 +7,7 @@ const localStorage = window.localStorage || {}; /* Links */ -export const PROJECTLINK = "https://portal.firecloud.org/" +export const PROJECTLINK = "https://portal.firecloud.org/#workspaces/firecloud-biom-mass/" /* API ENDPOINTS */ From 116e23659f8d6b962cc6174ab4989d9d0058f7b0 Mon Sep 17 00:00:00 2001 From: Ana Mailyan Date: Sat, 30 Mar 2019 23:12:25 +0000 Subject: [PATCH 2/5] file id is link, not name --- .../@ncigdc/modern_components/FilesTable/FilesTable.model.js | 3 ++- src/packages/@ncigdc/utils/constants.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/packages/@ncigdc/modern_components/FilesTable/FilesTable.model.js b/src/packages/@ncigdc/modern_components/FilesTable/FilesTable.model.js index b01d53eb78..a265f331e5 100644 --- a/src/packages/@ncigdc/modern_components/FilesTable/FilesTable.model.js +++ b/src/packages/@ncigdc/modern_components/FilesTable/FilesTable.model.js @@ -7,6 +7,7 @@ import { makeFilter } from '@ncigdc/utils/filters'; import FileSize from '@ncigdc/components/FileSize'; import { PROJECTLINK } from '@ncigdc/utils/constants' +import { STORAGELINK } from '@ncigdc/utils/constants' const filesTableModel = [ { @@ -51,7 +52,7 @@ const filesTableModel = [ th: () => File Name, td: ({ node }) => ( - + {node.file_name} diff --git a/src/packages/@ncigdc/utils/constants.js b/src/packages/@ncigdc/utils/constants.js index 6303668919..fbc38f6ebb 100644 --- a/src/packages/@ncigdc/utils/constants.js +++ b/src/packages/@ncigdc/utils/constants.js @@ -8,6 +8,7 @@ const localStorage = window.localStorage || {}; /* Links */ export const PROJECTLINK = "https://portal.firecloud.org/#workspaces/firecloud-biom-mass/" +export const STORAGELINK = "https://storage.cloud.google.com/" /* API ENDPOINTS */ From b84ad3fc33004f59b50cbeb3d3aa5d68c045c888 Mon Sep 17 00:00:00 2001 From: Ana Mailyan Date: Sat, 30 Mar 2019 23:57:13 +0000 Subject: [PATCH 3/5] making float totMETs1 and weight_lbs --- data/schema.graphql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/schema.graphql b/data/schema.graphql index 56ad30e8c5..ab566eb8ce 100644 --- a/data/schema.graphql +++ b/data/schema.graphql @@ -634,8 +634,8 @@ type Case implements Node { type MetadataParticipant{ participant: Int age_2012: Int - totMETs1: String - weight_lbs: String + totMETs1: Float + weight_lbs: Float } type MetadataSample{ From cb77dca71a33337de7f4c4e0c143809c9ab78e7b Mon Sep 17 00:00:00 2001 From: Ana Mailyan Date: Wed, 3 Apr 2019 16:48:10 +0000 Subject: [PATCH 4/5] Removing gender pie chart adding age and weight pie chart --- .../components/TabPieCharts/RepoCasesPies.js | 44 +++++++++++++++++-- .../FilesTable/FilesTable.model.js | 2 +- .../RepoCasesTable/RepoCasesTable.model.js | 10 ++++- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/src/packages/@ncigdc/components/TabPieCharts/RepoCasesPies.js b/src/packages/@ncigdc/components/TabPieCharts/RepoCasesPies.js index a7d15037b4..96842ad421 100644 --- a/src/packages/@ncigdc/components/TabPieCharts/RepoCasesPies.js +++ b/src/packages/@ncigdc/components/TabPieCharts/RepoCasesPies.js @@ -16,6 +16,9 @@ export type TProps = { demographic__ethnicity: { buckets: [TBucket] }, demographic__gender: { buckets: [TBucket] }, demographic__race: { buckets: [TBucket] }, + metadata_participant__age_2012: { buckets: [TBucket] }, + metadata_participant__totMETs1: { buckets: [TBucket] }, + metadata_participant__weight_lbs: { buckets: [TBucket] }, primary_site: { buckets: [TBucket] }, project__program__name: { buckets: [TBucket] }, project__project_id: { buckets: [TBucket] }, @@ -60,11 +63,26 @@ const RepoCasesPiesComponent = ({ aggregations, query, push }: TProps) => { width={125} /> - - Gender + + Age in 2012 + + + Weight Lbs + File Name, td: ({ node }) => ( - + {node.file_name} diff --git a/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.model.js b/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.model.js index f3bc63c39e..ec62292578 100644 --- a/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.model.js +++ b/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.model.js @@ -94,7 +94,15 @@ const casesTableModel = [ ), td: ({ node, index }) => ( - {node.submitter_id} + + {node.submitter_id} + + ), }, From b8e9a7ec4a149338dec9781caebb480f1d675403 Mon Sep 17 00:00:00 2001 From: Ana Mailyan Date: Wed, 3 Apr 2019 19:19:23 +0000 Subject: [PATCH 5/5] Removing demographics from queries and models --- .../components/TabPieCharts/RepoCasesPies.js | 15 ++++++++++++ .../CaseAggregations/CaseAggregations.js | 24 ------------------- .../CaseAggregations.relay.js | 18 -------------- .../RepoCasesTable/RepoCasesTable.model.js | 22 ----------------- .../RepoCasesTable/RepoCasesTable.relay.js | 5 ---- 5 files changed, 15 insertions(+), 69 deletions(-) diff --git a/src/packages/@ncigdc/components/TabPieCharts/RepoCasesPies.js b/src/packages/@ncigdc/components/TabPieCharts/RepoCasesPies.js index 96842ad421..618088ded5 100644 --- a/src/packages/@ncigdc/components/TabPieCharts/RepoCasesPies.js +++ b/src/packages/@ncigdc/components/TabPieCharts/RepoCasesPies.js @@ -93,6 +93,21 @@ const RepoCasesPiesComponent = ({ aggregations, query, push }: TProps) => { width={125} /> + + totMETs1 + + ); }; diff --git a/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.js b/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.js index e1b21bd84f..05272dbc52 100644 --- a/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.js +++ b/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.js @@ -34,9 +34,6 @@ export type TProps = { metadata_participant__age_2012: { buckets: [TBucket] }, metadata_participant__totMETs1: { buckets: [TBucket] }, metadata_participant__weight_lbs: { buckets: [TBucket] }, - demographic__ethnicity: { buckets: [TBucket] }, - demographic__gender: { buckets: [TBucket] }, - demographic__race: { buckets: [TBucket] }, primary_site: { buckets: [TBucket] }, project__program__name: { buckets: [TBucket] }, project__project_id: { buckets: [TBucket] }, @@ -104,27 +101,6 @@ const presetFacets = [ doc_type: 'cases', type: 'keyword', }, - { - title: 'Gender', - field: 'demographic.gender', - full: 'cases.demographic.gender', - doc_type: 'cases', - type: 'keyword', - }, - { - title: 'Race', - field: 'demographic.race', - full: 'cases.demographic.race', - doc_type: 'cases', - type: 'keyword', - }, - { - title: 'Ethnicity', - field: 'demographic.ethnicity', - full: 'cases.demographic.ethnicity', - doc_type: 'cases', - type: 'keyword', - }, ]; const presetFacetFields = presetFacets.map(x => x.field); diff --git a/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.relay.js b/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.relay.js index 4360f0583d..068ef5db45 100644 --- a/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.relay.js +++ b/src/packages/@ncigdc/modern_components/CaseAggregations/CaseAggregations.relay.js @@ -95,24 +95,6 @@ export default (Component: ReactClass<*>) => key } } - demographic__gender { - buckets { - doc_count - key - } - } - demographic__race { - buckets { - doc_count - key - } - } - demographic__ethnicity { - buckets { - doc_count - key - } - } } } } diff --git a/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.model.js b/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.model.js index ec62292578..73ffd7f1d9 100644 --- a/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.model.js +++ b/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.model.js @@ -222,28 +222,6 @@ const casesTableModel = [ th: () => Program, td: ({ node }) => {node.project.program.name}, }, - { - name: 'Ethnicity', - id: 'demographic.ethnicity', - sortable: false, - downloadable: true, - hidden: true, - th: () => Ethnicity, - td: ({ node }) => ( - {(node.demographic && node.demographic.ethnicity) || '--'} - ), - }, - { - name: 'Race', - id: 'demographic.race', - sortable: false, - downloadable: true, - hidden: true, - th: () => Race, - td: ({ node }) => ( - {(node.demographic && node.demographic.race) || '--'} - ), - }, ]; export default casesTableModel; diff --git a/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.relay.js b/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.relay.js index c04894b92c..9c5ae3790b 100644 --- a/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.relay.js +++ b/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.relay.js @@ -80,11 +80,6 @@ export default (Component: React.Class<*>) => } } } - demographic { - gender - ethnicity - race - } metadata_participant { age_2012 weight_lbs