From 7ba554848542f46a60bdb82c54d84d186d6e685e Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Tue, 2 Jan 2024 17:19:31 +0100 Subject: [PATCH] Add ARCMock module --- src/ARCTokenization/ARCMock.fs | 424 ++++++++++++++++++ src/ARCTokenization/ARCTokenization.fsproj | 1 + src/ARCTokenization/Terms.fs | 15 + .../arc_file_structure_ontology.obo | 2 +- .../assay_metadata_structural_ontology.obo | 2 +- ...stigation_metadata_structural_ontology.obo | 2 +- .../study_metadata_structural_ontology.obo | 2 +- .../correct/investigation_simple.xlsx | Bin 12766 -> 12794 bytes .../IntegrationTests/InvestigationMetadata.fs | 125 +----- 9 files changed, 460 insertions(+), 113 deletions(-) create mode 100644 src/ARCTokenization/ARCMock.fs diff --git a/src/ARCTokenization/ARCMock.fs b/src/ARCTokenization/ARCMock.fs new file mode 100644 index 0000000..caf8ce4 --- /dev/null +++ b/src/ARCTokenization/ARCMock.fs @@ -0,0 +1,424 @@ +namespace ARCTokenization + +open ControlledVocabulary + +type ARCMock = + + /// + /// returns a mock list of CvParams lists which each represent a tokenized row of investigation metadata. + /// each mandatory row is present, containing at least one CvParam annotated as MetadataSectionKey (the first column of an ISA-XLSX investigation metadata sheet). + /// each row can be expanded with additional CvParams by setting the respective optional argument. + /// + static member InvestigationMetadataTokens( + ?ONTOLOGY_SOURCE_REFERENCE: seq, + ?Term_Source_Name: seq, + ?Term_Source_File: seq, + ?Term_Source_Version: seq, + ?Term_Source_Description: seq, + ?INVESTIGATION: seq, + ?Investigation_Identifier: seq, + ?Investigation_Title: seq, + ?Investigation_Description: seq, + ?Investigation_Submission_Date: seq, + ?Investigation_Public_Release_Date: seq, + ?INVESTIGATION_PUBLICATIONS: seq, + ?Investigation_Publication_PubMed_ID: seq, + ?Investigation_Publication_DOI: seq, + ?Investigation_Publication_Author_List: seq, + ?Investigation_Publication_Title: seq, + ?Investigation_Publication_Status: seq, + ?Investigation_Publication_Status_Term_Accession_Number: seq, + ?Investigation_Publication_Status_Term_Source_REF: seq, + ?INVESTIGATION_CONTACTS: seq, + ?Investigation_Person_Last_Name: seq, + ?Investigation_Person_First_Name: seq, + ?Investigation_Person_Mid_Initials: seq, + ?Investigation_Person_Email: seq, + ?Investigation_Person_Phone: seq, + ?Investigation_Person_Fax: seq, + ?Investigation_Person_Address: seq, + ?Investigation_Person_Affiliation: seq, + ?Investigation_Person_Roles: seq, + ?Investigation_Person_Roles_Term_Accession_Number: seq, + ?Investigation_Person_Roles_Term_Source_REF: seq, + ?Comment_ORCID: seq, + ?STUDY: seq, + ?Study_Identifier: seq, + ?Study_Title: seq, + ?Study_Description: seq, + ?Study_Submission_Date: seq, + ?Study_Public_Release_Date: seq, + ?Study_File_Name: seq, + ?STUDY_DESIGN_DESCRIPTORS: seq, + ?Study_Design_Type: seq, + ?Study_Design_Type_Term_Accession_Number: seq, + ?Study_Design_Type_Term_Source_REF: seq, + ?STUDY_PUBLICATIONS: seq, + ?Study_Publication_PubMed_ID: seq, + ?Study_Publication_DOI: seq, + ?Study_Publication_Author_List: seq, + ?Study_Publication_Title: seq, + ?Study_Publication_Status: seq, + ?Study_Publication_Status_Term_Accession_Number: seq, + ?Study_Publication_Status_Term_Source_REF: seq, + ?STUDY_FACTORS: seq, + ?Study_Factor_Name: seq, + ?Study_Factor_Type: seq, + ?Study_Factor_Type_Term_Accession_Number: seq, + ?Study_Factor_Type_Term_Source_REF: seq, + ?STUDY_ASSAYS: seq, + ?Study_Assay_Measurement_Type: seq, + ?Study_Assay_Measurement_Type_Term_Accession_Number: seq, + ?Study_Assay_Measurement_Type_Term_Source_REF: seq, + ?Study_Assay_Technology_Type: seq, + ?Study_Assay_Technology_Type_Term_Accession_Number: seq, + ?Study_Assay_Technology_Type_Term_Source_REF: seq, + ?Study_Assay_Technology_Platform: seq, + ?Study_Assay_File_Name: seq, + ?STUDY_PROTOCOLS: seq, + ?Study_Protocol_Name: seq, + ?Study_Protocol_Type: seq, + ?Study_Protocol_Type_Term_Accession_Number: seq, + ?Study_Protocol_Type_Term_Source_REF: seq, + ?Study_Protocol_Description: seq, + ?Study_Protocol_URI: seq, + ?Study_Protocol_Version: seq, + ?Study_Protocol_Parameters_Name: seq, + ?Study_Protocol_Parameters_Term_Accession_Number: seq, + ?Study_Protocol_Parameters_Term_Source_REF: seq, + ?Study_Protocol_Components_Name: seq, + ?Study_Protocol_Components_Type: seq, + ?Study_Protocol_Components_Type_Term_Accession_Number: seq, + ?Study_Protocol_Components_Type_Term_Source_REF: seq, + ?STUDY_CONTACTS: seq, + ?Study_Person_Last_Name: seq, + ?Study_Person_First_Name: seq, + ?Study_Person_Mid_Initials: seq, + ?Study_Person_Email: seq, + ?Study_Person_Phone: seq, + ?Study_Person_Fax: seq, + ?Study_Person_Address: seq, + ?Study_Person_Affiliation: seq, + ?Study_Person_Roles: seq, + ?Study_Person_Roles_Term_Accession_Number: seq, + ?Study_Person_Roles_Term_Source_REF: seq + ) = + let valueRows = + [ + ["" ; yield! ONTOLOGY_SOURCE_REFERENCE |> Option.defaultValue Seq.empty] + ["" ; yield! Term_Source_Name |> Option.defaultValue Seq.empty] + ["" ; yield! Term_Source_File |> Option.defaultValue Seq.empty] + ["" ; yield! Term_Source_Version |> Option.defaultValue Seq.empty] + ["" ; yield! Term_Source_Description |> Option.defaultValue Seq.empty] + ["" ; yield! INVESTIGATION |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Identifier |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Title |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Description |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Submission_Date |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Public_Release_Date |> Option.defaultValue Seq.empty] + ["" ; yield! INVESTIGATION_PUBLICATIONS |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Publication_PubMed_ID |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Publication_DOI |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Publication_Author_List |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Publication_Title |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Publication_Status |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Publication_Status_Term_Accession_Number |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Publication_Status_Term_Source_REF |> Option.defaultValue Seq.empty] + ["" ; yield! INVESTIGATION_CONTACTS |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Person_Last_Name |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Person_First_Name |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Person_Mid_Initials |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Person_Email |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Person_Phone |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Person_Fax |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Person_Address |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Person_Affiliation |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Person_Roles |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Person_Roles_Term_Accession_Number |> Option.defaultValue Seq.empty] + ["" ; yield! Investigation_Person_Roles_Term_Source_REF |> Option.defaultValue Seq.empty] + ["" ; yield! Comment_ORCID |> Option.defaultValue Seq.empty] + ["" ; yield! STUDY |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Identifier |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Title |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Description |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Submission_Date |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Public_Release_Date |> Option.defaultValue Seq.empty] + ["" ; yield! Study_File_Name |> Option.defaultValue Seq.empty] + ["" ; yield! STUDY_DESIGN_DESCRIPTORS |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Design_Type |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Design_Type_Term_Accession_Number |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Design_Type_Term_Source_REF |> Option.defaultValue Seq.empty] + ["" ; yield! STUDY_PUBLICATIONS |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Publication_PubMed_ID |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Publication_DOI |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Publication_Author_List |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Publication_Title |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Publication_Status |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Publication_Status_Term_Accession_Number |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Publication_Status_Term_Source_REF |> Option.defaultValue Seq.empty] + ["" ; yield! STUDY_FACTORS |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Factor_Name |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Factor_Type |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Factor_Type_Term_Accession_Number |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Factor_Type_Term_Source_REF |> Option.defaultValue Seq.empty] + ["" ; yield! STUDY_ASSAYS |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Assay_Measurement_Type |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Assay_Measurement_Type_Term_Accession_Number |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Assay_Measurement_Type_Term_Source_REF |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Assay_Technology_Type |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Assay_Technology_Type_Term_Accession_Number |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Assay_Technology_Type_Term_Source_REF |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Assay_Technology_Platform |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Assay_File_Name |> Option.defaultValue Seq.empty] + ["" ; yield! STUDY_PROTOCOLS |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Protocol_Name |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Protocol_Type |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Protocol_Type_Term_Accession_Number |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Protocol_Type_Term_Source_REF |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Protocol_Description |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Protocol_URI |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Protocol_Version |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Protocol_Parameters_Name |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Protocol_Parameters_Term_Accession_Number |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Protocol_Parameters_Term_Source_REF |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Protocol_Components_Name |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Protocol_Components_Type |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Protocol_Components_Type_Term_Accession_Number |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Protocol_Components_Type_Term_Source_REF |> Option.defaultValue Seq.empty] + ["" ; yield! STUDY_CONTACTS |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Person_Last_Name |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Person_First_Name |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Person_Mid_Initials |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Person_Email |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Person_Phone |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Person_Fax |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Person_Address |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Person_Affiliation |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Person_Roles |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Person_Roles_Term_Accession_Number |> Option.defaultValue Seq.empty] + ["" ; yield! Study_Person_Roles_Term_Source_REF |> Option.defaultValue Seq.empty] + ] + + Terms.InvestigationMetadata.nonObsoleteCvTerms + |> List.skip 1 //(ignore root term) + |> List.filter (fun t -> (not (t.Name.StartsWith("Comment"))) || (t.Name.Equals("Comment[ORCID]"))) // ignore all comments except non-obsolete orcid + |> List.zip valueRows + |> List.map (fun (values,term) -> + values + |> List.mapi (fun i v -> + if i = 0 then + CvParam(term, ParamValue.CvValue Terms.StructuralTerms.metadataSectionKey, []) + else + CvParam(term, ParamValue.Value v, []) + ) + ) + |> List.concat + + /// + /// returns a mock list of CvParams lists which each represent a tokenized row of study metadata. + /// each mandatory row is present, containing at least one CvParam annotated as MetadataSectionKey (the first column of an ISA-XLSX study metadata sheet). + /// each row can be expanded with additional CvParams by setting the respective optional argument. + /// + static member StudyMetadataTokens( + ?STUDY: seq, + ?Study_Identifier: seq, + ?Study_Title: seq, + ?Study_Description: seq, + ?Study_Submission_Date: seq, + ?Study_Public_Release_Date: seq, + ?Study_File_Name: seq, + ?STUDY_DESIGN_DESCRIPTORS: seq, + ?Study_Design_Type: seq, + ?Study_Design_Type_Term_Accession_Number: seq, + ?Study_Design_Type_Term_Source_REF: seq, + ?STUDY_PUBLICATIONS: seq, + ?Study_Publication_PubMed_ID: seq, + ?Study_Publication_DOI: seq, + ?Study_Publication_Author_List: seq, + ?Study_Publication_Title: seq, + ?Study_Publication_Status: seq, + ?Study_Publication_Status_Term_Accession_Number: seq, + ?Study_Publication_Status_Term_Source_REF: seq, + ?STUDY_FACTORS: seq, + ?Study_Factor_Name: seq, + ?Study_Factor_Type: seq, + ?Study_Factor_Type_Term_Accession_Number: seq, + ?Study_Factor_Type_Term_Source_REF: seq, + ?STUDY_ASSAYS: seq, + ?Study_Assay_Measurement_Type: seq, + ?Study_Assay_Measurement_Type_Term_Accession_Number: seq, + ?Study_Assay_Measurement_Type_Term_Source_REF: seq, + ?Study_Assay_Technology_Type: seq, + ?Study_Assay_Technology_Type_Term_Accession_Number: seq, + ?Study_Assay_Technology_Type_Term_Source_REF: seq, + ?Study_Assay_Technology_Platform: seq, + ?Study_Assay_File_Name: seq, + ?STUDY_PROTOCOLS: seq, + ?Study_Protocol_Name: seq, + ?Study_Protocol_Type: seq, + ?Study_Protocol_Type_Term_Accession_Number: seq, + ?Study_Protocol_Type_Term_Source_REF: seq, + ?Study_Protocol_Description: seq, + ?Study_Protocol_URI: seq, + ?Study_Protocol_Version: seq, + ?Study_Protocol_Parameters_Name: seq, + ?Study_Protocol_Parameters_Term_Accession_Number: seq, + ?Study_Protocol_Parameters_Term_Source_REF: seq, + ?Study_Protocol_Components_Name: seq, + ?Study_Protocol_Components_Type: seq, + ?Study_Protocol_Components_Type_Term_Accession_Number: seq, + ?Study_Protocol_Components_Type_Term_Source_REF: seq, + ?STUDY_CONTACTS: seq, + ?Study_Person_Last_Name: seq, + ?Study_Person_First_Name: seq, + ?Study_Person_Mid_Initials: seq, + ?Study_Person_Email: seq, + ?Study_Person_Phone: seq, + ?Study_Person_Fax: seq, + ?Study_Person_Address: seq, + ?Study_Person_Affiliation: seq, + ?Study_Person_Roles: seq, + ?Study_Person_Roles_Term_Accession_Number: seq, + ?Study_Person_Roles_Term_Source_REF: seq + ) = + let valueRows = [ + [""; yield! STUDY |> Option.defaultValue Seq.empty ] + [""; yield! Study_Identifier |> Option.defaultValue Seq.empty ] + [""; yield! Study_Title |> Option.defaultValue Seq.empty ] + [""; yield! Study_Description |> Option.defaultValue Seq.empty ] + [""; yield! Study_Submission_Date |> Option.defaultValue Seq.empty ] + [""; yield! Study_Public_Release_Date |> Option.defaultValue Seq.empty ] + [""; yield! Study_File_Name |> Option.defaultValue Seq.empty ] + [""; yield! STUDY_DESIGN_DESCRIPTORS |> Option.defaultValue Seq.empty ] + [""; yield! Study_Design_Type |> Option.defaultValue Seq.empty ] + [""; yield! Study_Design_Type_Term_Accession_Number |> Option.defaultValue Seq.empty ] + [""; yield! Study_Design_Type_Term_Source_REF |> Option.defaultValue Seq.empty ] + [""; yield! STUDY_PUBLICATIONS |> Option.defaultValue Seq.empty ] + [""; yield! Study_Publication_PubMed_ID |> Option.defaultValue Seq.empty ] + [""; yield! Study_Publication_DOI |> Option.defaultValue Seq.empty ] + [""; yield! Study_Publication_Author_List |> Option.defaultValue Seq.empty ] + [""; yield! Study_Publication_Title |> Option.defaultValue Seq.empty ] + [""; yield! Study_Publication_Status |> Option.defaultValue Seq.empty ] + [""; yield! Study_Publication_Status_Term_Accession_Number |> Option.defaultValue Seq.empty ] + [""; yield! Study_Publication_Status_Term_Source_REF |> Option.defaultValue Seq.empty ] + [""; yield! STUDY_FACTORS |> Option.defaultValue Seq.empty ] + [""; yield! Study_Factor_Name |> Option.defaultValue Seq.empty ] + [""; yield! Study_Factor_Type |> Option.defaultValue Seq.empty ] + [""; yield! Study_Factor_Type_Term_Accession_Number |> Option.defaultValue Seq.empty ] + [""; yield! Study_Factor_Type_Term_Source_REF |> Option.defaultValue Seq.empty ] + [""; yield! STUDY_ASSAYS |> Option.defaultValue Seq.empty ] + [""; yield! Study_Assay_Measurement_Type |> Option.defaultValue Seq.empty ] + [""; yield! Study_Assay_Measurement_Type_Term_Accession_Number |> Option.defaultValue Seq.empty ] + [""; yield! Study_Assay_Measurement_Type_Term_Source_REF |> Option.defaultValue Seq.empty ] + [""; yield! Study_Assay_Technology_Type |> Option.defaultValue Seq.empty ] + [""; yield! Study_Assay_Technology_Type_Term_Accession_Number |> Option.defaultValue Seq.empty ] + [""; yield! Study_Assay_Technology_Type_Term_Source_REF |> Option.defaultValue Seq.empty ] + [""; yield! Study_Assay_Technology_Platform |> Option.defaultValue Seq.empty ] + [""; yield! Study_Assay_File_Name |> Option.defaultValue Seq.empty ] + [""; yield! STUDY_PROTOCOLS |> Option.defaultValue Seq.empty ] + [""; yield! Study_Protocol_Name |> Option.defaultValue Seq.empty ] + [""; yield! Study_Protocol_Type |> Option.defaultValue Seq.empty ] + [""; yield! Study_Protocol_Type_Term_Accession_Number |> Option.defaultValue Seq.empty ] + [""; yield! Study_Protocol_Type_Term_Source_REF |> Option.defaultValue Seq.empty ] + [""; yield! Study_Protocol_Description |> Option.defaultValue Seq.empty ] + [""; yield! Study_Protocol_URI |> Option.defaultValue Seq.empty ] + [""; yield! Study_Protocol_Version |> Option.defaultValue Seq.empty ] + [""; yield! Study_Protocol_Parameters_Name |> Option.defaultValue Seq.empty ] + [""; yield! Study_Protocol_Parameters_Term_Accession_Number |> Option.defaultValue Seq.empty ] + [""; yield! Study_Protocol_Parameters_Term_Source_REF |> Option.defaultValue Seq.empty ] + [""; yield! Study_Protocol_Components_Name |> Option.defaultValue Seq.empty ] + [""; yield! Study_Protocol_Components_Type |> Option.defaultValue Seq.empty ] + [""; yield! Study_Protocol_Components_Type_Term_Accession_Number |> Option.defaultValue Seq.empty ] + [""; yield! Study_Protocol_Components_Type_Term_Source_REF |> Option.defaultValue Seq.empty ] + [""; yield! STUDY_CONTACTS |> Option.defaultValue Seq.empty ] + [""; yield! Study_Person_Last_Name |> Option.defaultValue Seq.empty ] + [""; yield! Study_Person_First_Name |> Option.defaultValue Seq.empty ] + [""; yield! Study_Person_Mid_Initials |> Option.defaultValue Seq.empty ] + [""; yield! Study_Person_Email |> Option.defaultValue Seq.empty ] + [""; yield! Study_Person_Phone |> Option.defaultValue Seq.empty ] + [""; yield! Study_Person_Fax |> Option.defaultValue Seq.empty ] + [""; yield! Study_Person_Address |> Option.defaultValue Seq.empty ] + [""; yield! Study_Person_Affiliation |> Option.defaultValue Seq.empty ] + [""; yield! Study_Person_Roles |> Option.defaultValue Seq.empty ] + [""; yield! Study_Person_Roles_Term_Accession_Number |> Option.defaultValue Seq.empty ] + [""; yield! Study_Person_Roles_Term_Source_REF |> Option.defaultValue Seq.empty ] + ] + + Terms.StudyMetadata.nonObsoleteCvTerms + |> List.skip 1 //(ignore root term) + |> List.filter (fun t -> not (t.Name.StartsWith("Comment"))) // ignore all comments + |> List.zip valueRows + |> List.map (fun (values,term) -> + values + |> List.mapi (fun i v -> + if i = 0 then + CvParam(term, ParamValue.CvValue Terms.StructuralTerms.metadataSectionKey, []) + else + CvParam(term, ParamValue.Value v, []) + ) + ) + |> List.concat + + /// + /// returns a mock list of CvParams lists which each represent a tokenized row of assay metadata. + /// each mandatory row is present, containing at least one CvParam annotated as MetadataSectionKey (the first column of an ISA-XLSX assay metadata sheet). + /// each row can be expanded with additional CvParams by setting the respective optional argument. + /// + static member AssayMetadataTokens( + ?ASSAY: seq, + ?Assay_Measurement_Type: seq, + ?Assay_Measurement_Type_Term_Accession_Number: seq, + ?Assay_Measurement_Type_Term_Source_REF: seq, + ?Assay_Technology_Type: seq, + ?Assay_Technology_Type_Term_Source_REF: seq, + ?Assay_Technology_Platform: seq, + ?Assay_File_Name: seq, + ?ASSAY_PERFORMERS: seq, + ?Assay_Performer_Last_Name: seq, + ?Assay_Performer_First_Name: seq, + ?Assay_Performer_Mid_Initials: seq, + ?Assay_Performer_Email: seq, + ?Assay_Performer_Phone: seq, + ?Assay_Performer_Fax: seq, + ?Assay_Performer_Address: seq, + ?Assay_Performer_Affiliation: seq, + ?Assay_Performer_Roles: seq, + ?Assay_Performer_Roles_Term_Accession_Number: seq, + ?Assay_Performer_Roles_Term_Source_REF: seq + ) = + let valueRows = [ + [""; yield! ASSAY |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Measurement_Type |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Measurement_Type_Term_Accession_Number |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Measurement_Type_Term_Source_REF |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Technology_Type |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Technology_Type_Term_Source_REF |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Technology_Platform |> Option.defaultValue Seq.empty ] + [""; yield! Assay_File_Name |> Option.defaultValue Seq.empty ] + [""; yield! ASSAY_PERFORMERS |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Performer_Last_Name |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Performer_First_Name |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Performer_Mid_Initials |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Performer_Email |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Performer_Phone |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Performer_Fax |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Performer_Address |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Performer_Affiliation |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Performer_Roles |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Performer_Roles_Term_Accession_Number |> Option.defaultValue Seq.empty ] + [""; yield! Assay_Performer_Roles_Term_Source_REF |> Option.defaultValue Seq.empty ] + ] + + Terms.AssayMetadata.nonObsoleteCvTerms + |> List.skip 1 //(ignore root term) + |> List.filter (fun t -> not (t.Name.StartsWith("Comment"))) // ignore all comments + |> List.zip valueRows + |> List.map (fun (values,term) -> + values + |> List.mapi (fun i v -> + if i = 0 then + CvParam(term, ParamValue.CvValue Terms.StructuralTerms.metadataSectionKey, []) + else + CvParam(term, ParamValue.Value v, []) + ) + ) \ No newline at end of file diff --git a/src/ARCTokenization/ARCTokenization.fsproj b/src/ARCTokenization/ARCTokenization.fsproj index b44b1dd..f2daf83 100644 --- a/src/ARCTokenization/ARCTokenization.fsproj +++ b/src/ARCTokenization/ARCTokenization.fsproj @@ -40,6 +40,7 @@ + diff --git a/src/ARCTokenization/Terms.fs b/src/ARCTokenization/Terms.fs index 9fb9876..3397b0b 100644 --- a/src/ARCTokenization/Terms.fs +++ b/src/ARCTokenization/Terms.fs @@ -22,6 +22,11 @@ module InvestigationMetadata = let ontology = OboOntology.fromLines true obo + let nonObsoleteCvTerms = + ontology.Terms + |> List.filter (fun t -> not t.IsObsolete) + |> List.map (fun t -> CvTerm.create(accession = t.Id, name = t.Name, ref = "INVMSO")) + let obsoleteCvTerms = ontology.Terms |> List.filter (fun t -> t.IsObsolete) @@ -37,6 +42,11 @@ module StudyMetadata = let ontology = OboOntology.fromLines true obo + let nonObsoleteCvTerms = + ontology.Terms + |> List.filter (fun t -> not t.IsObsolete) + |> List.map (fun t -> CvTerm.create(accession = t.Id, name = t.Name, ref = "INVMSO")) + let obsoleteCvTerms = ontology.Terms |> List.filter (fun t -> t.IsObsolete) @@ -52,6 +62,11 @@ module AssayMetadata = let ontology = OboOntology.fromLines true obo + let nonObsoleteCvTerms = + ontology.Terms + |> List.filter (fun t -> not t.IsObsolete) + |> List.map (fun t -> CvTerm.create(accession = t.Id, name = t.Name, ref = "INVMSO")) + let cvTerms = ontology.Terms |> List.map (fun t -> CvTerm.create(accession = t.Id, name = t.Name, ref = "ASSMSO")) diff --git a/src/ARCTokenization/structural_ontologies/arc_file_structure_ontology.obo b/src/ARCTokenization/structural_ontologies/arc_file_structure_ontology.obo index 8c58d90..b3ce5d6 100644 --- a/src/ARCTokenization/structural_ontologies/arc_file_structure_ontology.obo +++ b/src/ARCTokenization/structural_ontologies/arc_file_structure_ontology.obo @@ -1,4 +1,4 @@ -!This file was auto generated on 18.12.2023. Do not edit it. All manual changes will be overwritten by the next generator run eventually. +!This file was auto generated on 2024-01-02. Do not edit it. All manual changes will be overwritten by the next generator run eventually. format-version: 1.2 data-version: init/2023-10-26 saved-by: Kevin Schneider diff --git a/src/ARCTokenization/structural_ontologies/assay_metadata_structural_ontology.obo b/src/ARCTokenization/structural_ontologies/assay_metadata_structural_ontology.obo index a22bf10..ffccbff 100644 --- a/src/ARCTokenization/structural_ontologies/assay_metadata_structural_ontology.obo +++ b/src/ARCTokenization/structural_ontologies/assay_metadata_structural_ontology.obo @@ -1,4 +1,4 @@ -!This file was auto generated on 18.12.2023. Do not edit it. All manual changes will be overwritten by the next generator run eventually. +!This file was auto generated on 2024-01-02. Do not edit it. All manual changes will be overwritten by the next generator run eventually. format-version: 1.2 data-version: init/2023-07-27 saved-by: Kevin Schneider diff --git a/src/ARCTokenization/structural_ontologies/investigation_metadata_structural_ontology.obo b/src/ARCTokenization/structural_ontologies/investigation_metadata_structural_ontology.obo index 1f61cad..c483d40 100644 --- a/src/ARCTokenization/structural_ontologies/investigation_metadata_structural_ontology.obo +++ b/src/ARCTokenization/structural_ontologies/investigation_metadata_structural_ontology.obo @@ -1,4 +1,4 @@ -!This file was auto generated on 18.12.2023. Do not edit it. All manual changes will be overwritten by the next generator run eventually. +!This file was auto generated on 2024-01-02. Do not edit it. All manual changes will be overwritten by the next generator run eventually. format-version: 1.2 data-version: init/2023-07-20 saved-by: Kevin Schneider diff --git a/src/ARCTokenization/structural_ontologies/study_metadata_structural_ontology.obo b/src/ARCTokenization/structural_ontologies/study_metadata_structural_ontology.obo index bfdfb35..aad3c3e 100644 --- a/src/ARCTokenization/structural_ontologies/study_metadata_structural_ontology.obo +++ b/src/ARCTokenization/structural_ontologies/study_metadata_structural_ontology.obo @@ -1,4 +1,4 @@ -!This file was auto generated on 18.12.2023. Do not edit it. All manual changes will be overwritten by the next generator run eventually. +!This file was auto generated on 2024-01-02. Do not edit it. All manual changes will be overwritten by the next generator run eventually. format-version: 1.2 data-version: init/2023-07-27 saved-by: Kevin Schneider diff --git a/tests/ARCTokenization.Tests/Fixtures/correct/investigation_simple.xlsx b/tests/ARCTokenization.Tests/Fixtures/correct/investigation_simple.xlsx index f13d19035be9bd34c23910d4e7e31d648a9394cb..689b53e083410453263a1dfa462492b210aefb68 100644 GIT binary patch delta 3975 zcmaJ^cQo8xw;rQ}Nwh&ki58+8C3*>7ZFG@Qf`rjKQG(zXogj=sv=D7XuR+u(Q6dx__6Vx(LRdNA=-HyV;4N8I4+0jf*W10@HJF6dzj3QoP!$ z-f*SjpdBy8UMEmQGofnPE4J9XyA#*7Ule3&0(;1J*Dri4C05|GAxfkz20MXpp+ptl zTVUWN0*a^u3L!y^mlxCfx_v+2Qw`q)dC=vSe?_cF@y+6r-tik4P-K|*B{`UUj?d?V z!!h;AYc(En6XaP*!ml2M>pu=<-^nWU7Q!_Zm^ZK`-BbxXbsFFs&rMn7^58-Z``8xc zm4T3h5X=)MeVY_VzuE=mBp(8+O;7xk))C1T&?R)^@iXYVp;vsSd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wHJMjw0Z2qTQ;*qln^OlH>b zg`CvJ*TXx(99Korx$Yg`pjy$CC^r*?T^iB&yLDh)4%w>kThY|ILZX@5Y735Csg$Ax4c~j=uqyWvPXgi6!|IgQWv`F1=UgX5~9Q3f6D4@ zH++pW-WbTw)BI2OimjG}lG$RUB)I=uJd+Y73CsVEbb4%x z6dTq~N|NjvHd*Qp*#ve>N}a)y=kKo9*Dna^?28?dWaaw5dG@~tfI!n&V`&ktzaNJT d1llLfOaEI8`i#X$tCGoJN2CQQFG&6+`WKr2XhHx0 diff --git a/tests/ARCTokenization.Tests/IntegrationTests/InvestigationMetadata.fs b/tests/ARCTokenization.Tests/IntegrationTests/InvestigationMetadata.fs index 386d7a8..cf8b4a5 100644 --- a/tests/ARCTokenization.Tests/IntegrationTests/InvestigationMetadata.fs +++ b/tests/ARCTokenization.Tests/IntegrationTests/InvestigationMetadata.fs @@ -33,117 +33,24 @@ module InvestigationMetadata = CvParam.structuralEquality (expected) (actual :?> CvParam) )) - let expectedTermValuesSimple = - [ - [""] - [""] - [""] - [""] - [""] - [""] - [""; "iid"] - [""; "ititle"] - [""; "idesc"] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""; "Maus"; "Keider"; "müller"; ""; "oih"] - [""; "Oliver"; ""; "andreas";] - [""; "L. I."; "C."] - [""; "maus@nfdi4plants.org"] - [""] - [""] - [""] - [""; ""; "Affe"] - [""] - [""] - [""] - [""] - [""; "sid"] - [""; "stitle"] - [""; "sdesc"] - [""] - [""] - [""; @"sid\isa.study.xlsx"] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""; @"aid\isa.assay.xlsx"; @"aid2\isa.assay.xlsx"] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""; "weil"] - [""; ""; "lukas"] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - [""] - ] - let allExpectedMetadataTermsFull = - Terms.InvestigationMetadata.cvTerms - |> List.skip 1 //(ignore root term) - |> List.filter (fun t -> not (t.Name.StartsWith("Comment"))) // ignore orcids - |> List.filter (fun t -> not (List.contains t Terms.InvestigationMetadata.obsoleteCvTerms)) // ignore obsolete terms - |> List.zip expectedTermValuesSimple - |> List.map (fun (values,term) -> - values - |> List.mapi (fun i v -> - if i = 0 then - CvParam(term, ParamValue.CvValue (CvTerm.create(accession = "AGMO:00000001", name = "Metadata Section Key", ref = "AGMO")), []) - else - CvParam(term, ParamValue.Value v, []) - ) + ARCMock.InvestigationMetadataTokens( + Investigation_Identifier = ["iid"], + Investigation_Title = ["ititle"], + Investigation_Description = ["idesc"], + Investigation_Person_Last_Name = ["Maus"; "Keider"; "müller"; ""; "oih"], + Investigation_Person_First_Name = ["Oliver"; ""; "andreas";], + Investigation_Person_Mid_Initials = ["L. I."; "C."], + Investigation_Person_Email = ["maus@nfdi4plants.org"], + Investigation_Person_Affiliation = [""; "Affe"], + Study_Identifier = ["sid"], + Study_Title = ["stitle"], + Study_Description = ["sdesc"], + Study_File_Name = [@"sid\isa.study.xlsx"], + Study_Assay_File_Name = [@"aid\isa.assay.xlsx"; @"aid2\isa.assay.xlsx"], + Study_Person_Last_Name = ["weil"], + Study_Person_First_Name = [""; "lukas"] ) - |> List.concat [] let ``Simple investigation is parsed with all structural ontology terms in order`` () =