Skip to content

Commit

Permalink
Enable delivery of external samples (#2727)(patch)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
seallard authored Dec 6, 2023
1 parent 50df2da commit 188de17
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cg/meta/deliver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand All @@ -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:
Expand Down

0 comments on commit 188de17

Please sign in to comment.