|
3 | 3 | import logging
|
4 | 4 | from cg.constants import Workflow
|
5 | 5 | from cg.constants.subject import PlinkPhenotypeStatus, PlinkSex
|
6 |
| -from cg.constants.tb import AnalysisType |
7 | 6 | from cg.meta.workflow.nf_analysis import NfAnalysisAPI
|
8 | 7 | from cg.models.cg_config import CGConfig
|
9 | 8 | from cg.models.nallo.nallo import NalloSampleSheetHeaders, NalloSampleSheetEntry, NalloParameters
|
10 | 9 | from cg.store.models import CaseSample
|
| 10 | +from pathlib import Path |
11 | 11 |
|
12 | 12 | LOG = logging.getLogger(__name__)
|
13 | 13 |
|
@@ -47,17 +47,21 @@ def sample_sheet_headers(self) -> list[str]:
|
47 | 47 | def get_sample_sheet_content_per_sample(self, case_sample: CaseSample) -> list[list[str]]:
|
48 | 48 | """Collect and format information required to build a sample sheet for a single sample."""
|
49 | 49 | bam_unmapped_read_paths = self.get_unmapped_bam_read_paths(sample=case_sample.sample)
|
50 |
| - sample_sheet_entry = NalloSampleSheetEntry( |
51 |
| - project=case_sample.case.internal_id, |
52 |
| - sample=case_sample.sample.internal_id, |
53 |
| - bam_unmapped_read_paths=bam_unmapped_read_paths, |
54 |
| - family_id=case_sample.case.internal_id, |
55 |
| - paternal_id=case_sample.get_paternal_sample_id, |
56 |
| - maternal_id=case_sample.get_maternal_sample_id, |
57 |
| - sex=self.get_sex_code(case_sample.sample.sex), |
58 |
| - phenotype=self.get_phenotype_code(case_sample.status), |
59 |
| - ) |
60 |
| - return sample_sheet_entry.reformat_sample_content |
| 50 | + sample_sheet_entries = [] |
| 51 | + |
| 52 | + for bam_path in bam_unmapped_read_paths: |
| 53 | + sample_sheet_entry = NalloSampleSheetEntry( |
| 54 | + project=case_sample.case.internal_id, |
| 55 | + sample=case_sample.sample.internal_id, |
| 56 | + bam_unmapped_read_path=Path(bam_path), |
| 57 | + family_id=case_sample.case.internal_id, |
| 58 | + paternal_id=case_sample.get_paternal_sample_id or "0", |
| 59 | + maternal_id=case_sample.get_maternal_sample_id or "0", |
| 60 | + sex=self.get_sex_code(case_sample.sample.sex), |
| 61 | + phenotype=self.get_phenotype_code(case_sample.status), |
| 62 | + ) |
| 63 | + sample_sheet_entries.extend(sample_sheet_entry.reformat_sample_content) |
| 64 | + return sample_sheet_entries |
61 | 65 |
|
62 | 66 | @staticmethod
|
63 | 67 | def get_phenotype_code(phenotype: str) -> int:
|
|
0 commit comments