From f89781d724114c745d59623c5f094504607018bf Mon Sep 17 00:00:00 2001 From: Anh Nguyet Vu <32753274+anngvu@users.noreply.github.com> Date: Thu, 1 Feb 2024 18:11:58 -0700 Subject: [PATCH] Feat/examples (#84) * Add first examples to validation * Ignore GE intermediates * Update config comment * Update example --- .gitignore | 1 + config.yml | 5 +++-- tests/validate/config.json | 18 ++++++++++++++++++ tests/validate/examples/my_cohort.csv | 3 +++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 tests/validate/config.json create mode 100644 tests/validate/examples/my_cohort.csv diff --git a/.gitignore b/.gitignore index 31925ec..20f5df8 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ schematic_service_account_creds.json tests/generate/GF.jsonld tests/generate/config.json tests/generate/creds.json +great_expectations # Tools retold diff --git a/config.yml b/config.yml index 3181374..e1fb4e8 100644 --- a/config.yml +++ b/config.yml @@ -1,4 +1,5 @@ -# Do not change the "definitions" section unless you know what you"re doing +# This config format is guaranteed to work with schematicpy versions between 23.9.1 and 24.1.1 only. +# Schematic often changes the config format without notice, check the docs and your installed version. # Usage: schematic manifest -c config.yml get -dt ClinicalAssay -t "Test Manifest" --jsonld ./NF.jsonld -s asset_store: synapse: @@ -11,7 +12,7 @@ manifest: data_type: # Clinical Data - - "CohortCore" + - "CohortCoreTemplate" - "CohortCoreRFC" - "CohortCorePortal" diff --git a/tests/validate/config.json b/tests/validate/config.json new file mode 100644 index 0000000..11f06e6 --- /dev/null +++ b/tests/validate/config.json @@ -0,0 +1,18 @@ +{ "meta": "Validate example manifests against templates with schematic and data model.", + "schematic_reference": { + "version": "23.1.1", + "flags" : + { + "great_expectations" : true + } + }, + "tests": [ + { + "manifest": "examples/my_cohort.csv", + "template": "CohortCoreTemplate", + "expect_pass": true, + "expectation": "Should pass", + "comment": "Contains mock data for two patients" + } + ] +} \ No newline at end of file diff --git a/tests/validate/examples/my_cohort.csv b/tests/validate/examples/my_cohort.csv new file mode 100644 index 0000000..877c2ae --- /dev/null +++ b/tests/validate/examples/my_cohort.csv @@ -0,0 +1,3 @@ +Component,ParticipantID,TimepointLabel,Age,Sex,BMI,Race,Ethnicity,VitalStatus,Height,Weight,Gravidity,Parity,AgeAtMenarche,MenstrualCyclePhase,MenopauseStatus,PrimaryDiagnosis,AgeatDiagnosis,DiagnosisStatusType,ClassBRCA1,ClassBRCA2,TobaccoUse,PackYearsSmoked,AlcoholUse,NumberofDrinksPerWeek,AntibioticUse,SampleCollectionCenter,SampleCollectionYear,ERStatus,PRStatus,HER2Status,Id,entityId +CohortCoreTemplate,ABC123,,30,female,30.5,white,not hispanic or latino,Alive,Not Reported,Not Reported,0,0,12,Not Reported,Pre,,Not Reported,Not Applicable,Positive,,Former,Unknown- 2yrs,Yes,2,Unknown,MGH,Not Reported,Positive,,,f4fa455b-a495-4ffa-b807-7525947da662,syn53461756 +CohortCoreTemplate,ABC456,,31,female,22.2,white,not hispanic or latino,Alive,Not Reported,Not Reported,1,1,13,Not Reported,Pre,,Not Reported,Not Applicable,Positive,,Never,0.3ppd-unknown,Occasionally,<1,Unknown,MGH,Not Reported,Positive,Negative,Negative,6d049ab5-f089-4c32-9306-f9fb4765ca20,syn53461756