Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 Add data to specimen tables #3838

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/graphql/biospecimens/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
15 changes: 13 additions & 2 deletions src/graphql/biospecimens/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down
9 changes: 5 additions & 4 deletions src/graphql/participants/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,22 +159,23 @@ 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
container_id
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
Expand Down
12 changes: 11 additions & 1 deletion src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down
3 changes: 3 additions & 0 deletions src/utils/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ interface OwnProps {
const getDefaultColumns = (): ProColumnType<any>[] => [
{
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,
},
Expand All @@ -66,21 +66,21 @@ const getDefaultColumns = (): ProColumnType<any>[] => [
},
{
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,
Expand All @@ -100,7 +100,7 @@ const getDefaultColumns = (): ProColumnType<any>[] => [
},
{
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 ? (
Expand All @@ -111,19 +111,25 @@ const getDefaultColumns = (): ProColumnType<any>[] => [
},
{
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) => (
<AgeCell ageInDays={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,
},
evans-g-crsj marked this conversation as resolved.
Show resolved Hide resolved
// TODO back implementation needed
// {
// key: 'diagnosis.mondo_id_diagnosis',
Expand All @@ -142,7 +148,7 @@ const getDefaultColumns = (): ProColumnType<any>[] => [
// },
{
key: 'status',
title: 'Sample Availability',
title: intl.get('entities.biospecimen.sample_availabilty'),
dataIndex: 'status',
render: (status) => status || TABLE_EMPTY_PLACE_HOLDER,
},
Expand Down Expand Up @@ -179,14 +185,6 @@ const getDefaultColumns = (): ProColumnType<any>[] => [
);
},
},
{
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'),
Expand All @@ -202,16 +200,51 @@ const getDefaultColumns = (): ProColumnType<any>[] => [
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,
Expand All @@ -224,23 +257,39 @@ const getDefaultColumns = (): ProColumnType<any>[] => [
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,
Expand Down
4 changes: 4 additions & 0 deletions src/views/DataExploration/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
],
},
],
Expand Down
23 changes: 19 additions & 4 deletions src/views/ParticipantEntity/utils/biospecimens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Loading