Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion cg/meta/workflow/nallo.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def __init__(
self.email: str = config.nallo.slurm.mail_user
self.compute_env_base: str = config.nallo.compute_env
self.revision: str = config.nallo.revision
self.nextflow_binary_path: str = config.nallo.binary_path

@property
def sample_sheet_headers(self) -> list[str]:
Expand Down
1 change: 0 additions & 1 deletion cg/meta/workflow/raredisease.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def __init__(
self.email: str = config.raredisease.slurm.mail_user
self.compute_env_base: str = config.raredisease.compute_env
self.revision: str = config.raredisease.revision
self.nextflow_binary_path: str = config.raredisease.binary_path

@property
def sample_sheet_headers(self) -> list[str]:
Expand Down
1 change: 0 additions & 1 deletion cg/meta/workflow/rnafusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def __init__(
self.email: str = config.rnafusion.slurm.mail_user
self.compute_env_base: str = config.rnafusion.compute_env
self.revision: str = config.rnafusion.revision
self.nextflow_binary_path: str = config.rnafusion.binary_path

@property
def sample_sheet_headers(self) -> list[str]:
Expand Down
1 change: 0 additions & 1 deletion cg/meta/workflow/taxprofiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def __init__(
self.tower_workflow: str = config.taxprofiler.tower_workflow
self.account: str = config.taxprofiler.slurm.account
self.email: str = config.taxprofiler.slurm.mail_user
self.nextflow_binary_path: str = config.taxprofiler.binary_path
self.compute_env_base: str = config.taxprofiler.compute_env

@property
Expand Down
1 change: 0 additions & 1 deletion cg/meta/workflow/tomte.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def __init__(
self.email: str = config.tomte.slurm.mail_user
self.compute_env_base: str = config.tomte.compute_env
self.revision: str = config.tomte.revision
self.nextflow_binary_path: str = config.tomte.binary_path

@property
def sample_sheet_headers(self) -> list[str]:
Expand Down
99 changes: 11 additions & 88 deletions cg/models/cg_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,102 +230,25 @@ class MipConfig(BaseModel):
script: str


class NalloConfig(CommonAppConfig):
binary_path: str | None = None
compute_env: str
conda_binary: str | None = None
conda_env: str
platform: str
params: str
config: str
resources: str
launch_directory: str
workflow_bin_path: str
pre_run_script: str = ""
profile: str
repository: str
revision: str
root: str
slurm: SlurmConfig
tower_workflow: str

class NextflowConfig(BaseModel):
"""Contains the Nextflow parameters (different from pipeline parameters!)
used for running Nextflow pipelines."""

class RarediseaseConfig(CommonAppConfig):
binary_path: str | None = None
compute_env: str
conda_binary: str | None = None
conda_binary: str
conda_env: str
platform: str
params: str
config: str
resources: str
launch_directory: str
workflow_bin_path: str
pre_run_script: str = ""
profile: str
repository: str
revision: str
root: str
slurm: SlurmConfig
tower_workflow: str


class TomteConfig(CommonAppConfig):
binary_path: str | None = None
compute_env: str
conda_binary: str | None = None
conda_env: str
platform: str
params: str
config: str
resources: str
workflow_bin_path: str
pre_run_script: str = ""
profile: str
repository: str
revision: str
root: str
slurm: SlurmConfig
tower_workflow: str


class RnafusionConfig(CommonAppConfig):
binary_path: str
compute_env: str
conda_binary: str | None = None
conda_env: str
platform: str
params: str
config: str
resources: str
launch_directory: str
pre_run_script: str = ""
pre_run_script: str
profile: str
repository: str
revision: str
root: str
slurm: SlurmConfig
tower_workflow: str
workflow_bin_path: str


class TaxprofilerConfig(CommonAppConfig):
binary_path: str
conda_binary: str | None = None
conda_env: str
compute_env: str
platform: str
params: str
config: str
resources: str
workflow_bin_path: str
pre_run_script: str = ""
profile: str
repository: str
revision: str
root: str
slurm: SlurmConfig
tower_workflow: str
workflow_bin_path: str


class MicrosaltConfig(BaseModel):
Expand Down Expand Up @@ -508,12 +431,12 @@ class CGConfig(BaseModel):
mip_rd_dna: MipConfig = Field(None, alias="mip-rd-dna")
mip_rd_rna: MipConfig | None = Field(None, alias="mip-rd-rna")
mutant: MutantConfig | None = None
nallo: NalloConfig | None = None
raredisease: RarediseaseConfig | None = None
rnafusion: RnafusionConfig | None = None
nallo: NextflowConfig | None = None
raredisease: NextflowConfig | None = None
rnafusion: NextflowConfig | None = None
statina: StatinaConfig | None = None
taxprofiler: TaxprofilerConfig | None = None
tomte: TomteConfig | None = None
taxprofiler: NextflowConfig | None = None
tomte: NextflowConfig | None = None

# These are meta APIs that gets instantiated in the code
meta_apis: dict = {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pathlib import Path

from cg.exc import AnalysisAlreadyCompletedError, MissingConfigFilesError
from cg.models.cg_config import CommonAppConfig
from cg.models.cg_config import NextflowConfig
from cg.services.analysis_starter.configurator.configurator import Configurator
from cg.services.analysis_starter.configurator.extensions.pipeline_extension import (
PipelineExtension,
Expand All @@ -25,7 +25,7 @@ def __init__(
self,
config_file_creator: NextflowConfigFileCreator,
params_file_creator: ParamsFileCreator,
pipeline_config: CommonAppConfig,
pipeline_config: NextflowConfig,
sample_sheet_creator: SampleSheetCreator,
store: Store,
pipeline_extension: PipelineExtension = PipelineExtension(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from cg.apps.scout.scoutapi import ScoutAPI
from cg.constants import Workflow
from cg.meta.workflow.fastq import BalsamicFastqHandler, MicrosaltFastqHandler, MipFastqHandler
from cg.models.cg_config import CGConfig, CommonAppConfig
from cg.models.cg_config import CGConfig, NextflowConfig
from cg.services.analysis_starter.configurator.configurator import Configurator
from cg.services.analysis_starter.configurator.extensions.nallo import NalloExtension
from cg.services.analysis_starter.configurator.extensions.pipeline_extension import (
Expand Down Expand Up @@ -75,7 +75,6 @@


class ConfiguratorFactory:

def __init__(self, cg_config: CGConfig):
self.cg_config = cg_config
self.housekeeper_api: HousekeeperAPI = cg_config.housekeeper_api
Expand Down Expand Up @@ -118,7 +117,7 @@ def _get_nextflow_configurator(self, workflow: Workflow) -> NextflowConfigurator
)

def _get_nextflow_config_file_creator(self, workflow: Workflow) -> NextflowConfigFileCreator:
pipeline_config: CommonAppConfig = self._get_pipeline_config(workflow)
pipeline_config: NextflowConfig = self._get_pipeline_config(workflow)
return NextflowConfigFileCreator(
account=pipeline_config.slurm.account,
platform=pipeline_config.platform,
Expand Down Expand Up @@ -147,7 +146,7 @@ def _get_params_file_creator(self, workflow: Workflow) -> ParamsFileCreator:
case _:
raise NotImplementedError(f"There is no params file creator for {workflow}")

def _get_pipeline_config(self, workflow: Workflow) -> CommonAppConfig:
def _get_pipeline_config(self, workflow: Workflow) -> NextflowConfig:
return getattr(self.cg_config, workflow)

def _get_sample_sheet_creator(self, workflow: Workflow) -> SampleSheetCreator:
Expand Down
55 changes: 23 additions & 32 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2148,118 +2148,109 @@ def context_config(
"root": str(mip_dir),
},
"nallo": {
"binary_path": nextflow_binary.as_posix(),
"compute_env": "nf_tower_compute_env",
"conda_binary": conda_binary.as_posix(),
"conda_env": "S_nallo",
"platform": str(nf_analysis_platform_config_path),
"params": str(nf_analysis_pipeline_params_path),
"config": str(nf_analysis_pipeline_config_path),
"resources": str(nf_analysis_pipeline_resource_optimisation_path),
"launch_directory": Path("path", "to", "launchdir").as_posix(),
"workflow_bin_path": Path("workflow", "path").as_posix(),
"params": str(nf_analysis_pipeline_params_path),
"platform": str(nf_analysis_platform_config_path),
"pre_run_script": "",
"profile": "myprofile",
"repository": "https://some_url",
"references": Path("path", "to", "references").as_posix(),
"resources": str(nf_analysis_pipeline_resource_optimisation_path),
"revision": "2.2.0",
"root": str(nallo_dir),
"slurm": {
"account": "development",
"mail_user": email_address,
},
"tower_workflow": "nallo",
"workflow_bin_path": Path("workflow", "path").as_posix(),
},
"raredisease": {
"binary_path": nextflow_binary.as_posix(),
"compute_env": "nf_tower_compute_env",
"conda_binary": conda_binary.as_posix(),
"conda_env": "S_raredisease",
"platform": str(nf_analysis_platform_config_path),
"params": str(nf_analysis_pipeline_params_path),
"config": str(nf_analysis_pipeline_config_path),
"resources": str(nf_analysis_pipeline_resource_optimisation_path),
"launch_directory": Path("path", "to", "launchdir").as_posix(),
"workflow_bin_path": Path("workflow", "path").as_posix(),
"params": str(nf_analysis_pipeline_params_path),
"platform": str(nf_analysis_platform_config_path),
"pre_run_script": "",
"profile": "myprofile",
"references": Path("path", "to", "references").as_posix(),
"repository": "https://some_url",
"resources": str(nf_analysis_pipeline_resource_optimisation_path),
"revision": "2.2.0",
"root": str(raredisease_dir),
"slurm": {
"account": "development",
"mail_user": email_address,
},
"tower_workflow": "raredisease",
"workflow_bin_path": Path("workflow", "path").as_posix(),
},
"tomte": {
"binary_path": nextflow_binary.as_posix(),
"compute_env": "nf_tower_compute_env",
"conda_binary": conda_binary.as_posix(),
"conda_env": "S_tomte",
"platform": str(nf_analysis_platform_config_path),
"params": str(nf_analysis_pipeline_params_path),
"config": str(nf_analysis_pipeline_config_path),
"resources": str(nf_analysis_pipeline_resource_optimisation_path),
"workflow_bin_path": Path("workflow", "path").as_posix(),
"params": str(nf_analysis_pipeline_params_path),
"platform": str(nf_analysis_platform_config_path),
"pre_run_script": "",
"profile": "myprofile",
"repository": "https://some_url",
"references": Path("path", "to", "references").as_posix(),
"repository": "https://some_url",
"resources": str(nf_analysis_pipeline_resource_optimisation_path),
"revision": "2.2.0",
"root": str(tomte_dir),
"slurm": {
"account": "development",
"mail_user": email_address,
},
"tower_workflow": "tomte",
"workflow_bin_path": Path("workflow", "path").as_posix(),
},
"rnafusion": {
"binary_path": nextflow_binary.as_posix(),
"compute_env": "nf_tower_compute_env",
"conda_binary": conda_binary.as_posix(),
"conda_env": "S_RNAFUSION",
"platform": str(nf_analysis_platform_config_path),
"params": str(nf_analysis_pipeline_params_path),
"config": str(nf_analysis_pipeline_config_path),
"resources": str(nf_analysis_pipeline_resource_optimisation_path),
"launch_directory": Path("path", "to", "launchdir").as_posix(),
"workflow_bin_path": Path("workflow", "path").as_posix(),
"params": str(nf_analysis_pipeline_params_path),
"platform": str(nf_analysis_platform_config_path),
"pre_run_script": "",
"profile": "myprofile",
"references": Path("path", "to", "references").as_posix(),
"repository": "https://some_url",
"resources": str(nf_analysis_pipeline_resource_optimisation_path),
"revision": "2.2.0",
"root": str(rnafusion_dir),
"slurm": {
"account": "development",
"mail_user": "test.rnafusion.email@scilifelab.se",
},
"tower_workflow": "rnafusion",
"workflow_bin_path": Path("workflow", "path").as_posix(),
},
"pigz": {"binary_path": "/bin/pigz"},
"pdc": {"binary_path": "/bin/dsmc"},
"taxprofiler": {
"binary_path": nextflow_binary.as_posix(),
"compute_env": "nf_tower_compute_env",
"root": str(taxprofiler_dir),
"conda_binary": conda_binary.as_posix(),
"conda_env": "S_taxprofiler",
"platform": str(nf_analysis_platform_config_path),
"params": str(nf_analysis_pipeline_params_path),
"config": str(nf_analysis_pipeline_config_path),
"resources": str(nf_analysis_pipeline_resource_optimisation_path),
"launch_directory": Path("path", "to", "launchdir").as_posix(),
"workflow_bin_path": Path("workflow", "path").as_posix(),
"params": str(nf_analysis_pipeline_params_path),
"platform": str(nf_analysis_platform_config_path),
"pre_run_script": "",
"profile": "myprofile",
"repository": "https://some_url",
"resources": str(nf_analysis_pipeline_resource_optimisation_path),
"revision": "2.2.0",
"root": str(taxprofiler_dir),
"slurm": {
"account": "development",
"mail_user": "taxprofiler.email@scilifelab.se",
},
"tower_workflow": "taxprofiler",
"workflow_bin_path": Path("workflow", "path").as_posix(),
},
"scout": {
"binary_path": "bin/scout",
Expand Down
Loading
Loading