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

refactor: Remove Balsamic container 👋 👋 #1220

Merged
merged 70 commits into from
Aug 10, 2023
Merged
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
9e5bff2
Remove unused imports analysis models
ivadym Jul 18, 2023
fc5f85e
Create Snakemake model
ivadym Jul 20, 2023
10e721c
Update init workflow
ivadym Jul 21, 2023
2134fa1
Remove empty new line
ivadym Jul 21, 2023
c2e7257
Snakemake model integrity tests
ivadym Jul 24, 2023
5b1eae3
Models methods pytests
ivadym Jul 25, 2023
55ba76b
Remove unused pytests
ivadym Jul 25, 2023
edf56c0
Add benchmark as a model option
ivadym Jul 25, 2023
de0fe16
Update run analysis
ivadym Jul 25, 2023
c34d40c
Update deliver.py
ivadym Jul 25, 2023
393df1c
Rename fixtures
ivadym Jul 25, 2023
08214d0
Merge branch 'develop' of github.com:Clinical-Genomics/BALSAMIC into …
ivadym Jul 25, 2023
161803f
Rename command method name
ivadym Jul 25, 2023
033248c
Add additional method for config files
ivadym Jul 25, 2023
a919bab
Split subprocess submission command
ivadym Jul 25, 2023
e104ab5
CHANGELOG
ivadym Jul 25, 2023
a56da8d
1211
ivadym Jul 25, 2023
b4933f3
Pytest mail user
ivadym Jul 26, 2023
91ac79b
Test pon cnn
ivadym Jul 26, 2023
fc39962
Undo PON
ivadym Jul 26, 2023
753341b
Push containers
ivadym Jul 26, 2023
06bab07
Undo push
ivadym Jul 26, 2023
45f04d1
Merge develop
ivadym Jul 28, 2023
88e832a
Update CHANGELOG.rst
ivadym Jul 28, 2023
d5f4804
Update CHANGELOG.rst
ivadym Jul 28, 2023
4115fda
Review: Typehint comments singularity_bind_path
ivadym Jul 28, 2023
160d0ca
Move cache utils to utils :p
ivadym Jul 28, 2023
15cd6ce
Review: move methods
ivadym Jul 28, 2023
4d0f0d5
Merge branch 'refactor-bind-path-singularity' of github.com:Clinical-…
ivadym Jul 28, 2023
51ed5ba
pon pon pon poooon
ivadym Jul 28, 2023
efbdbd5
Missing capture kit key
ivadym Jul 28, 2023
ec44f43
TEST 0: bind path
ivadym Jul 28, 2023
105fc76
TEST 0: completed
ivadym Jul 28, 2023
cbd3cc0
Remove extra space :p
ivadym Jul 28, 2023
788a39c
Merge branch 'develop' into refactor-bind-path-singularity
ivadym Aug 1, 2023
8ca2356
Update dependency versions
ivadym Aug 4, 2023
948c3b6
Update balsamic container
ivadym Aug 4, 2023
24530cc
Update docs
ivadym Aug 4, 2023
aeb15d5
CHANGELOG
ivadym Aug 4, 2023
5dbc49d
Update conda environment
ivadym Aug 4, 2023
88c71ce
Push containers :rocket
ivadym Aug 4, 2023
1d8bfea
Add command to snakemake
ivadym Aug 4, 2023
19e1eaa
uppercase
ivadym Aug 4, 2023
3686747
Update GitHub Actions & docs python version
ivadym Aug 4, 2023
01c5f59
Fixed version
ivadym Aug 4, 2023
9e325e6
Update pytests
ivadym Aug 4, 2023
4607748
Fix
ivadym Aug 7, 2023
a7dbda0
CHANGELOG
ivadym Aug 7, 2023
b50e182
Merge branch 'fix-rm-temp' of github.com:Clinical-Genomics/BALSAMIC i…
ivadym Aug 7, 2023
1eb45d3
Merge branch 'fix-rm-temp' into refactor-bind-path-singularity
ivadym Aug 7, 2023
e20645a
Merge branch 'refactor-bind-path-singularity' into fix-snakemake-rerun
ivadym Aug 7, 2023
33ca244
Merge branch 'fix-snakemake-rerun' into update-python
ivadym Aug 7, 2023
9b04af9
Review
ivadym Aug 7, 2023
9c13b9b
Merge branch 'fix-rm-temp' into refactor-bind-path-singularity
ivadym Aug 7, 2023
63cb8e1
Merge branch 'develop' into refactor-bind-path-singularity
ivadym Aug 7, 2023
598a66e
Merge branch 'refactor-bind-path-singularity' into fix-snakemake-rerun
ivadym Aug 7, 2023
48d6158
Merge develop
ivadym Aug 7, 2023
0697500
Merge branch 'fix-snakemake-rerun' into update-python
ivadym Aug 7, 2023
77e8fc8
Undo push to docker
ivadym Aug 7, 2023
51fa769
Merge branch 'develop' of github.com:Clinical-Genomics/BALSAMIC into …
ivadym Aug 7, 2023
77875b5
Remove Balsamic container
ivadym Aug 8, 2023
a1d9e24
Update conftest
ivadym Aug 8, 2023
4458276
CHANGELOG
ivadym Aug 8, 2023
7f4a00f
Kommatecken
ivadym Aug 8, 2023
9fadf04
Update .github/workflows/docker_build_push.yml
ivadym Aug 9, 2023
6f84080
Update .github/workflows/docker_build_push_release.yml
ivadym Aug 9, 2023
3399301
Review
ivadym Aug 9, 2023
fd98ed2
Review: update comment
ivadym Aug 9, 2023
859b7bd
Merge branch 'update-python' into remove-balsamic-container
ivadym Aug 9, 2023
d7dea91
Merge develop
ivadym Aug 10, 2023
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
Add additional method for config files
  • Loading branch information
