From 0380034d2e95cde5f9d5b0b4b115135705c3f9bd Mon Sep 17 00:00:00 2001 From: peterpru Date: Wed, 12 Feb 2025 11:28:17 +0100 Subject: [PATCH 01/13] initial commit --- cg/constants/scout.py | 2 ++ cg/meta/delivery_report/raredisease.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cg/constants/scout.py b/cg/constants/scout.py index 812abe5524..f6d484da23 100644 --- a/cg/constants/scout.py +++ b/cg/constants/scout.py @@ -39,6 +39,8 @@ class ScoutUploadKey(StrEnum): SV_VCF = auto() VCF_STR = auto() VCF_FUSION = auto() + VCF_SNV = auto() + VCF_SV = auto() RAREDISEASE_CASE_TAGS = dict( diff --git a/cg/meta/delivery_report/raredisease.py b/cg/meta/delivery_report/raredisease.py index 6de6650bcf..98c6aed894 100644 --- a/cg/meta/delivery_report/raredisease.py +++ b/cg/meta/delivery_report/raredisease.py @@ -65,10 +65,10 @@ def get_scout_variants_files(self, case_id: str) -> ScoutVariantsFiles: """Return Raredisease files that will be uploaded to Scout.""" return ScoutVariantsFiles( snv_vcf=self.get_scout_uploaded_file_from_hk( - case_id=case_id, scout_key=ScoutUploadKey.SNV_VCF + case_id=case_id, scout_key=ScoutUploadKey.VCF_SNV ), sv_vcf=self.get_scout_uploaded_file_from_hk( - case_id=case_id, scout_key=ScoutUploadKey.SV_VCF + case_id=case_id, scout_key=ScoutUploadKey.VCF_SV ), vcf_str=self.get_scout_uploaded_file_from_hk( case_id=case_id, scout_key=ScoutUploadKey.VCF_STR From 827b083e2a24fc6ae8333f24fff89c0b7dc8136a Mon Sep 17 00:00:00 2001 From: peterpru Date: Thu, 13 Feb 2025 12:29:57 +0100 Subject: [PATCH 02/13] get lastest file path --- cg/meta/delivery_report/raredisease.py | 29 +++++++++++++++----------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/cg/meta/delivery_report/raredisease.py b/cg/meta/delivery_report/raredisease.py index 98c6aed894..fb612166ce 100644 --- a/cg/meta/delivery_report/raredisease.py +++ b/cg/meta/delivery_report/raredisease.py @@ -1,5 +1,10 @@ """Raredisease Delivery Report API.""" +from pathlib import Path + +from housekeeper.store.models import File + +from cg.apps.housekeeper.hk import HousekeeperAPI from cg.clients.chanjo2.models import CoverageMetrics from cg.constants.report import ( REQUIRED_APPLICATION_FIELDS, @@ -64,18 +69,18 @@ def is_report_accredited( def get_scout_variants_files(self, case_id: str) -> ScoutVariantsFiles: """Return Raredisease files that will be uploaded to Scout.""" return ScoutVariantsFiles( - snv_vcf=self.get_scout_uploaded_file_from_hk( - case_id=case_id, scout_key=ScoutUploadKey.VCF_SNV - ), - sv_vcf=self.get_scout_uploaded_file_from_hk( - case_id=case_id, scout_key=ScoutUploadKey.VCF_SV - ), - vcf_str=self.get_scout_uploaded_file_from_hk( - case_id=case_id, scout_key=ScoutUploadKey.VCF_STR - ), - smn_tsv=self.get_scout_uploaded_file_from_hk( - case_id=case_id, scout_key=ScoutUploadKey.SMN_TSV - ), + snv_vcf=HousekeeperAPI.get_latest_file( + bundle=case_id, tags=ScoutUploadKey.VCF_SNV + ).full_path, + sv_vcf=HousekeeperAPI.get_latest_file( + bundle=case_id, tags=ScoutUploadKey.VCF_SV + ).full_path, + vcf_str=HousekeeperAPI.get_latest_file( + bundle=case_id, tags=ScoutUploadKey.VCF_STR + ).full_path, + smn_tsv=HousekeeperAPI.get_latest_file( + bundle=case_id, tags=ScoutUploadKey.SMN_TSV + ).full_path, ) @staticmethod From e87c9a4857bfc18c75e46f25ac4dce0c2546399c Mon Sep 17 00:00:00 2001 From: peterpru Date: Thu, 13 Feb 2025 13:05:08 +0100 Subject: [PATCH 03/13] tags as set --- cg/meta/delivery_report/raredisease.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cg/meta/delivery_report/raredisease.py b/cg/meta/delivery_report/raredisease.py index fb612166ce..eb4367f788 100644 --- a/cg/meta/delivery_report/raredisease.py +++ b/cg/meta/delivery_report/raredisease.py @@ -70,16 +70,16 @@ def get_scout_variants_files(self, case_id: str) -> ScoutVariantsFiles: """Return Raredisease files that will be uploaded to Scout.""" return ScoutVariantsFiles( snv_vcf=HousekeeperAPI.get_latest_file( - bundle=case_id, tags=ScoutUploadKey.VCF_SNV + self=HousekeeperAPI, bundle=case_id, tags=set[ScoutUploadKey.VCF_SNV] ).full_path, sv_vcf=HousekeeperAPI.get_latest_file( - bundle=case_id, tags=ScoutUploadKey.VCF_SV + self=HousekeeperAPI, bundle=case_id, tags=set[ScoutUploadKey.VCF_SV] ).full_path, vcf_str=HousekeeperAPI.get_latest_file( - bundle=case_id, tags=ScoutUploadKey.VCF_STR + self=HousekeeperAPI, bundle=case_id, tags=set[ScoutUploadKey.VCF_STR] ).full_path, smn_tsv=HousekeeperAPI.get_latest_file( - bundle=case_id, tags=ScoutUploadKey.SMN_TSV + self=HousekeeperAPI, bundle=case_id, tags=set[ScoutUploadKey.SMN_TSV] ).full_path, ) From ff9540c37dabc17ad76fda925ad46fbbd728cab4 Mon Sep 17 00:00:00 2001 From: peterpru Date: Mon, 17 Feb 2025 10:09:20 +0100 Subject: [PATCH 04/13] filter on exact set --- cg/apps/housekeeper/hk.py | 13 +++++++++++++ cg/meta/delivery_report/raredisease.py | 16 ++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/cg/apps/housekeeper/hk.py b/cg/apps/housekeeper/hk.py index 9de21d1963..fa0442c392 100644 --- a/cg/apps/housekeeper/hk.py +++ b/cg/apps/housekeeper/hk.py @@ -185,6 +185,19 @@ def get_latest_file( files: Query = self._store.get_files(bundle_name=bundle, tag_names=tags, version_id=version) return files.order_by(File.id.desc()).first() + def get_file_by_exact_tags( + self, bundle: str, tags: set[str], version: int | None = None + ) -> File | None: + """Return a file that matches exact tags and optionally filtered by bundle and version.""" + if not tags: + LOG.debug("No tags provided, skipping") + return None + files: Query = self._store.get_files( + bundle_name=bundle, version_id=version, tag_names=list(tags) + ) + files = files.filter(File.tags == tags) + return files.order_by(File.id.desc()).first() + def check_bundle_files( self, bundle_name: str, diff --git a/cg/meta/delivery_report/raredisease.py b/cg/meta/delivery_report/raredisease.py index eb4367f788..51fa5eb8f3 100644 --- a/cg/meta/delivery_report/raredisease.py +++ b/cg/meta/delivery_report/raredisease.py @@ -69,17 +69,17 @@ def is_report_accredited( def get_scout_variants_files(self, case_id: str) -> ScoutVariantsFiles: """Return Raredisease files that will be uploaded to Scout.""" return ScoutVariantsFiles( - snv_vcf=HousekeeperAPI.get_latest_file( - self=HousekeeperAPI, bundle=case_id, tags=set[ScoutUploadKey.VCF_SNV] + snv_vcf=self.housekeeper_api.get_file_by_exact_tags( + bundle=case_id, tags=set(ScoutUploadKey.VCF_SNV) ).full_path, - sv_vcf=HousekeeperAPI.get_latest_file( - self=HousekeeperAPI, bundle=case_id, tags=set[ScoutUploadKey.VCF_SV] + sv_vcf=self.housekeeper_api.get_file_by_exact_tags( + bundle=case_id, tags=set(ScoutUploadKey.VCF_SV) ).full_path, - vcf_str=HousekeeperAPI.get_latest_file( - self=HousekeeperAPI, bundle=case_id, tags=set[ScoutUploadKey.VCF_STR] + vcf_str=self.housekeeper_api.get_file_by_exact_tags( + bundle=case_id, tags=set(ScoutUploadKey.VCF_STR) ).full_path, - smn_tsv=HousekeeperAPI.get_latest_file( - self=HousekeeperAPI, bundle=case_id, tags=set[ScoutUploadKey.SMN_TSV] + smn_tsv=self.housekeeper_api.get_file_by_exact_tags( + bundle=case_id, tags=set(ScoutUploadKey.SMN_TSV) ).full_path, ) From 0a984f313c67e5c48249e624e47c524e55d6bd7f Mon Sep 17 00:00:00 2001 From: peterpru Date: Mon, 17 Feb 2025 10:23:57 +0100 Subject: [PATCH 05/13] return first file --- cg/apps/housekeeper/hk.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cg/apps/housekeeper/hk.py b/cg/apps/housekeeper/hk.py index fa0442c392..de72e12b0a 100644 --- a/cg/apps/housekeeper/hk.py +++ b/cg/apps/housekeeper/hk.py @@ -195,8 +195,11 @@ def get_file_by_exact_tags( files: Query = self._store.get_files( bundle_name=bundle, version_id=version, tag_names=list(tags) ) - files = files.filter(File.tags == tags) - return files.order_by(File.id.desc()).first() + exact_match_files = [ + file for file in files + if set(tag.name for tag in file.tags) == tags + ] + return exact_match_files[0] def check_bundle_files( self, From a3e5243aafddbb0280863d0add5b03efe1c53a9e Mon Sep 17 00:00:00 2001 From: peterpru Date: Mon, 17 Feb 2025 10:28:08 +0100 Subject: [PATCH 06/13] black --- cg/apps/housekeeper/hk.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cg/apps/housekeeper/hk.py b/cg/apps/housekeeper/hk.py index de72e12b0a..bd8c03d04d 100644 --- a/cg/apps/housekeeper/hk.py +++ b/cg/apps/housekeeper/hk.py @@ -195,10 +195,7 @@ def get_file_by_exact_tags( files: Query = self._store.get_files( bundle_name=bundle, version_id=version, tag_names=list(tags) ) - exact_match_files = [ - file for file in files - if set(tag.name for tag in file.tags) == tags - ] + exact_match_files = [file for file in files if set(tag.name for tag in file.tags) == tags] return exact_match_files[0] def check_bundle_files( From 25591df709e03b5da09334c4ea06b7894c836565 Mon Sep 17 00:00:00 2001 From: peterpru Date: Mon, 17 Feb 2025 11:17:37 +0100 Subject: [PATCH 07/13] filter set --- cg/apps/housekeeper/hk.py | 12 ++++++------ cg/meta/delivery_report/raredisease.py | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cg/apps/housekeeper/hk.py b/cg/apps/housekeeper/hk.py index bd8c03d04d..bbbc6af0e2 100644 --- a/cg/apps/housekeeper/hk.py +++ b/cg/apps/housekeeper/hk.py @@ -186,17 +186,17 @@ def get_latest_file( return files.order_by(File.id.desc()).first() def get_file_by_exact_tags( - self, bundle: str, tags: set[str], version: int | None = None + self, bundle: str, tags: list, version: int | None = None ) -> File | None: """Return a file that matches exact tags and optionally filtered by bundle and version.""" if not tags: LOG.debug("No tags provided, skipping") return None - files: Query = self._store.get_files( - bundle_name=bundle, version_id=version, tag_names=list(tags) - ) - exact_match_files = [file for file in files if set(tag.name for tag in file.tags) == tags] - return exact_match_files[0] + files: Query = self._store.get_files(bundle_name=bundle, version_id=version, tag_names=tags) + for file in files: + file_tags = {tag.name for tag in file.tags} + if file_tags == set(tags): + return file def check_bundle_files( self, diff --git a/cg/meta/delivery_report/raredisease.py b/cg/meta/delivery_report/raredisease.py index 51fa5eb8f3..a98a8b2679 100644 --- a/cg/meta/delivery_report/raredisease.py +++ b/cg/meta/delivery_report/raredisease.py @@ -70,16 +70,16 @@ def get_scout_variants_files(self, case_id: str) -> ScoutVariantsFiles: """Return Raredisease files that will be uploaded to Scout.""" return ScoutVariantsFiles( snv_vcf=self.housekeeper_api.get_file_by_exact_tags( - bundle=case_id, tags=set(ScoutUploadKey.VCF_SNV) + bundle=case_id, tags=[ScoutUploadKey.VCF_SNV] ).full_path, sv_vcf=self.housekeeper_api.get_file_by_exact_tags( - bundle=case_id, tags=set(ScoutUploadKey.VCF_SV) + bundle=case_id, tags=[ScoutUploadKey.VCF_SV] ).full_path, vcf_str=self.housekeeper_api.get_file_by_exact_tags( - bundle=case_id, tags=set(ScoutUploadKey.VCF_STR) + bundle=case_id, tags=[ScoutUploadKey.VCF_STR] ).full_path, smn_tsv=self.housekeeper_api.get_file_by_exact_tags( - bundle=case_id, tags=set(ScoutUploadKey.SMN_TSV) + bundle=case_id, tags=[ScoutUploadKey.SMN_TSV] ).full_path, ) From 31a309ee6583a57751bce0f17292bfb1987c0a20 Mon Sep 17 00:00:00 2001 From: peterpru Date: Tue, 18 Feb 2025 12:34:38 +0100 Subject: [PATCH 08/13] add all tags for the files --- cg/constants/housekeeper_tags.py | 1 + cg/meta/delivery_report/raredisease.py | 37 +++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/cg/constants/housekeeper_tags.py b/cg/constants/housekeeper_tags.py index 1aaef4fd2e..151cd93b8d 100644 --- a/cg/constants/housekeeper_tags.py +++ b/cg/constants/housekeeper_tags.py @@ -57,6 +57,7 @@ class HermesFileTag(StrEnum): CLINICAL_DELIVERY: str = "clinical-delivery" LONG_TERM_STORAGE: str = "long-term-storage" + SCOUT: str = "scout" class AnalysisTag(StrEnum): diff --git a/cg/meta/delivery_report/raredisease.py b/cg/meta/delivery_report/raredisease.py index a98a8b2679..89cd83a3e7 100644 --- a/cg/meta/delivery_report/raredisease.py +++ b/cg/meta/delivery_report/raredisease.py @@ -6,6 +6,7 @@ from cg.apps.housekeeper.hk import HousekeeperAPI from cg.clients.chanjo2.models import CoverageMetrics +from cg.constants.housekeeper_tags import HermesFileTag from cg.constants.report import ( REQUIRED_APPLICATION_FIELDS, REQUIRED_CASE_FIELDS, @@ -70,16 +71,44 @@ def get_scout_variants_files(self, case_id: str) -> ScoutVariantsFiles: """Return Raredisease files that will be uploaded to Scout.""" return ScoutVariantsFiles( snv_vcf=self.housekeeper_api.get_file_by_exact_tags( - bundle=case_id, tags=[ScoutUploadKey.VCF_SNV] + bundle=case_id, + tags=[ + ScoutUploadKey.VCF_SNV, + case_id, + HermesFileTag.CLINICAL_DELIVERY, + HermesFileTag.LONG_TERM_STORAGE, + HermesFileTag.SCOUT, + ], ).full_path, sv_vcf=self.housekeeper_api.get_file_by_exact_tags( - bundle=case_id, tags=[ScoutUploadKey.VCF_SV] + bundle=case_id, + tags=[ + ScoutUploadKey.VCF_SV, + case_id, + HermesFileTag.CLINICAL_DELIVERY, + HermesFileTag.LONG_TERM_STORAGE, + HermesFileTag.SCOUT, + ], ).full_path, vcf_str=self.housekeeper_api.get_file_by_exact_tags( - bundle=case_id, tags=[ScoutUploadKey.VCF_STR] + bundle=case_id, + tags=[ + ScoutUploadKey.VCF_STR, + case_id, + HermesFileTag.CLINICAL_DELIVERY, + HermesFileTag.LONG_TERM_STORAGE, + HermesFileTag.SCOUT, + ], ).full_path, smn_tsv=self.housekeeper_api.get_file_by_exact_tags( - bundle=case_id, tags=[ScoutUploadKey.SMN_TSV] + bundle=case_id, + tags=[ + ScoutUploadKey.SMN_TSV, + case_id, + HermesFileTag.CLINICAL_DELIVERY, + HermesFileTag.LONG_TERM_STORAGE, + HermesFileTag.SCOUT, + ], ).full_path, ) From fd8843c552baaf7b034a02db60adebfefc9a42aa Mon Sep 17 00:00:00 2001 From: Peter Pruisscher <57712924+peterpru@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:35:34 +0100 Subject: [PATCH 09/13] Update cg/apps/housekeeper/hk.py Co-authored-by: Sebastian Diaz --- cg/apps/housekeeper/hk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cg/apps/housekeeper/hk.py b/cg/apps/housekeeper/hk.py index bbbc6af0e2..fe97c7f117 100644 --- a/cg/apps/housekeeper/hk.py +++ b/cg/apps/housekeeper/hk.py @@ -192,7 +192,7 @@ def get_file_by_exact_tags( if not tags: LOG.debug("No tags provided, skipping") return None - files: Query = self._store.get_files(bundle_name=bundle, version_id=version, tag_names=tags) + files: Query = self.files(bundle_name=bundle, version_id=version, tags=tags) for file in files: file_tags = {tag.name for tag in file.tags} if file_tags == set(tags): From a67a559ca5c1a6578075755ec0c5e26c03125706 Mon Sep 17 00:00:00 2001 From: peterpru Date: Tue, 18 Feb 2025 12:37:31 +0100 Subject: [PATCH 10/13] make function same as the related functions --- cg/apps/housekeeper/hk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cg/apps/housekeeper/hk.py b/cg/apps/housekeeper/hk.py index fe97c7f117..bbbc6af0e2 100644 --- a/cg/apps/housekeeper/hk.py +++ b/cg/apps/housekeeper/hk.py @@ -192,7 +192,7 @@ def get_file_by_exact_tags( if not tags: LOG.debug("No tags provided, skipping") return None - files: Query = self.files(bundle_name=bundle, version_id=version, tags=tags) + files: Query = self._store.get_files(bundle_name=bundle, version_id=version, tag_names=tags) for file in files: file_tags = {tag.name for tag in file.tags} if file_tags == set(tags): From 7240a63f42e10bb42fe7ffbc954bef9c809c82a6 Mon Sep 17 00:00:00 2001 From: peterpru Date: Tue, 18 Feb 2025 13:37:30 +0100 Subject: [PATCH 11/13] add logs --- cg/apps/housekeeper/hk.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cg/apps/housekeeper/hk.py b/cg/apps/housekeeper/hk.py index bbbc6af0e2..df0ba5d5ec 100644 --- a/cg/apps/housekeeper/hk.py +++ b/cg/apps/housekeeper/hk.py @@ -195,7 +195,9 @@ def get_file_by_exact_tags( files: Query = self._store.get_files(bundle_name=bundle, version_id=version, tag_names=tags) for file in files: file_tags = {tag.name for tag in file.tags} + LOG.debug(f"Using tags {file_tags}") if file_tags == set(tags): + LOG.debug(f"Found file {file}") return file def check_bundle_files( From 789ff345dae6ef4b6e23a8b25f03b08c15fda2b0 Mon Sep 17 00:00:00 2001 From: Sebastian Diaz Date: Wed, 19 Feb 2025 13:23:54 +0100 Subject: [PATCH 12/13] dev - make tag function work (#4225) * test fix * made the tags literals to test --- cg/apps/housekeeper/hk.py | 2 +- cg/meta/delivery_report/raredisease.py | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/cg/apps/housekeeper/hk.py b/cg/apps/housekeeper/hk.py index df0ba5d5ec..6cdfa24c46 100644 --- a/cg/apps/housekeeper/hk.py +++ b/cg/apps/housekeeper/hk.py @@ -192,7 +192,7 @@ def get_file_by_exact_tags( if not tags: LOG.debug("No tags provided, skipping") return None - files: Query = self._store.get_files(bundle_name=bundle, version_id=version, tag_names=tags) + files: list[File] = self.files(bundle=bundle, version=version, tags=tags).all() for file in files: file_tags = {tag.name for tag in file.tags} LOG.debug(f"Using tags {file_tags}") diff --git a/cg/meta/delivery_report/raredisease.py b/cg/meta/delivery_report/raredisease.py index 89cd83a3e7..1cb9687638 100644 --- a/cg/meta/delivery_report/raredisease.py +++ b/cg/meta/delivery_report/raredisease.py @@ -1,10 +1,5 @@ """Raredisease Delivery Report API.""" -from pathlib import Path - -from housekeeper.store.models import File - -from cg.apps.housekeeper.hk import HousekeeperAPI from cg.clients.chanjo2.models import CoverageMetrics from cg.constants.housekeeper_tags import HermesFileTag from cg.constants.report import ( @@ -73,7 +68,7 @@ def get_scout_variants_files(self, case_id: str) -> ScoutVariantsFiles: snv_vcf=self.housekeeper_api.get_file_by_exact_tags( bundle=case_id, tags=[ - ScoutUploadKey.VCF_SNV, + "vcf-snv-clinical", case_id, HermesFileTag.CLINICAL_DELIVERY, HermesFileTag.LONG_TERM_STORAGE, @@ -83,7 +78,7 @@ def get_scout_variants_files(self, case_id: str) -> ScoutVariantsFiles: sv_vcf=self.housekeeper_api.get_file_by_exact_tags( bundle=case_id, tags=[ - ScoutUploadKey.VCF_SV, + "vcf-sv-clinical", case_id, HermesFileTag.CLINICAL_DELIVERY, HermesFileTag.LONG_TERM_STORAGE, @@ -93,7 +88,7 @@ def get_scout_variants_files(self, case_id: str) -> ScoutVariantsFiles: vcf_str=self.housekeeper_api.get_file_by_exact_tags( bundle=case_id, tags=[ - ScoutUploadKey.VCF_STR, + "vcf-str", case_id, HermesFileTag.CLINICAL_DELIVERY, HermesFileTag.LONG_TERM_STORAGE, @@ -103,7 +98,7 @@ def get_scout_variants_files(self, case_id: str) -> ScoutVariantsFiles: smn_tsv=self.housekeeper_api.get_file_by_exact_tags( bundle=case_id, tags=[ - ScoutUploadKey.SMN_TSV, + "smn-calling", case_id, HermesFileTag.CLINICAL_DELIVERY, HermesFileTag.LONG_TERM_STORAGE, From ce9af330da67ec75082584bc803d8e4ff7fe19fa Mon Sep 17 00:00:00 2001 From: peterpru Date: Thu, 20 Feb 2025 07:57:39 +0100 Subject: [PATCH 13/13] analysistags as constants --- cg/constants/housekeeper_tags.py | 4 ++++ cg/meta/delivery_report/raredisease.py | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cg/constants/housekeeper_tags.py b/cg/constants/housekeeper_tags.py index 151cd93b8d..97d2682d73 100644 --- a/cg/constants/housekeeper_tags.py +++ b/cg/constants/housekeeper_tags.py @@ -82,8 +82,12 @@ class AnalysisTag(StrEnum): OUTRIDER: str = "outrider" RESEARCH: str = "research" RNA: str = "rna" + SMN_CALLING: str = "smn-calling" STARFUSION: str = "star-fusion" VCF_FUSION: str = "vcf-fusion" + VCF_SNV_CLINICAL: str = "vcf-snv-clinical" + VCF_STR: str = "vcf-str" + VCF_SV_CLINICAL: str = "vcf-sv-clinical" class HkMipAnalysisTag: diff --git a/cg/meta/delivery_report/raredisease.py b/cg/meta/delivery_report/raredisease.py index 1cb9687638..dcb80660ac 100644 --- a/cg/meta/delivery_report/raredisease.py +++ b/cg/meta/delivery_report/raredisease.py @@ -1,7 +1,7 @@ """Raredisease Delivery Report API.""" from cg.clients.chanjo2.models import CoverageMetrics -from cg.constants.housekeeper_tags import HermesFileTag +from cg.constants.housekeeper_tags import HermesFileTag, AnalysisTag from cg.constants.report import ( REQUIRED_APPLICATION_FIELDS, REQUIRED_CASE_FIELDS, @@ -68,7 +68,7 @@ def get_scout_variants_files(self, case_id: str) -> ScoutVariantsFiles: snv_vcf=self.housekeeper_api.get_file_by_exact_tags( bundle=case_id, tags=[ - "vcf-snv-clinical", + AnalysisTag.VCF_SNV_CLINICAL, case_id, HermesFileTag.CLINICAL_DELIVERY, HermesFileTag.LONG_TERM_STORAGE, @@ -78,7 +78,7 @@ def get_scout_variants_files(self, case_id: str) -> ScoutVariantsFiles: sv_vcf=self.housekeeper_api.get_file_by_exact_tags( bundle=case_id, tags=[ - "vcf-sv-clinical", + AnalysisTag.VCF_SV_CLINICAL, case_id, HermesFileTag.CLINICAL_DELIVERY, HermesFileTag.LONG_TERM_STORAGE, @@ -88,7 +88,7 @@ def get_scout_variants_files(self, case_id: str) -> ScoutVariantsFiles: vcf_str=self.housekeeper_api.get_file_by_exact_tags( bundle=case_id, tags=[ - "vcf-str", + AnalysisTag.VCF_STR, case_id, HermesFileTag.CLINICAL_DELIVERY, HermesFileTag.LONG_TERM_STORAGE, @@ -98,7 +98,7 @@ def get_scout_variants_files(self, case_id: str) -> ScoutVariantsFiles: smn_tsv=self.housekeeper_api.get_file_by_exact_tags( bundle=case_id, tags=[ - "smn-calling", + AnalysisTag.SMN_CALLING, case_id, HermesFileTag.CLINICAL_DELIVERY, HermesFileTag.LONG_TERM_STORAGE,