diff --git a/data/schema.graphql b/data/schema.graphql index d40b4399e8..ab566eb8ce 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: Float + weight_lbs: Float +} + +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/components/TabPieCharts/RepoCasesPies.js b/src/packages/@ncigdc/components/TabPieCharts/RepoCasesPies.js index a7d15037b4..618088ded5 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,41 @@ const RepoCasesPiesComponent = ({ aggregations, query, push }: TProps) => { width={125} /> - - Gender + + Age in 2012 + + + Weight Lbs + + + + totMETs1 + ) => key } } - demographic__gender { + metadata_participant__age_2012 { buckets { doc_count key } } - demographic__race { + metadata_participant__totMETs1 { buckets { doc_count key } } - demographic__ethnicity { + metadata_participant__weight_lbs { buckets { doc_count key diff --git a/src/packages/@ncigdc/modern_components/FilesTable/FilesTable.model.js b/src/packages/@ncigdc/modern_components/FilesTable/FilesTable.model.js index 41bc0dd0a9..75f1a5c763 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 = [ { @@ -45,12 +46,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 +67,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..73ffd7f1d9 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} + + ), }, @@ -110,7 +118,7 @@ const casesTableModel = [ ), td: ({ node, index }) => ( - + {node.project.project_id} @@ -129,18 +137,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: () => ( + + Age in 2012 + + ), + td: ({ node }) => ( + + {_.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: () => ( - - Gender + + totMETs1 ), td: ({ node }) => ( - - {_.capitalize(node.demographic.gender) || '--'} + + {_.capitalize(node.metadata_participant.totMETs1) || '--'} ), }, @@ -182,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 a5397913d3..9c5ae3790b 100644 --- a/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.relay.js +++ b/src/packages/@ncigdc/modern_components/RepoCasesTable/RepoCasesTable.relay.js @@ -80,10 +80,15 @@ export default (Component: React.Class<*>) => } } } - demographic { - gender - ethnicity - race + metadata_participant { + age_2012 + weight_lbs + totMETs1 + } + metadata_sample { + week + drFiber + drCalories } summary { data_categories { diff --git a/src/packages/@ncigdc/utils/constants.js b/src/packages/@ncigdc/utils/constants.js index 6238ddaee8..fbc38f6ebb 100644 --- a/src/packages/@ncigdc/utils/constants.js +++ b/src/packages/@ncigdc/utils/constants.js @@ -7,7 +7,8 @@ const localStorage = window.localStorage || {}; /* Links */ -export const PROJECTLINK = "https://portal.firecloud.org/" +export const PROJECTLINK = "https://portal.firecloud.org/#workspaces/firecloud-biom-mass/" +export const STORAGELINK = "https://storage.cloud.google.com/" /* API ENDPOINTS */