Skip to content

Commit

Permalink
Balsamic v16 release (#3408)
Browse files Browse the repository at this point in the history
### Added:
- #3388
- #3361

### Changed
- #3427
  • Loading branch information
ivadym authored Nov 19, 2024
1 parent 1921954 commit fc24fcd
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 37 deletions.
1 change: 1 addition & 0 deletions cg/constants/observations.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class MipDNAObservationsAnalysisTag(StrEnum):
class ObservationsFileWildcards(StrEnum):
"""File patterns regarding dump Loqusdb files."""

ARTEFACT_SNV: str = "artefact_somatic_snv"
CLINICAL_SNV: str = "clinical_snv"
CLINICAL_SV: str = "clinical_sv"
CANCER_GERMLINE_SNV: str = "cancer_germline_snv"
Expand Down
6 changes: 2 additions & 4 deletions cg/meta/upload/balsamic/balsamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ def upload(self, ctx: click.Context, case: Case, restart: bool) -> None:

self.upload_files_to_customer_inbox(case)

if GensAPI.is_suitable_for_upload(case):
ctx.invoke(upload_to_gens, case_id=case.internal_id)
else:
LOG.info(f"Balsamic case {case.internal_id} is not compatible for Gens upload")
# Upload CNV and BAF profile to GENS
ctx.invoke(upload_to_gens, case_id=case.internal_id)

# Scout specific upload
if DataDelivery.SCOUT in case.data_delivery:
Expand Down
36 changes: 21 additions & 15 deletions cg/meta/workflow/balsamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@


class BalsamicAnalysisAPI(AnalysisAPI):
"""Handles communication between BALSAMIC processes
and the rest of CG infrastructure"""
"""Handles communication between BALSAMIC processes and the rest of CG infrastructure."""

__BALSAMIC_APPLICATIONS = {"wgs", "wes", "tgs"}
__BALSAMIC_BED_APPLICATIONS = {"wes", "tgs"}
Expand All @@ -49,21 +48,23 @@ def __init__(
):
super().__init__(workflow=workflow, config=config)
self.account: str = config.balsamic.slurm.account
self.binary_path: str = config.balsamic.binary_path
self.balsamic_cache: str = config.balsamic.balsamic_cache
self.conda_binary: str = config.balsamic.conda_binary
self.conda_env: str = config.balsamic.conda_env
self.bed_path: str = config.balsamic.bed_path
self.binary_path: str = config.balsamic.binary_path
self.cadd_path: str = config.balsamic.cadd_path
self.conda_binary: str = config.balsamic.conda_binary
self.conda_env: str = config.balsamic.conda_env
self.email: EmailStr = config.balsamic.slurm.mail_user
self.genome_interval_path: str = config.balsamic.genome_interval_path
self.gnomad_af5_path: str = config.balsamic.gnomad_af5_path
self.gens_coverage_female_path: str = config.balsamic.gens_coverage_female_path
self.gens_coverage_male_path: str = config.balsamic.gens_coverage_male_path
self.email: EmailStr = config.balsamic.slurm.mail_user
self.gnomad_af5_path: str = config.balsamic.gnomad_af5_path
self.loqusdb_path: str = config.balsamic.loqusdb_path
self.pon_path: str = config.balsamic.pon_path
self.qos: SlurmQos = config.balsamic.slurm.qos
self.root_dir: str = config.balsamic.root
self.sentieon_licence_path: str = config.balsamic.sentieon_licence_path
self.sentieon_licence_server: str = config.sentieon_licence_server
self.swegen_path: str = config.balsamic.swegen_path

@property
Expand Down Expand Up @@ -398,8 +399,12 @@ def get_parsed_observation_file_paths(self, observations: list[str]) -> dict:

return verified_observations

def get_verified_gens_file_paths(self, sex: Sex) -> dict[str, str] | None:
def get_verified_gens_file_paths(self, sex: Sex, panel_bed: str) -> dict[str, str]:
"""Return a list of file path arguments for Gens."""
if panel_bed:
return {
"gnomad_min_af5": self.gnomad_af5_path,
}
return {
"genome_interval": self.genome_interval_path,
"gnomad_min_af5": self.gnomad_af5_path,
Expand Down Expand Up @@ -459,11 +464,10 @@ def get_verified_config_case_arguments(

config_case.update(self.get_verified_samples(case_id=case_id))
config_case.update(self.get_parsed_observation_file_paths(observations))
(
config_case.update(self.get_verified_gens_file_paths(sex=verified_sex))
if not verified_panel_bed and genome_version == GenomeVersion.HG19
else None
)
if genome_version == GenomeVersion.HG19:
config_case.update(
self.get_verified_gens_file_paths(sex=verified_sex, panel_bed=verified_panel_bed)
)

return config_case

Expand Down Expand Up @@ -547,6 +551,7 @@ def config_case(
"--balsamic-cache": self.balsamic_cache,
"--cache-version": cache_version,
"--cadd-annotations": self.cadd_path,
"--artefact-snv-observations": arguments.get("artefact_somatic_snv"),
"--cancer-germline-snv-observations": arguments.get("cancer_germline_snv"),
"--cancer-germline-sv-observations": arguments.get("cancer_germline_sv"),
"--cancer-somatic-snv-observations": arguments.get("cancer_somatic_snv"),
Expand All @@ -564,12 +569,13 @@ def config_case(
"--gnomad-min-af5": arguments.get("gnomad_min_af5"),
"--normal-sample-name": arguments.get("normal_sample_name"),
"--panel-bed": arguments.get("panel_bed"),
"--exome": arguments.get("exome"),
"--pon-cnn": arguments.get("pon_cnn"),
"--exome": arguments.get("exome"),
"--sentieon-install-dir": self.sentieon_licence_path,
"--sentieon-license": self.sentieon_licence_server,
"--swegen-snv": arguments.get("swegen_snv"),
"--swegen-sv": arguments.get("swegen_sv"),
"--tumor-sample-name": arguments.get("tumor_sample_name"),
"--umi-trim-length": arguments.get("umi_trim_length"),
},
exclude_true=True,
)
Expand Down
14 changes: 2 additions & 12 deletions cg/models/balsamic/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,22 +102,12 @@ class BalsamicConfigQC(BaseModel):
"""Config QC attributes.
Attributes:
picard_rmdup: if the duplicates has been removed or not
adapter: adapter sequence that has been trimmed
quality_trim: whether quality trimming has been performed in the workflow
adapter_trim: whether adapter trimming has been performed in the workflow
umi_trim: whether UMI trimming has been performed in the workflow
min_seq_length: minimum sequence length cutoff for reads
umi_trim_length: UMI trimming length
"""

picard_rmdup: bool
adapter: str | None = None
quality_trim: bool
adapter_trim: bool
umi_trim: bool
min_seq_length: str | None = None
umi_trim_length: str | None = None
adapter: str | None
min_seq_length: str | None


class BalsamicVarCaller(BaseModel):
Expand Down
7 changes: 1 addition & 6 deletions tests/fixtures/apps/balsamic/tga_case/config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"QC": {
"picard_rmdup": false,
"adapter": "AATGATACGGCGACCACCGAGATCTACACTCTTTCCCTACACGACGCTCTTCCGATCT",
"quality_trim": true,
"adapter_trim": true,
"umi_trim": true,
"min_seq_length": "25",
"umi_trim_length": "5"
"min_seq_length": "25"
},
"vcf": {
"manta": {
Expand Down

0 comments on commit fc24fcd

Please sign in to comment.