Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add exome flag to exome samples #3061

Merged
merged 26 commits into from
Apr 10, 2024
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor to function
  • Loading branch information
mathiasbio committed Mar 22, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 51771ad56d7698de2763e8007f11bbb0b1721266
19 changes: 13 additions & 6 deletions cg/meta/workflow/balsamic.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

import logging
from pathlib import Path
from typing import Optional
mathiasbio marked this conversation as resolved.
Show resolved Hide resolved

from housekeeper.store.models import File, Version
from pydantic.v1 import EmailStr, ValidationError
@@ -278,6 +279,13 @@ def get_verified_sex(sample_data: dict) -> Sex:
LOG.error(f"Unable to retrieve a valid sex from samples: {sample_data.keys()}")
raise BalsamicStartError

@staticmethod
def get_exome_argument_if_exome_sample(sample_data: dict) -> str:
"""Returns the exome argument if the application type in sample_data is wes."""
mathiasbio marked this conversation as resolved.
Show resolved Hide resolved
if sample_data["application_type"] == AnalysisType.WHOLE_EXOME_SEQUENCING:
return True


def get_verified_samples(self, case_id: str) -> dict[str, str]:
"""Return a verified tumor and normal sample dictionary."""
tumor_samples: list[Sample] = self.status_db.get_samples_by_type(
@@ -454,6 +462,8 @@ def get_verified_config_case_arguments(
)
verified_sex: Sex = sex or self.get_verified_sex(sample_data=sample_data)

verified_exome_argument: Optional[bool] = self.get_exome_argument_if_exome_sample(sample_data=sample_data)

config_case: dict[str, str] = {
"case_id": case_id,
"analysis_workflow": self.workflow,
@@ -463,14 +473,10 @@ def get_verified_config_case_arguments(
"pon_cnn": verified_pon,
"swegen_snv": self.get_swegen_verified_path(Variants.SNV),
"swegen_sv": self.get_swegen_verified_path(Variants.SV),
"exome": verified_exome_argument
}

(
config_case.update({"--exome": True})
if verified_panel_bed
and sample_data["application_type"] == AnalysisType.WHOLE_EXOME_SEQUENCING
else None
)


config_case.update(self.get_verified_samples(case_id=case_id))
config_case.update(self.get_parsed_observation_file_paths(observations))
@@ -578,6 +584,7 @@ def config_case(
"--case-id": arguments.get("case_id"),
"--clinical-snv-observations": arguments.get("clinical_snv"),
"--clinical-sv-observations": arguments.get("clinical_sv"),
"--exome": arguments.get("exome")
"--fastq-path": self.get_sample_fastq_destination_dir(
self.status_db.get_case_by_internal_id(case_id)
),