ivadym committed Jul 25, 2023
commit 033248cc6392fc09bf4860b491a32784f25f6522
24 changes: 15 additions & 9 deletions BALSAMIC/models/snakemake.py
Original file line number Diff line number Diff line change
@@ -90,6 +90,19 @@ def get_mail_user_option(cls, mail_user: Optional[str]) -> str:
return f"--mail-user {mail_user}"
return ""

def get_config_files_option(self) -> str:
"""Return string representation of the config files."""
config_files_option: str = f"--configfiles {self.config_path.as_posix()}"
if self.cluster_config_path:
config_files_option += f" {self.cluster_config_path.as_posix()}"
return config_files_option

def get_config_options(self) -> str:
"""Return Snakemake config options to be submitted."""
return remove_unnecessary_spaces(
f"--config {self.disable_variant_caller} {self.get_dragen_flag()}"
)

def get_dragen_flag(self) -> str:
"""Return string representation of the dragen flag."""
if self.dragen:
@@ -155,25 +168,18 @@ def get_command(self) -> str:
f"snakemake --notemp -p "
f"--directory {self.working_dir.as_posix()} "
f"--snakefile {self.snakefile.as_posix()} "
f"--configfiles {self.config_path.as_posix()} "
f"{self.cluster_config_path.as_posix()} "
f"{self.get_config_files_option()} "
f"{self.get_singularity_bind_paths_option()} "
f"{self.get_quiet_flag()} "
f"{self.get_force_flag()} "
f"{self.get_run_analysis_flag()} "
f"{self.get_snakemake_cluster_options()} "
f"{self.get_report_path_option()} "
f"{self.get_snakemake_config_options()} "
f"{self.get_config_options()} "
f"{self.get_snakemake_options_command()}"
)
return remove_unnecessary_spaces(snakemake_command)

