From f0924cc3b5776a1de9d5e002cfd416ec3cc5d9d3 Mon Sep 17 00:00:00 2001 From: Natasha Singh Date: Thu, 11 Apr 2024 14:45:34 -0400 Subject: [PATCH 1/3] :sparkles: Restrict release_status to enum values --- dataservice/api/genomic_file/schemas.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dataservice/api/genomic_file/schemas.py b/dataservice/api/genomic_file/schemas.py index 56e62918..0da9a6ed 100644 --- a/dataservice/api/genomic_file/schemas.py +++ b/dataservice/api/genomic_file/schemas.py @@ -145,6 +145,12 @@ "Somatic-Mutation", } +RELEASE_STATUS_ENUM = { + "latest", + "previous", + "unharmonized", +} + class GenomicFileSchema(BaseSchema, IndexdFileSchema): class Meta(BaseSchema.Meta, IndexdFileSchema.Meta): @@ -178,6 +184,10 @@ class Meta(BaseSchema.Meta, IndexdFileSchema.Meta): GenomicFile, 'workflow_type', validate=enum_validation_generator(WORKFLOW_TYPE_ENUM) ) + release_status = field_for( + GenomicFile, 'release_status', + validate=enum_validation_generator(RELEASE_STATUS_ENUM) + ) _links = ma.Hyperlinks({ 'self': ma.URLFor(Meta.resource_url, kf_id=''), From 67b1985d4cd59e3a6db46e8c8ab07f5bba5caaa4 Mon Sep 17 00:00:00 2001 From: Natasha Singh Date: Thu, 11 Apr 2024 14:45:47 -0400 Subject: [PATCH 2/3] :white_check_mark: Test release status --- tests/data.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/data.json b/tests/data.json index d6203812..f892529c 100644 --- a/tests/data.json +++ b/tests/data.json @@ -114,7 +114,7 @@ "workflow_type": "Alignment", "workflow_tool": "tool", "workflow_version": "v1", - "release_status": "released", + "release_status": "latest", "data_category": "foo", "visible": true }, @@ -281,7 +281,8 @@ "controlled_access": true, "paired_end": 1, "data_type": "Expression", - "workflow_type": "Alignment" + "workflow_type": "Alignment", + "release_status": "latest" }, "invalid": [ { "paired_end": -1 }, @@ -289,7 +290,8 @@ { "controlled_access": "hello", "size": "hello" }, { "availability": "availble for download" }, { "data_type": "read" }, - { "workflow_type": "foo" } + { "workflow_type": "foo" }, + { "release_status": "foo" } ] }, "/biospecimen-genomic-files": { From 3d4d8c0314872ea63893b2fa0f427e4d451d8768 Mon Sep 17 00:00:00 2001 From: Natasha Singh Date: Thu, 11 Apr 2024 15:01:15 -0400 Subject: [PATCH 3/3] :recycle: Add more values to data_type enum --- dataservice/api/genomic_file/schemas.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/dataservice/api/genomic_file/schemas.py b/dataservice/api/genomic_file/schemas.py index 0da9a6ed..99cf052e 100644 --- a/dataservice/api/genomic_file/schemas.py +++ b/dataservice/api/genomic_file/schemas.py @@ -130,7 +130,24 @@ "Variant Calling Metrics", "Variant Summary", "WGS Metric", - "WXS Metric"} + "WXS Metric", + "Adapter Stats", + "Alignment Metrics", + "Alignment Stats", + "Artifact Metrics", + "Chimeric Aligned Reads", + "Cutadapter Metrics", + "GC Metrics", + "Gender Metrics", + "Gender QC Metrics", + "Genome Aligned Reads", + "Genome Aligned Reads Index", + "Het Call QC Metrics", + "Insert Size Metrics", + "QC Metrics", + "WGS Metrics", + "WXS Metrics", +} PAIRED_END_ENUM = {1, 2}