From 188de1752d3ede4b8a76c5f0ea5d14cd6ebe5ba8 Mon Sep 17 00:00:00 2001 From: Sebastian Allard Date: Wed, 6 Dec 2023 10:43:37 +0100 Subject: [PATCH] Enable delivery of external samples (#2727)(patch) Externally sequenced samples do not have reads assigned to them in status db, which means the deliver command failed for them. This change enables delivering samples associated with an application that is marked as external are possible to deliver. --- cg/meta/deliver.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cg/meta/deliver.py b/cg/meta/deliver.py index a6bbadd40f..fc25057e7e 100644 --- a/cg/meta/deliver.py +++ b/cg/meta/deliver.py @@ -100,7 +100,7 @@ def deliver_files(self, case_obj: Case): link: CaseSample for link in links: - if link.sample.sequencing_qc or self.deliver_failed_samples: + if self.sample_is_deliverable(link): sample_id: str = link.sample.internal_id sample_name: str = link.sample.name LOG.debug(f"Fetch last version for sample bundle {sample_id}") @@ -123,6 +123,12 @@ def deliver_files(self, case_obj: Case): f"Sample {link.sample.internal_id} did not receive enough reads and will not be delivered" ) + def sample_is_deliverable(self, link: CaseSample) -> bool: + sample_is_external: bool = link.sample.application_version.application.is_external + deliver_failed_samples: bool = self.deliver_failed_samples + sample_passes_qc: bool = link.sample.sequencing_qc + return sample_passes_qc or deliver_failed_samples or sample_is_external + def deliver_case_files( self, case_id: str, case_name: str, version: Version, sample_ids: set[str] ) -> None: