Skip to content

Commit

Permalink
Fix RNA uploads/delivery message draft
Browse files Browse the repository at this point in the history
  • Loading branch information
islean committed Jan 23, 2025
1 parent dc8e5e3 commit 93feadb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions cg/meta/upload/scout/uploadscoutapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,17 +676,20 @@ def get_config_builder(self, analysis, hk_version) -> ScoutConfigBuilder:
return config_builders[analysis.workflow]

def create_rna_dna_collections(self, rna_case: Case) -> list[RNADNACollection]:
return [self.create_rna_dna_collection(link.sample) for link in rna_case.links]
return [
self.create_rna_dna_collection(rna_sample=link.sample, customer=rna_case.customer)
for link in rna_case.links
]

def create_rna_dna_collection(self, rna_sample: Sample) -> RNADNACollection:
def create_rna_dna_collection(self, rna_sample: Sample, customer: Customer) -> RNADNACollection:
"""Creates a collection containing the given RNA sample id, its related DNA sample name, and
a list of ids for the DNA cases connected to the DNA sample."""
if not rna_sample.subject_id:
raise CgDataError(
f"Failed to link RNA sample {rna_sample.internal_id} to DNA samples - subject_id field is empty."
)

collaborators: set[Customer] = rna_sample.customer.collaborators
collaborators: set[Customer] = customer.collaborators
subject_id_samples: list[Sample] = (
self.status_db.get_samples_by_customer_ids_and_subject_id_and_is_tumour(
customer_ids=[customer.id for customer in collaborators],
Expand Down
2 changes: 1 addition & 1 deletion cg/store/crud/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,7 @@ def get_uploaded_related_dna_cases(self, rna_case: Case) -> list[Case]:
related_dna_cases: list[Case] = []
for rna_sample in rna_case.samples:

collaborators: set[Customer] = rna_sample.customer.collaborators
collaborators: set[Customer] = rna_case.customer.collaborators

related_dna_samples_query: Query = self._get_related_samples_query(
sample=rna_sample,
Expand Down

0 comments on commit 93feadb

Please sign in to comment.