From f96e35f8a7d917e262840e1d5910cd14734f7096 Mon Sep 17 00:00:00 2001 From: Michele Berselli Date: Fri, 6 Dec 2024 13:47:28 -0500 Subject: [PATCH] added title and version to reference file objs --- pipeline_utils/lib/yaml_parser.py | 6 ++++++ tests/repo_correct/portal_objects/file_reference.yaml | 1 + tests/test_yaml_file_reference.py | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pipeline_utils/lib/yaml_parser.py b/pipeline_utils/lib/yaml_parser.py index ab0952b..60e5f5c 100644 --- a/pipeline_utils/lib/yaml_parser.py +++ b/pipeline_utils/lib/yaml_parser.py @@ -645,6 +645,12 @@ def to_json( if getattr(self, self.CODE_SCHEMA, None): ref_json[self.CODE_SCHEMA] = self.code + # title + ref_json[self.TITLE_SCHEMA] = self._link_title(self.name) + + # version + ref_json[self.VERSION_SCHEMA] = self.version + return ref_json diff --git a/tests/repo_correct/portal_objects/file_reference.yaml b/tests/repo_correct/portal_objects/file_reference.yaml index 73c1442..0c2e439 100644 --- a/tests/repo_correct/portal_objects/file_reference.yaml +++ b/tests/repo_correct/portal_objects/file_reference.yaml @@ -30,3 +30,4 @@ type: description: hg38 full reference genome plus decoy for CGAP, fasta format format: fa version: hg38 +title: "GENOME" diff --git a/tests/test_yaml_file_reference.py b/tests/test_yaml_file_reference.py index 829181d..ad4e79b 100644 --- a/tests/test_yaml_file_reference.py +++ b/tests/test_yaml_file_reference.py @@ -24,7 +24,9 @@ def test_file_reference(): "uuid": "1936f246-22e1-45dc-bb5c-9cfd55537fe7", "data_category": ["Sequencing Reads"], "data_type": ["Unaligned Reads"], - "variant_type": ["SNV"] + "variant_type": ["SNV"], + "version": "hg38", + "title": "reference genome" }, { "aliases": ["cgap-core:ReferenceFile-reference_genome_hg38"], @@ -34,7 +36,9 @@ def test_file_reference(): "consortia": ["cgap-core"], "status": None, "data_category": ["Sequencing Reads"], - "data_type": ["Aligned Reads"] + "data_type": ["Aligned Reads"], + "version": "hg38", + "title": "GENOME" } ]