diff --git a/src/graphql/biospecimens/models.ts b/src/graphql/biospecimens/models.ts index f2eba95ee..2634c7a3f 100644 --- a/src/graphql/biospecimens/models.ts +++ b/src/graphql/biospecimens/models.ts @@ -44,4 +44,8 @@ export interface IBiospecimenEntity { consent_type: string; collection_method_of_sample_procurement: string; external_sample_id: string; + source_text_tumor_descriptor: string; + diagnosis_ncit: string; + source_text: string; + diagnosis_mondo: string; } diff --git a/src/graphql/biospecimens/queries.ts b/src/graphql/biospecimens/queries.ts index f9a4425f4..439830487 100644 --- a/src/graphql/biospecimens/queries.ts +++ b/src/graphql/biospecimens/queries.ts @@ -30,12 +30,16 @@ export const SEARCH_BIOSPECIMEN_QUERY = gql` nb_files collection_sample_id collection_sample_type + diagnosis_ncit status dbgap_consent_code collection_method_of_sample_procurement volume volume_unit external_sample_id + source_text_tumor_descriptor + source_text_tumor_location + source_text study { study_code } @@ -82,15 +86,22 @@ export const GET_PARTICIPANT_BIOSPECIMENS = gql` parent_sample_id age_at_biospecimen_collection collection_ncit_anatomy_site_id + tissue_type_source_text collection_anatomy_site ncit_id_tissue_type tissue_type_source_text consent_type - + collection_sample_id + collection_sample_type participant { participant_id } - + source_text_tumor_descriptor + source_text_tumor_location + dbgap_consent_code + volume_unit + volume + status parent_0 { sample_id } diff --git a/src/graphql/participants/queries.ts b/src/graphql/participants/queries.ts index a6bf570a7..7d4060575 100644 --- a/src/graphql/participants/queries.ts +++ b/src/graphql/participants/queries.ts @@ -159,8 +159,11 @@ export const GET_PARTICIPANT_ENTITY = gql` edges { node { age_at_biospecimen_collection - collection_anatomy_site biospecimen_storage + collection_anatomy_site + collection_method_of_sample_procurement + collection_ncit_anatomy_site_id + collection_ncit_id_tissue_type collection_sample_id collection_sample_type consent_type @@ -168,13 +171,11 @@ export const GET_PARTICIPANT_ENTITY = gql` dbgap_consent_code fhir_id laboratory_procedure - collection_ncit_anatomy_site_id - collection_method_of_sample_procurement - # TODO ncit_id_tissue_type parent_sample_id parent_sample_type sample_id sample_type + source_text_tumor_descriptor source_text_tumor_location status tissue_type_source_text diff --git a/src/locales/en.ts b/src/locales/en.ts index 5c055bb25..b3c689650 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -1202,7 +1202,10 @@ const en = { source_text_tumor_location: 'Tumor Location (Source Text)', tissue_type_source_text: 'Tissue Type (Source Text)', sample_id: 'Sample ID', - + source_text_tumor_descriptor: 'Tumor Descriptor (Source Text)', + age_at_event: { + value: 'Age at Histological Diagnosis (days)', + }, // File files: filesFacets, ...filesFacets, @@ -1481,6 +1484,13 @@ const en = { volume_unit: 'Volume Unit', collection_method_of_sample_procurement: 'Method Of Sample Procurement', tissue_type_source_text: 'Tissue Type (Source Text)', + ncit_id_tissue_type: 'Tissue Type (NCIT)', + source_text_tumor_descriptor: 'Tumor Descriptor (Source Text)', + external_sample_id: 'External Sample ID', + external_pt_id: 'External Participant ID', + source_text: 'Histological Diagnosis (Source Text)', + diagnosis_ncit: 'Histological Diagnosis (NCIT)', + diagnosis_mondo: 'Histological Diagnosis (MONDO)', }, participant: { age: 'Age', diff --git a/src/utils/translation.ts b/src/utils/translation.ts index b5d123c74..46ce37108 100644 --- a/src/utils/translation.ts +++ b/src/utils/translation.ts @@ -314,6 +314,9 @@ export const getFacetsDictionary = () => ({ source_text_tumor_location: 'Tumor Location (Source Text)', ncit_id_tissue_type: 'Tissue Type (NCIT)', tissue_type_source_text: 'Tissue Type (Source Text)', + age_at_event: { + value: 'Age at Histological Diagnosis (days)' + }, clinvar: { clin_sig: 'ClinVar', }, diff --git a/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx b/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx index 755836676..9f3cab7c0 100644 --- a/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx +++ b/src/views/DataExploration/components/PageContent/tabs/Biospecimens/index.tsx @@ -53,7 +53,7 @@ interface OwnProps { const getDefaultColumns = (): ProColumnType[] => [ { key: 'sample_id', - title: 'Sample ID', + title: intl.get('entities.biospecimen.sample_id'), sorter: { multiple: 1 }, render: (record: IBiospecimenEntity) => record?.sample_id || TABLE_EMPTY_PLACE_HOLDER, }, @@ -66,21 +66,21 @@ const getDefaultColumns = (): ProColumnType[] => [ }, { key: 'sample_type', - title: 'Sample Type', + title: intl.get('entities.biospecimen.sample_type'), dataIndex: 'sample_type', sorter: { multiple: 1 }, render: (sample_type: string) => sample_type || TABLE_EMPTY_PLACE_HOLDER, }, { key: 'parent_sample_id', - title: 'Parent Sample ID', + title: intl.get('entities.biospecimen.parent_sample_id'), dataIndex: 'parent_sample_id', sorter: { multiple: 1 }, render: (parent_sample_id) => parent_sample_id || TABLE_EMPTY_PLACE_HOLDER, }, { key: 'parent_sample_type', - title: 'Parent Sample Type', + title: intl.get('entities.biospecimen.parent_sample_type'), dataIndex: 'parent_sample_type', sorter: { multiple: 1 }, render: (parent_sample_type) => parent_sample_type || TABLE_EMPTY_PLACE_HOLDER, @@ -100,7 +100,7 @@ const getDefaultColumns = (): ProColumnType[] => [ }, { key: 'collection_sample_id', - title: 'Collection ID', + title: intl.get('entities.biospecimen.collection_id'), dataIndex: 'collection_sample_id', render: (collection_sample_id) => collection_sample_id ? ( @@ -111,19 +111,25 @@ const getDefaultColumns = (): ProColumnType[] => [ }, { key: 'collection_sample_type', - title: 'Collection Sample Type', + title: intl.get('entities.biospecimen.collection_sample_type'), dataIndex: 'collection_sample_type', render: (collection_sample_type) => collection_sample_type || TABLE_EMPTY_PLACE_HOLDER, }, { key: 'age_at_biospecimen_collection', - title: 'Age', - tooltip: 'Age at Biospecimen Collection (days)', + title: intl.get('entities.participant.age'), + tooltip: intl.get('entities.biospecimen.age_tooltip'), dataIndex: 'age_at_biospecimen_collection', render: (age_at_biospecimen_collection) => ( ), }, + { + key: 'diagnosis_mondo', + title: intl.get('entities.biospecimen.diagnosis_mondo'), + dataIndex: 'diagnosis_mondo', + render: (diagnosis_mondo) => diagnosis_mondo || TABLE_EMPTY_PLACE_HOLDER, + }, // TODO back implementation needed // { // key: 'diagnosis.mondo_id_diagnosis', @@ -142,7 +148,7 @@ const getDefaultColumns = (): ProColumnType[] => [ // }, { key: 'status', - title: 'Sample Availability', + title: intl.get('entities.biospecimen.sample_availabilty'), dataIndex: 'status', render: (status) => status || TABLE_EMPTY_PLACE_HOLDER, }, @@ -179,14 +185,6 @@ const getDefaultColumns = (): ProColumnType[] => [ ); }, }, - { - key: 'participant.external_id', - title: 'External Participant ID', - dataIndex: 'participant', - defaultHidden: true, - render: (participant: IParticipantEntity) => - participant?.external_id || TABLE_EMPTY_PLACE_HOLDER, - }, { key: 'collection_ncit_anatomy_site_id', title: intl.get('entities.biospecimen.anatomical_site_NCIT'), @@ -202,16 +200,51 @@ const getDefaultColumns = (): ProColumnType[] => [ defaultHidden: true, render: (anatomy_site) => anatomy_site || TABLE_EMPTY_PLACE_HOLDER, }, + { + key: 'ncit_id_tissue_type', + title: intl.get('entities.biospecimen.ncit_id_tissue_type'), + dataIndex: 'ncit_id_tissue_type', + defaultHidden: true, + render: (ncit_id_tissue_type) => ncit_id_tissue_type || TABLE_EMPTY_PLACE_HOLDER, + }, + { + key: 'tissue_type_source_text', + title: intl.get('entities.biospecimen.tissue_type_source_text'), + dataIndex: 'tissue_type_source_text', + defaultHidden: true, + render: (tissue_type_source_text) => tissue_type_source_text || TABLE_EMPTY_PLACE_HOLDER, + }, + { + key: 'diagnosis_ncit', + title: intl.get('entities.biospecimen.diagnosis_ncit'), + dataIndex: 'diagnosis_ncit', + defaultHidden: true, + render: (diagnosis_ncit) => diagnosis_ncit || TABLE_EMPTY_PLACE_HOLDER, + }, + { + key: 'source_text', + title: intl.get('entities.biospecimen.source_text'), + dataIndex: 'source_text', + defaultHidden: true, + render: (source_text) => source_text || TABLE_EMPTY_PLACE_HOLDER, + }, + { + key: 'source_text_tumor_location', + title: intl.get('entities.biospecimen.source_text_tumor_location'), + dataIndex: 'source_text_tumor_location', + defaultHidden: true, + render: (source_text_tumor_location) => source_text_tumor_location || TABLE_EMPTY_PLACE_HOLDER, + }, { key: 'dbgap_consent_code', - title: 'dbGaP Consent Code', + title: intl.get('entities.biospecimen.dbgap_consent_code'), dataIndex: 'dbgap_consent_code', defaultHidden: true, render: (dbgap_consent_code) => dbgap_consent_code || TABLE_EMPTY_PLACE_HOLDER, }, { key: 'consent_type', - title: 'Consent Type', + title: intl.get('entities.biospecimen.consent_type'), dataIndex: 'consent_type', defaultHidden: true, render: (consent_type) => consent_type || TABLE_EMPTY_PLACE_HOLDER, @@ -224,23 +257,39 @@ const getDefaultColumns = (): ProColumnType[] => [ render: (collection_method_of_sample_procurement) => collection_method_of_sample_procurement || TABLE_EMPTY_PLACE_HOLDER, }, + { + key: 'source_text_tumor_descriptor', + title: intl.get('entities.biospecimen.source_text_tumor_descriptor'), + dataIndex: 'source_text_tumor_descriptor', + defaultHidden: true, + render: (source_text_tumor_descriptor) => + source_text_tumor_descriptor || TABLE_EMPTY_PLACE_HOLDER, + }, { key: 'volume', - title: 'Volume', + title: intl.get('entities.biospecimen.volume'), dataIndex: 'volume', defaultHidden: true, render: (volume) => volume || TABLE_EMPTY_PLACE_HOLDER, }, { key: 'volume_unit', - title: 'Volume Unit', + title: intl.get('entities.biospecimen.volume_unit'), dataIndex: 'volume_unit', defaultHidden: true, render: (volume_unit) => volume_unit || TABLE_EMPTY_PLACE_HOLDER, }, + { + key: 'participant.external_id', + title: intl.get('entities.biospecimen.external_pt_id'), + dataIndex: 'participant', + defaultHidden: true, + render: (participant: IParticipantEntity) => + participant?.external_id || TABLE_EMPTY_PLACE_HOLDER, + }, { key: 'external_sample_id', - title: 'External Sample ID', + title: intl.get('entities.biospecimen.external_sample_id'), dataIndex: 'external_sample_id', defaultHidden: true, render: (external_sample_id) => external_sample_id || TABLE_EMPTY_PLACE_HOLDER, diff --git a/src/views/DataExploration/index.tsx b/src/views/DataExploration/index.tsx index fc7e17265..a8789cd4f 100644 --- a/src/views/DataExploration/index.tsx +++ b/src/views/DataExploration/index.tsx @@ -121,6 +121,7 @@ const filterGroups: { 'sample_type', 'collection_sample_type', 'age_at_biospecimen_collection', + 'age_at_event__value', 'status', 'collection_ncit_anatomy_site_id', 'collection_anatomy_site', @@ -131,6 +132,9 @@ const filterGroups: { 'source_text', 'source_text_tumor_location', 'collection_method_of_sample_procurement', + 'ncit_id_tissue_type', + 'tissue_type_source_text', + 'source_text_tumor_descriptor', ], }, ], diff --git a/src/views/ParticipantEntity/utils/biospecimens.tsx b/src/views/ParticipantEntity/utils/biospecimens.tsx index 5d4af471e..7fa3aa0c3 100644 --- a/src/views/ParticipantEntity/utils/biospecimens.tsx +++ b/src/views/ParticipantEntity/utils/biospecimens.tsx @@ -60,11 +60,26 @@ export const getBiospecimensDefaultColumns = (): ProColumnType[] => [ biospecimen?.collection_anatomy_site || TABLE_EMPTY_PLACE_HOLDER, }, { - key: 'collection_method_of_sample_procurement', - title: intl.get('entities.biospecimen.collection_method_of_sample_procurement'), + key: 'collection_ncit_id_tissue_type', + title: intl.get('entities.biospecimen.ncit_id_tissue_type'), + dataIndex: 'collection_ncit_id_tissue_type', defaultHidden: true, - render: (biospecimen: IBiospecimenEntity) => - biospecimen?.collection_method_of_sample_procurement || TABLE_EMPTY_PLACE_HOLDER, + render: (ncit_id_tissue_type) => ncit_id_tissue_type || TABLE_EMPTY_PLACE_HOLDER, + }, + { + key: 'tissue_type_source_text', + title: intl.get('entities.biospecimen.tissue_type_source_text'), + dataIndex: 'tissue_type_source_text', + defaultHidden: true, + render: (tissue_type_source_text) => tissue_type_source_text || TABLE_EMPTY_PLACE_HOLDER, + }, + { + key: 'source_text_tumor_descriptor', + title: intl.get('entities.biospecimen.source_text_tumor_descriptor'), + dataIndex: 'source_text_tumor_descriptor', + defaultHidden: true, + render: (source_text_tumor_descriptor) => + source_text_tumor_descriptor || TABLE_EMPTY_PLACE_HOLDER, }, { key: 'source_text_tumor_location',