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 parameters to the nextflow config #3853

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
17 changes: 5 additions & 12 deletions cg/meta/workflow/taxprofiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from cg.constants import Workflow
from cg.constants.constants import GenomeVersion
from cg.constants.nf_analysis import MULTIQC_NEXFLOW_CONFIG
from cg.constants.sequencing import SequencingPlatform
from cg.constants.symbols import EMPTY_STRING
from cg.meta.workflow.nf_analysis import NfAnalysisAPI
Expand All @@ -29,12 +28,14 @@ def __init__(
super().__init__(config=config, workflow=workflow)
self.root_dir: str = config.taxprofiler.root
self.workflow_bin_path: str = config.taxprofiler.workflow_bin_path
self.profile: str = config.taxprofiler.profile
self.conda_env: str = config.taxprofiler.conda_env
self.conda_binary: str = config.taxprofiler.conda_binary
self.profile: str = config.taxprofiler.profile
self.platform: str = config.taxprofiler.platform
self.params: str = config.taxprofiler.params
self.workflow_config_path: str = config.taxprofiler.config
self.resources: str = config.taxprofiler.resources
self.revision: str = config.taxprofiler.revision
self.hostremoval_reference: Path = Path(config.taxprofiler.hostremoval_reference)
self.databases: Path = Path(config.taxprofiler.databases)
self.tower_binary_path: str = config.tower_binary_path
self.tower_workflow: str = config.taxprofiler.tower_workflow
self.account: str = config.taxprofiler.slurm.account
Expand All @@ -52,10 +53,6 @@ def is_multiqc_pattern_search_exact(self) -> bool:
"""Only exact pattern search is allowed to collect metrics information from multiqc file."""
return True

def get_nextflow_config_content(self, case_id: str) -> str:
"""Return nextflow config content."""
return MULTIQC_NEXFLOW_CONFIG

@staticmethod
def get_bundle_filenames_path() -> Path:
"""Return Taxprofiler bundle filenames path."""
Expand All @@ -80,12 +77,8 @@ def get_sample_sheet_content_per_sample(self, case_sample: CaseSample) -> list[l
def get_built_workflow_parameters(self, case_id: str) -> TaxprofilerParameters:
"""Return Taxprofiler parameters."""
return TaxprofilerParameters(
cluster_options=f"--qos={self.get_slurm_qos_for_case(case_id=case_id)}",
input=self.get_sample_sheet_path(case_id=case_id),
outdir=self.get_case_path(case_id=case_id),
databases=self.databases,
hostremoval_reference=self.hostremoval_reference,
priority=self.account,
)

def get_multiqc_search_patterns(self, case_id: str) -> dict:
Expand Down
6 changes: 4 additions & 2 deletions cg/models/cg_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,10 @@ class TaxprofilerConfig(CommonAppConfig):
conda_binary: str | None = None
conda_env: str
compute_env: str
databases: str
hostremoval_reference: str
platform: str
params: str
config: str
resources: str
workflow_bin_path: str
profile: str
revision: str
Expand Down
24 changes: 1 addition & 23 deletions cg/models/taxprofiler/taxprofiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,7 @@ class TaxprofilerQCMetrics(BaseModel):


class TaxprofilerParameters(WorkflowParameters):
"""Model for Taxprofiler parameters."""

databases: Path
save_preprocessed_reads: bool = True
perform_shortread_qc: bool = True
perform_shortread_complexityfilter: bool = True
save_complexityfiltered_reads: bool = True
perform_shortread_hostremoval: bool = True
hostremoval_reference: Path
save_hostremoval_index: bool = True
save_hostremoval_mapped: bool = True
save_hostremoval_unmapped: bool = True
perform_runmerging: bool = True
run_kraken2: bool = True
kraken2_save_reads: bool = True
kraken2_save_readclassifications: bool = True
run_bracken: bool = True
run_centrifuge: bool = True
centrifuge_save_reads: bool = True
run_krona: bool = True
run_profile_standardisation: bool = True
clusterOptions: str = Field(alias="cluster_options")
priority: str
"""Taxprofiler parameters."""


class TaxprofilerSampleSheetEntry(NextflowSampleSheetEntry):
Expand Down
6 changes: 4 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2161,11 +2161,13 @@ def context_config(
"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(),
"databases": Path("path", "to", "databases").as_posix(),
"profile": "myprofile",
"hostremoval_reference": Path("path", "to", "hostremoval_reference").as_posix(),
"revision": "2.2.0",
"slurm": {
"account": "development",
Expand Down
Loading