From 2451e68fcfd024038fa090be36be54b8d7be9805 Mon Sep 17 00:00:00 2001 From: Vittorio Meloni Date: Fri, 31 May 2024 16:10:27 +0200 Subject: [PATCH 01/18] feat(data/biobank-directory): updates model to include Study and associate it to Collection --- data/biobank-directory/demo/Studies.csv | 2 ++ data/biobank-directory/molgenis.csv | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 data/biobank-directory/demo/Studies.csv diff --git a/data/biobank-directory/demo/Studies.csv b/data/biobank-directory/demo/Studies.csv new file mode 100644 index 0000000000..663578da4e --- /dev/null +++ b/data/biobank-directory/demo/Studies.csv @@ -0,0 +1,2 @@ +id,title,description,type,sex,age_high,age_low,age_unit,also_known +bbmri_eric:ID:DE:112233,Dummy study,This is just a fake study with demo data,Interventional,"FEMALE,MALE",10,50,YEAR,bbmri-eric:akiID:DE_00002 diff --git a/data/biobank-directory/molgenis.csv b/data/biobank-directory/molgenis.csv index 2ececb3b89..f02df59740 100644 --- a/data/biobank-directory/molgenis.csv +++ b/data/biobank-directory/molgenis.csv @@ -161,4 +161,16 @@ Persons,,role,Role of the Person,text,,false,,Official role of the person.,,,,,, Persons,,biobanks,Biobanks,refback,,false,true,Biobanks the person is connected to.,,Biobanks,contact,,,,,, Persons,,collections,Collections,refback,,false,true,Collections the person is connected to.,,Collections,contact,,,,,, Persons,,networks,Networks,refback,,false,true,Networks the person is connected to.,,Networks,contact,,,,,, -Persons,,national_node,National Node,ref,,true,,The person originates from this national node.,,NationalNodes,,${description},,,,, \ No newline at end of file +Persons,,national_node,National Node,ref,,true,,The person originates from this national node.,,NationalNodes,,${description},,,,, +Studies,,,,,,,,Table with information about studies imported from ECRIN MDR. A Study is intended as a clinical trial in which context the collection was generated,,,,,,,,, +Studies,,id,ID,string,1,true,,"Unique ID of the study, prefixed with bbmri-eric:ID:",,,,,,,,, +Studies,,title,Title,text,,true,,The title of the study,,,,,,,,, +Studies,,description,Description,text,,false,,A text describing the study,,,,,,,,, +Studies,,type,Type,string,,false,,"The type of study (Observational, Interventional). This is a string imported from ECRIN",,,,,,,,, +Studies,,sex,Sex,ontology_array,,false,,"The sex of the individuals that participated to the study",,SexTypes,,,,,,, +Studies,,age_low,Age Low,int,,false,,Age of youngest sample donor at time of sample donation - MIABIS-2.0-10.,,,,,,,,, +Studies,,age_high,Age High,int,,false,,Age of oldest sample donor at time of sample donation - MIABIS-2.0-11.,,,,,,,,, +Studies,,age_unit,Age Unit,ontology,,false,,"Unit defining Age Low and Age High. Can be one of the following values: YEAR, MONTH, WEEK, DAY - MIABIS-2.0-08.",,AgeUnits,,${label},,,,, +Studies,,number_of_subjects,Number of subjects,int,,false,,"The number of subjects that participated to the study",,,,,,,,, +Studies,,also_known,Also Known In,ref_array,,false,,The study also exists in …,,AlsoKnownIn,,${name_system},,,,, +Studies,,collections,Collection,refback,,false,true,,,Collections,study,,,,,, \ No newline at end of file From fc278d512ec42fe84a0a0cb184288bab4dd2a5f7 Mon Sep 17 00:00:00 2001 From: Vittorio Meloni Date: Fri, 31 May 2024 16:13:41 +0200 Subject: [PATCH 02/18] feat(data/biobank_directory): updates demo data to include Study --- data/biobank-directory/demo/AlsoKnownIn.csv | 3 ++- data/biobank-directory/demo/Collections.csv | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/data/biobank-directory/demo/AlsoKnownIn.csv b/data/biobank-directory/demo/AlsoKnownIn.csv index 33f9241956..cc6c637df4 100644 --- a/data/biobank-directory/demo/AlsoKnownIn.csv +++ b/data/biobank-directory/demo/AlsoKnownIn.csv @@ -1,4 +1,5 @@ id,name_system,pid,url,national_node,label bbmri-eric:akiID:NL_00001,Catalogue in The Netherlands,cat_neth_biobank2,https://linktopid/cat_neth_biobank2.nl,NL,Catalogue in The Netherlands bbmri-eric:akiID:NL_00002,Collection catalogue of The Netherlands,,https://collections@catalogue.nl,NL,Collection catalogue of The Netherlands -bbmri-eric:akiID:DE_00001,Another DataCatalogue,,https://another_data_catalogue.eu,DE,Another DataCatalogue \ No newline at end of file +bbmri-eric:akiID:DE_00001,Another DataCatalogue,,https://another_data_catalogue.eu,DE,Another DataCatalogue +bbmri-eric:akiID:DE_00002,A catalogue of studies,,https://a_study_catalogue.eu/112233,,A Catalogue With Studies \ No newline at end of file diff --git a/data/biobank-directory/demo/Collections.csv b/data/biobank-directory/demo/Collections.csv index cdf6c25ff2..0957b3ffd4 100644 --- a/data/biobank-directory/demo/Collections.csv +++ b/data/biobank-directory/demo/Collections.csv @@ -1,4 +1,4 @@ -id,name,acronym,description,url,location,country,latitude,longitude,head,contact,national_node,withdrawn,parent_collection,biobank,biobank_label,network,combined_network,also_known,type,data_categories,order_of_magnitude,size,categories,timestamp,number_of_donors,order_of_magnitude_donors,sex,diagnosis_available,age_low,age_high,age_unit,materials,storage_temperatures,body_part_examined,imaging_modality,image_dataset_type,collaboration_commercial,collaboration_non_for_profit,data_use,commercial_use,access_fee,access_joint_project,access_description,access_uri,sop,combined_quality -bbmri-eric:ID:DE_biobank1:collection:coll1,Collection1 of biobank1,coll1,The first collection of biobank1,,Berlin,DE,,,bbmri-eric:contactID:DE_collection1,bbmri-eric:contactID:DE_collection1,DE,false,,bbmri-eric:ID:DE_biobank1,Biobank1,bbmri-eric:networkID:DE_nw_coll1,"bbmri-eric:networkID:DE_network1,bbmri-eric:networkID:DE_nw_coll1",bbmri-eric:akiID:DE_00001,"COHORT,RD","MEDICAL_RECORDS,BLOOD",3,1333,"rare_disease,oncology",,600,2,"MALE,NEUTERED_MALE","ORPHA:100001,ORPHA:101009",2,88,YEAR,"DNA,PERIPHERAL_BLOOD_CELLS",temperature2to10,T-04000,BDUS,1.2.840.10008.5.1.4.1.1.104.2,true,true,DUO_0000003,true,"samples,data,images","data,images",,,"sample_transport_sop,data_processing_sop",accredited -bbmri-eric:ID:NL_biobank2:collection:coll2,The second collection of biobank2,coll2_bb2,This is the description of the second collection of biobank2,,Amsterdam,NL,,,bbmri-eric:contactID:head_coll2,bbmri-eric:contactID:NL_person1,NL,false,,bbmri-eric:ID:NL_biobank2,Biobank2,bbmri-eric:networkID:EU_network,bbmri-eric:networkID:EU_network,bbmri-eric:akiID:NL_00001,"CASE_CONTROL,QUALITY_CONTROL","BIOLOGICAL_SAMPLES,IMAGING_DATA,NATIONAL_REGISTRIES",4,11000,"covid19,paediatrics,autoimmune",,9000,3,FEMALE,"urn:miriam:icd:W00,ORPHA:3000",0,90,YEAR,"FECES,PATHOGEN,URINE",temperatureLN,T-58200,CR,1.2.840.10008.5.1.4.1.1.130,true,true,DUO_0000042,false,"samples,data,images","samples,data,images",Access is possible need to pay a fee,,"sample_processing_sop,sample_transport_sop,data_transport_sop,data_storage_sop",accredited -bbmri-eric:ID:NL_biobank2:collection:coll2a,Subcollection1,sub_col1,The first sub collection of collection2,,Amsterdam,NL,,,bbmri-eric:contactID:head_coll2,bbmri-eric:contactID:NL_person1,NL,false,bbmri-eric:ID:NL_biobank2:collection:coll2,bbmri-eric:ID:NL_biobank2,Biobank2,bbmri-eric:networkID:EU_network,bbmri-eric:networkID:EU_network,bbmri-eric:akiID:NL_00002,"CROSS_SECTIONAL,POPULATION_BASED","ANTIBODIES,PHYSIOLOGICAL_BIOCHEMICAL_MEASUREMENTS",2,589,covid19,,133,2,MALE,"ORPHA:1388,ORPHA:139552,urn:miriam:icd:A00.9",5,67,YEAR,"NASAL_SWAB,PLASMA","temperature2to10,temperature-18to-35",T-15710,BMD,1.2.840.10008.5.1.4.1.1.11.1,true,true,DUO_0000024,true,data,data,,,"sample_storage_sop,data_processing_sop,data_transport_sop,data_storage_sop",accredited \ No newline at end of file +id,name,acronym,description,url,location,country,latitude,longitude,head,contact,national_node,withdrawn,parent_collection,biobank,biobank_label,network,combined_network,also_known,type,data_categories,order_of_magnitude,size,categories,timestamp,number_of_donors,order_of_magnitude_donors,sex,diagnosis_available,age_low,age_high,age_unit,materials,storage_temperatures,body_part_examined,imaging_modality,image_dataset_type,collaboration_commercial,collaboration_non_for_profit,data_use,commercial_use,access_fee,access_joint_project,access_description,access_uri,sop,combined_quality,study +bbmri-eric:ID:DE_biobank1:collection:coll1,Collection1 of biobank1,coll1,The first collection of biobank1,,Berlin,DE,,,bbmri-eric:contactID:DE_collection1,bbmri-eric:contactID:DE_collection1,DE,false,,bbmri-eric:ID:DE_biobank1,Biobank1,bbmri-eric:networkID:DE_nw_coll1,"bbmri-eric:networkID:DE_network1,bbmri-eric:networkID:DE_nw_coll1",bbmri-eric:akiID:DE_00001,"COHORT,RD","MEDICAL_RECORDS,BLOOD",3,1333,"rare_disease,cancer",,600,2,"MALE,NEUTERED_MALE","ORPHA:100001,ORPHA:101009",2,88,YEAR,"DNA,PERIPHERAL_BLOOD_CELLS",temperature2to10,T-04000,BDUS,1.2.840.10008.5.1.4.1.1.104.2,true,true,DUO_0000003,true,"samples,data,images","data,images",,,"sample_transport_sop,data_processing_sop",accredited,bbmri_eric:ID:DE:112233 +bbmri-eric:ID:NL_biobank2:collection:coll2,The second collection of biobank2,coll2_bb2,This is the description of the second collection of biobank2,,Amsterdam,NL,,,bbmri-eric:contactID:head_coll2,bbmri-eric:contactID:NL_person1,NL,false,,bbmri-eric:ID:NL_biobank2,Biobank2,bbmri-eric:networkID:EU_network,bbmri-eric:networkID:EU_network,bbmri-eric:akiID:NL_00001,"CASE_CONTROL,QUALITY_CONTROL","BIOLOGICAL_SAMPLES,IMAGING_DATA,NATIONAL_REGISTRIES",4,11000,"covid19,paediatric_only",,9000,3,FEMALE,"urn:miriam:icd:W00,ORPHA:3000",0,90,YEAR,"FECES,PATHOGEN,URINE",temperatureLN,T-58200,CR,1.2.840.10008.5.1.4.1.1.130,true,true,DUO_0000042,false,"samples,data,images","samples,data,images",Access is possible need to pay a fee,,"sample_processing_sop,sample_transport_sop,data_transport_sop,data_storage_sop",accredited, +bbmri-eric:ID:NL_biobank2:collection:coll2a,Subcollection1,sub_col1,The first sub collection of collection2,,Amsterdam,NL,,,bbmri-eric:contactID:head_coll2,bbmri-eric:contactID:NL_person1,NL,false,bbmri-eric:ID:NL_biobank2:collection:coll2,bbmri-eric:ID:NL_biobank2,Biobank2,bbmri-eric:networkID:EU_network,bbmri-eric:networkID:EU_network,bbmri-eric:akiID:NL_00002,"CROSS_SECTIONAL,POPULATION_BASED","ANTIBODIES,PHYSIOLOGICAL_BIOCHEMICAL_MEASUREMENTS",2,589,covid19,,133,2,MALE,"ORPHA:1388,ORPHA:139552,urn:miriam:icd:A00.9",5,67,YEAR,"NASAL_SWAB,PLASMA","temperature2to10,temperature-18to-35",T-15710,BMD,1.2.840.10008.5.1.4.1.1.11.1,true,true,DUO_0000024,true,data,data,,,"sample_storage_sop,data_processing_sop,data_transport_sop,data_storage_sop",accredited, \ No newline at end of file From 4f2b2223a784ab00a8fb9f42bf616bfd7f883cad Mon Sep 17 00:00:00 2001 From: Vittorio Meloni Date: Fri, 31 May 2024 17:02:05 +0200 Subject: [PATCH 03/18] feat(data/biobank-directory): fixes Study model --- .../report-components/ReportStudyDetails.vue | 38 ++++++++ .../report-components/StudyReportInfoCard.vue | 44 ++++++++++ .../property-config/initialStudyColumns.js | 23 +++++ apps/directory/src/stores/studyStore.js | 43 +++++++++ apps/directory/src/views/StudyReport.vue | 87 +++++++++++++++++++ data/biobank-directory/molgenis.csv | 9 +- 6 files changed, 240 insertions(+), 4 deletions(-) create mode 100644 apps/directory/src/components/report-components/ReportStudyDetails.vue create mode 100644 apps/directory/src/components/report-components/StudyReportInfoCard.vue create mode 100644 apps/directory/src/property-config/initialStudyColumns.js create mode 100644 apps/directory/src/stores/studyStore.js create mode 100644 apps/directory/src/views/StudyReport.vue diff --git a/apps/directory/src/components/report-components/ReportStudyDetails.vue b/apps/directory/src/components/report-components/ReportStudyDetails.vue new file mode 100644 index 0000000000..a354d09940 --- /dev/null +++ b/apps/directory/src/components/report-components/ReportStudyDetails.vue @@ -0,0 +1,38 @@ + + + diff --git a/apps/directory/src/components/report-components/StudyReportInfoCard.vue b/apps/directory/src/components/report-components/StudyReportInfoCard.vue new file mode 100644 index 0000000000..7ab4f47d49 --- /dev/null +++ b/apps/directory/src/components/report-components/StudyReportInfoCard.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/apps/directory/src/property-config/initialStudyColumns.js b/apps/directory/src/property-config/initialStudyColumns.js new file mode 100644 index 0000000000..3fa43554ea --- /dev/null +++ b/apps/directory/src/property-config/initialStudyColumns.js @@ -0,0 +1,23 @@ +const initialStudyColumns = [ + { label: "Id:", column: "id", type: "string", showCopyIcon: true }, + { label: "Title:", column: "title", type: "string" }, + { label: "Description:", column: "description", type: "string" }, + { label: "Type:", column: "type", type: "string" }, + { label: "Sex:", column: { sex: ["label"] }, type: "array" }, + { label: "Number of subjects:", column: "number_of_subjects", type: "int" }, + { + label: "Age:", + type: "range", + min: "age_high", + max: "age_low", + unit: "age_unit", + unit_column: { age_unit: ["label"] }, + }, + { + label: "Also Known In:", + column: { also_known: ["name_system", "url"] }, + type: "xref", + }, +]; + +export default initialStudyColumns; diff --git a/apps/directory/src/stores/studyStore.js b/apps/directory/src/stores/studyStore.js new file mode 100644 index 0000000000..2c2069fc0f --- /dev/null +++ b/apps/directory/src/stores/studyStore.js @@ -0,0 +1,43 @@ +import { defineStore } from "pinia"; +import { QueryEMX2 } from "molgenis-components"; +import { useSettingsStore } from "./settingsStore"; + +export const useStudyStore = defineStore("studyStore", () => { + const settingsStore = useSettingsStore(); + + const studyColumns = settingsStore.config.studyColumns; + const graphqlEndpoint = settingsStore.config.graphqlEndpoint; + + function getStudyColumns() { + const properties = studyColumns + .filter((column) => column.column) + .flatMap((studyColumn) => studyColumn.column); + + const rangeProperties = studyColumns.filter( + (column) => column.type === "range" + ); + + for (const property of rangeProperties) { + properties.push(property.min, property.max, property.unit_column); + } + + return properties; + } + + async function getStudyReport(id) { + const studyReportQuery = new QueryEMX2(graphqlEndpoint) + .table("Studies") + .select(getStudyColumns()) + .orderBy("Studies", "id", "asc") + .where("id") + .like(id); + const reportResults = await studyReportQuery.execute(); + + return reportResults; + } + + return { + getStudyColumns, + getStudyReport, + }; +}); diff --git a/apps/directory/src/views/StudyReport.vue b/apps/directory/src/views/StudyReport.vue new file mode 100644 index 0000000000..a1f617f5dc --- /dev/null +++ b/apps/directory/src/views/StudyReport.vue @@ -0,0 +1,87 @@ + + + diff --git a/data/biobank-directory/molgenis.csv b/data/biobank-directory/molgenis.csv index f02df59740..bffefd6974 100644 --- a/data/biobank-directory/molgenis.csv +++ b/data/biobank-directory/molgenis.csv @@ -12,7 +12,7 @@ AlsoKnownIn,,id,ID,string,1,true,true,Unique ID.,,,,,,,,, AlsoKnownIn,,name_system,Name of the System,string,,true,,"Name of the source in which the biobank, collection or network also exists.",,,,,,,,, AlsoKnownIn,,pid,Persistent Identifier,string,,false,,"Persistent Identifier of the biobank, collection or network in the other source.",,,,,,,,, AlsoKnownIn,,url,URL,hyperlink,,true,,"Link to the biobank, collection or network in the other source.",,,,,,,,, -AlsoKnownIn,,national_node,National Node,ref,,true,,"The biobank, collection or network where this also known In refers to originates from this national node.",,NationalNodes,,${description},,,,, +AlsoKnownIn,,national_node,National Node,ref,,false,,"The biobank, collection or network where this also known In refers to originates from this national node.",,NationalNodes,,${description},,,,, AlsoKnownIn,,label,Name of the System,string,,false,true,"Name of the source in which the biobank, collection or network also exists.",,,,,,,,name_system, Biobanks,,,,,,,,"Description of the biobank organisation, like name, location, network, contact person, collaboration opportunities and quality assessments.",,,,,,,,, Biobanks,,id,ID,string,1,true,true,"Unique biobank ID within BBMRI-ERIC based on MIABIS 2.0 standard (ISO 3166-1 alpha-2 + underscore + biobank national ID or name), prefixed with bbmri-eric:ID: string - MIABIS-2.0-01.",,,,,,,,, @@ -115,6 +115,7 @@ Collections,,access_joint_project,Access via Join Projects to,ontology_array,,fa Collections,,access_description,Access Description,text,,false,,Short description of the access rules.,,,,,,,,, Collections,,access_uri,Access URI,hyperlink,,false,,URI describing the access policy.,,,,,,,,, Collections,,sop,PD/SOPs,ontology_array,,false,,Availability of Process Descriptions (PDs) and/or Standard Operating Procedures (SOPs).,DirectoryOntologies,SOPs,,${label},,,,, +Collections,,study,Study,ref,,false,,A link to a Study during which the collection was generated,,Studies,,,,,,, ContactPersonsNationalNodes,,,,,,,,Contact persons national nodes,,,,,,,,, ContactPersonsNationalNodes,,id,ID,string,1,true,true,Unique ID.,,,,,,,,, ContactPersonsNationalNodes,,first_name,First name,string,,false,,First name.,,,,,,,,, @@ -167,10 +168,10 @@ Studies,,id,ID,string,1,true,,"Unique ID of the study, prefixed with bbmri-eric: Studies,,title,Title,text,,true,,The title of the study,,,,,,,,, Studies,,description,Description,text,,false,,A text describing the study,,,,,,,,, Studies,,type,Type,string,,false,,"The type of study (Observational, Interventional). This is a string imported from ECRIN",,,,,,,,, -Studies,,sex,Sex,ontology_array,,false,,"The sex of the individuals that participated to the study",,SexTypes,,,,,,, +Studies,,sex,Sex,ontology_array,,false,,"The sex of the individuals that participated to the study",DirectoryOntologies,SexTypes,,,,,,, Studies,,age_low,Age Low,int,,false,,Age of youngest sample donor at time of sample donation - MIABIS-2.0-10.,,,,,,,,, Studies,,age_high,Age High,int,,false,,Age of oldest sample donor at time of sample donation - MIABIS-2.0-11.,,,,,,,,, -Studies,,age_unit,Age Unit,ontology,,false,,"Unit defining Age Low and Age High. Can be one of the following values: YEAR, MONTH, WEEK, DAY - MIABIS-2.0-08.",,AgeUnits,,${label},,,,, +Studies,,age_unit,Age Unit,ontology,,false,,"Unit defining Age Low and Age High. Can be one of the following values: YEAR, MONTH, WEEK, DAY - MIABIS-2.0-08.",DirectoryOntologies,AgeUnits,,${label},,,,, Studies,,number_of_subjects,Number of subjects,int,,false,,"The number of subjects that participated to the study",,,,,,,,, Studies,,also_known,Also Known In,ref_array,,false,,The study also exists in …,,AlsoKnownIn,,${name_system},,,,, -Studies,,collections,Collection,refback,,false,true,,,Collections,study,,,,,, \ No newline at end of file +Studies,,collections,Collections,refback,,false,true,,,Collections,study,,,,,, From 7bff87781ceaa6055895785469e83f65ee3d501f Mon Sep 17 00:00:00 2001 From: Vittorio Meloni Date: Fri, 31 May 2024 17:03:03 +0200 Subject: [PATCH 04/18] feat(apps/directory): adds viewing of studies related to collections --- .../CollectionReportInfoCard.vue | 20 ++++++++++++++ .../src/functions/viewmodelMapper.js | 26 +++++++++++++++++++ .../initialCollectionColumns.js | 5 ++++ apps/directory/src/router/index.js | 6 +++++ apps/directory/src/stores/settingsStore.js | 2 ++ 5 files changed, 59 insertions(+) diff --git a/apps/directory/src/components/report-components/CollectionReportInfoCard.vue b/apps/directory/src/components/report-components/CollectionReportInfoCard.vue index 08869a7f62..46d735e861 100644 --- a/apps/directory/src/components/report-components/CollectionReportInfoCard.vue +++ b/apps/directory/src/components/report-components/CollectionReportInfoCard.vue @@ -98,6 +98,26 @@ +