def get_snakemake_config_options(self) -> str:
"""Return Snakemake config options to be submitted."""
return remove_unnecessary_spaces(
f"--config {self.disable_variant_caller} {self.get_dragen_flag()}"
)

def get_snakemake_cluster_options(self) -> str:
"""Return Snakemake cluster options to be submitted."""
if self.run_mode == RunMode.CLUSTER:
51 changes: 34 additions & 17 deletions tests/models/test_snakemake_models.py
Original file line number Diff line number Diff line change
@@ -60,6 +60,35 @@ def test_snakemake_model_empty():
SnakemakeExecutable()


def test_get_config_files_option(
snakemake_executable: SnakemakeExecutable, reference_file: Path
):
"""Test formatting of the configuration files."""

# GIVEN a snakemake executable model with a mocked config file

# WHEN calling the method
config_files_option: str = snakemake_executable.get_config_files_option()

# THEN the expected format should be returned
assert (
config_files_option
== f"--configfiles {reference_file.as_posix()} {reference_file.as_posix()}"
)


def test_get_config_options(snakemake_executable: SnakemakeExecutable):
"""Test formatting of the snakemake config options."""

# GIVEN a snakemake executable model disabling some variant callers

# WHEN calling the method
snakemake_config_options: str = snakemake_executable.get_config_options()

# THEN the expected format should be returned
assert snakemake_config_options == "--config disable_variant_caller=tnscope,vardict"


def test_get_dragen_flag(snakemake_executable: SnakemakeExecutable):
"""Test formatting of the dragen flag."""

@@ -173,7 +202,7 @@ def test_get_singularity_bind_paths_option(
def test_get_slurm_profiler_option(snakemake_executable: SnakemakeExecutable):
"""Test formatting of the snakemake slurm profiler option."""

# GIVEN a snakemake_executable model
# GIVEN a snakemake executable model
snakemake_model: SnakemakeExecutable = copy.deepcopy(snakemake_executable)
snakemake_model.benchmark = True

@@ -187,7 +216,7 @@ def test_get_slurm_profiler_option(snakemake_executable: SnakemakeExecutable):
def test_get_snakemake_options_command(snakemake_executable: SnakemakeExecutable):
"""Test formatting of the snakemake options command."""

# GIVEN a snakemake_executable model with additional snakemake options command
# GIVEN a snakemake executable model with additional snakemake options command

# WHEN calling the method
snakemake_options_command: str = (
@@ -206,7 +235,7 @@ def test_get_snakemake_command(
):
"""Test retrieval of the snakemake command to be submitted to Slurm."""

# GIVEN a snakemake_executable model with working environment paths
# GIVEN a snakemake executable model with working environment paths

# WHEN calling the method
snakemake_command: str = snakemake_executable.get_command()
@@ -227,18 +256,6 @@ def test_get_snakemake_command(
)


def test_get_snakemake_config_options(snakemake_executable: SnakemakeExecutable):
"""Test formatting of the snakemake config options."""

# GIVEN a snakemake_executable model disabling some variant callers

# WHEN calling the method
snakemake_config_options: str = snakemake_executable.get_snakemake_config_options()

# THEN the expected format should be returned
assert snakemake_config_options == "--config disable_variant_caller=tnscope,vardict"


def test_get_snakemake_cluster_options(
snakemake_executable: SnakemakeExecutable,
case_id_tumor_only: str,
@@ -247,7 +264,7 @@ def test_get_snakemake_cluster_options(
):
"""Test formatting of the snakemake cluster options."""

# GIVEN a snakemake_executable model with working environment paths
# GIVEN a snakemake executable model with working environment paths

# WHEN calling the method
snakemake_cluster_options: str = (
@@ -272,7 +289,7 @@ def test_get_cluster_submit_command(
):
"""Test formatting of the cluster submit command."""

# GIVEN a snakemake_executable model with working environment paths
# GIVEN a snakemake executable model with working environment paths

# WHEN calling the method
snakemake_cluster_submit_command: str = (