Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
320 commits
Select commit Hold shift + click to select a range
d49293b
Revert "change to equal"
mathiasbio Mar 27, 2025
c421297
remove attempt
mathiasbio Mar 27, 2025
7a1d198
remove threads
mathiasbio Mar 27, 2025
5e26b08
test
mathiasbio Mar 27, 2025
49f89d5
change yaml format
mathiasbio Mar 27, 2025
98358b4
Merge branch 'change_submit_method' of github.com:Clinical-Genomics/B…
mathiasbio Mar 27, 2025
6054eca
clean up
mathiasbio Mar 27, 2025
5fe92e3
Merge branch 'change_submit_method' of github.com:Clinical-Genomics/B…
mathiasbio Mar 27, 2025
03e2286
reformat
mathiasbio Mar 27, 2025
4058fc7
reformat
mathiasbio Mar 27, 2025
4b664b3
revert to yaml structure
mathiasbio Mar 27, 2025
463751b
test
mathiasbio Mar 27, 2025
308b8cd
add slurm options
mathiasbio Mar 27, 2025
962e974
tsst
mathiasbio Mar 27, 2025
e92d689
testing
mathiasbio Mar 27, 2025
b5105ca
account
mathiasbio Mar 27, 2025
5083bf1
test
mathiasbio Mar 27, 2025
84f739c
test write new config yaml
mathiasbio Mar 27, 2025
14e8e88
fix
mathiasbio Mar 27, 2025
cbb8573
fix
mathiasbio Mar 27, 2025
3eb2813
fix quotes
mathiasbio Mar 27, 2025
8114baf
fix
mathiasbio Mar 28, 2025
2fe65d3
revert
mathiasbio Mar 28, 2025
024042f
Revert "Merge branch 'change_submit_method' of github.com:Clinical-Ge…
mathiasbio Mar 28, 2025
08146b7
Merge branch 'change_submit_method' of github.com:Clinical-Genomics/B…
mathiasbio Mar 28, 2025
4d1ac80
revert snakemake
mathiasbio Mar 28, 2025
90e7890
REVERT DAG
mathiasbio Mar 28, 2025
4ee48fd
fix
mathiasbio Mar 28, 2025
6e94598
restore config
mathiasbio Mar 28, 2025
234cc80
add slurm yaml
mathiasbio Mar 28, 2025
975ff62
worth a try
mathiasbio Mar 28, 2025
198dbb0
move mem to dynamic resource
mathiasbio Mar 28, 2025
05c48ef
fix
mathiasbio Mar 28, 2025
e17a41f
increase mem
mathiasbio Mar 28, 2025
19f9b1b
refactor
mathiasbio Mar 28, 2025
a66485b
mem
mathiasbio Mar 28, 2025
2f87f71
increase mem
mathiasbio Mar 28, 2025
d3782b0
mem wgs align
mathiasbio Mar 28, 2025
d9a2d68
add init
mathiasbio Apr 8, 2025
8196874
clean up
mathiasbio Apr 8, 2025
8f6ad56
remove cluster env
mathiasbio Apr 9, 2025
153b688
refactor code
mathiasbio Apr 9, 2025
8fd0823
Merge branch 'develop' of github.com:Clinical-Genomics/BALSAMIC into …
mathiasbio Apr 14, 2025
74a75e4
Merge branch 'develop' into change_submit_method
mathiasbio Apr 14, 2025
a756d2f
mem fix
mathiasbio Apr 14, 2025
799d057
change mem according to benchmark files
mathiasbio Apr 14, 2025
dbd6e37
add r
mathiasbio Apr 15, 2025
53bafbd
update threads
mathiasbio Apr 16, 2025
42b7d74
test adding mail func
mathiasbio Apr 17, 2025
baaa087
test
mathiasbio Apr 17, 2025
7807e94
remove email functionality
mathiasbio Apr 17, 2025
4dc3a66
clean up
mathiasbio Apr 17, 2025
81fca1b
clean
mathiasbio Apr 17, 2025
8a33122
fix
mathiasbio Apr 17, 2025
4fb4795
clean up
mathiasbio Apr 22, 2025
17c75a1
fix pytests
mathiasbio Apr 24, 2025
82c3e26
fix pytests
mathiasbio Apr 24, 2025
e9a42ac
black
mathiasbio Apr 24, 2025
0a12ec2
Merge branch 'develop' of github.com:Clinical-Genomics/BALSAMIC into …
mathiasbio Apr 24, 2025
8931641
Merge branch 'develop' into change_submit_method
mathiasbio Apr 24, 2025
89bd073
Merge develop and changelog
mathiasbio Apr 24, 2025
16f63ae
add logger test
mathiasbio Apr 25, 2025
9bf65e0
add sbatch pytest
mathiasbio Apr 25, 2025
ea0bf39
test
mathiasbio Apr 30, 2025
b3812b9
cap mem
mathiasbio May 5, 2025
a2529bf
fix
mathiasbio May 5, 2025
e9626a1
restore resources
mathiasbio May 6, 2025
978599d
adjust mem and time
mathiasbio May 7, 2025
108add1
add partition core
mathiasbio May 8, 2025
ec8ae7f
remove test
mathiasbio May 12, 2025
2c6d18c
black
mathiasbio May 12, 2025
ed36c56
test
mathiasbio May 12, 2025
a8fb39f
test
mathiasbio May 12, 2025
d882d02
nothing
mathiasbio May 12, 2025
1615e9f
black
mathiasbio May 12, 2025
7dc87e1
fix
mathiasbio May 12, 2025
0738dd7
add logs
mathiasbio May 12, 2025
c1b76c0
black
mathiasbio May 12, 2025
846cf7d
remove test
mathiasbio May 12, 2025
0eef24d
black
mathiasbio May 12, 2025
c003549
add analysis status check to snakemake master job
mathiasbio May 15, 2025
b0199d5
fix variable
mathiasbio May 15, 2025
cea15bc
add success status check
mathiasbio May 23, 2025
80be77b
add resources
mathiasbio May 23, 2025
37267d3
change resources
mathiasbio May 26, 2025
0c9aeea
fix
mathiasbio May 26, 2025
aa722c0
add job status check
mathiasbio May 27, 2025
cf4bd51
black
mathiasbio May 27, 2025
1097cba
add to init
mathiasbio May 27, 2025
7dbb730
add cancel check state
mathiasbio May 28, 2025
997ad63
fix test
mathiasbio May 28, 2025
6b5b9ea
refactor code
mathiasbio May 28, 2025
aa63863
black
mathiasbio May 28, 2025
2d3e34b
remove retries
mathiasbio May 28, 2025
011a6a0
remove shell true
mathiasbio May 28, 2025
c03d9a7
black
mathiasbio May 28, 2025
ad6aa04
add description
mathiasbio May 28, 2025
8b64154
fix pytest
mathiasbio Jun 2, 2025
2b0a65d
fix pytests
mathiasbio Jun 2, 2025
4a77c5b
add qc error to status
mathiasbio Jun 2, 2025
edb3a83
fix
mathiasbio Jun 2, 2025
3ffca6d
append write statusfile
mathiasbio Jun 2, 2025
19f84d6
restore
mathiasbio Jun 2, 2025
ec403e8
test new options
mathiasbio Jun 2, 2025
0e4e6bd
mem
mathiasbio Jun 2, 2025
ba66a56
testing logs
mathiasbio Jun 2, 2025
bd0ed50
fix
mathiasbio Jun 2, 2025
16b4378
add cluster status script
mathiasbio Jun 3, 2025
b9ec70c
remove
mathiasbio Jun 3, 2025
9f77377
fix
mathiasbio Jun 3, 2025
947ffbd
fix
mathiasbio Jun 3, 2025
a8d1b59
fix
mathiasbio Jun 3, 2025
8fc8743
update state check
mathiasbio Jun 3, 2025
91ddb69
mem
mathiasbio Jun 3, 2025
d15050c
fix permission after install
mathiasbio Jun 3, 2025
658335a
fix
mathiasbio Jun 3, 2025
95df709
fix bug
mathiasbio Jun 4, 2025
00fb129
fix pytest
mathiasbio Jun 4, 2025
94f8a86
increase mem
mathiasbio Jun 4, 2025
b897400
increase mem
mathiasbio Jun 4, 2025
70ec4ab
fix codefactor issues
mathiasbio Jun 4, 2025
63e0ff4
increase mem
mathiasbio Jun 11, 2025
b51a6b8
increase mem
mathiasbio Jun 11, 2025
36c6969
add 1 retry
mathiasbio Jun 12, 2025
6403b4d
fix delly
mathiasbio Jun 16, 2025
2dc57b2
clean up
mathiasbio Jul 9, 2025
bff6a7f
Merge branch 'develop' of github.com:Clinical-Genomics/BALSAMIC into …
mathiasbio Jul 9, 2025
f7b4ec2
clean up merge conflict and add to changelog
mathiasbio Jul 9, 2025
9620b21
add logging pytest
mathiasbio Jul 9, 2025
ac63e42
increase mem
mathiasbio Jul 14, 2025
a912b96
increase mem
mathiasbio Jul 23, 2025
e2f3c23
increase time and mem
mathiasbio Aug 5, 2025
0e00b77
add dynamic mem to dedup
mathiasbio Aug 8, 2025
215c821
increase mem
mathiasbio Aug 8, 2025
8a28ca8
Merge branch 'develop' of github.com:Clinical-Genomics/BALSAMIC into …
mathiasbio Aug 8, 2025
4a9fd1c
fix merge conflict
mathiasbio Aug 8, 2025
a8abdee
update script
mathiasbio Aug 11, 2025
be5d3ab
increase mem
mathiasbio Aug 11, 2025
f91e1ab
increase mem
mathiasbio Aug 11, 2025
b951a37
increase mem
mathiasbio Aug 12, 2025
f55e7a0
mem
mathiasbio Aug 13, 2025
e4f1244
increase mem
mathiasbio Aug 13, 2025
4027da2
increase mem
mathiasbio Aug 13, 2025
4f24c56
decrease mem
mathiasbio Aug 13, 2025
b241795
mem
mathiasbio Aug 15, 2025
51427d5
lower slurm stress
mathiasbio Aug 18, 2025
4ee9975
upgrade to latest snakemake
mathiasbio Aug 19, 2025
4e5b870
bump packaging
mathiasbio Aug 19, 2025
eb2956a
bump yte
mathiasbio Aug 19, 2025
7e9e7cd
decrease snakemake v
mathiasbio Aug 19, 2025
4f67ed6
test executor
mathiasbio Aug 19, 2025
cc8c206
increase snakemake v to 9
mathiasbio Aug 19, 2025
68ef42d
increase numpy
mathiasbio Aug 19, 2025
5ac1f24
bump pandas
mathiasbio Aug 19, 2025
6b751bd
move out threads from config
mathiasbio Aug 19, 2025
827424c
use only cluster profile
mathiasbio Aug 19, 2025
6f8ed14
refactor threads
mathiasbio Aug 19, 2025
c2688f5
Merge branch 'submit_method_upgrade_snakemake' of github.com:Clinical…
mathiasbio Aug 19, 2025
abc357e
move args
mathiasbio Aug 19, 2025
0cd8e86
test
mathiasbio Aug 19, 2025
5f8373b
test fix
mathiasbio Aug 19, 2025
1ee7f72
update dag function
mathiasbio Aug 19, 2025
8598c8c
fix
mathiasbio Aug 19, 2025
9c2ebdd
keep logs
mathiasbio Aug 20, 2025
a9abaa7
refactor mem
mathiasbio Aug 20, 2025
2d71fdd
refactor mem
mathiasbio Aug 20, 2025
8b6ad13
Merge branch 'submit_method_upgrade_snakemake' of github.com:Clinical…
mathiasbio Aug 20, 2025
17bfb83
rulename
mathiasbio Aug 20, 2025
4826ee8
fix
mathiasbio Aug 20, 2025
98f60f3
try fix
mathiasbio Aug 20, 2025
20dd678
revert mem
mathiasbio Aug 20, 2025
10da0ef
attempt fix
mathiasbio Aug 20, 2025
7fe208d
Merge branch 'submit_method_upgrade_snakemake' of github.com:Clinical…
mathiasbio Aug 20, 2025
5566a07
log testing
mathiasbio Aug 20, 2025
53e9abb
fix
mathiasbio Aug 20, 2025
ecc4564
add partition argument
mathiasbio Aug 20, 2025
1abd86c
fix
mathiasbio Aug 20, 2025
60d9ad2
fix
mathiasbio Aug 20, 2025
894bf95
fix write script
mathiasbio Aug 20, 2025
cd5037f
fix
mathiasbio Aug 20, 2025
5257b46
fix
mathiasbio Aug 20, 2025
64971c0
update jobstatus csript
mathiasbio Aug 20, 2025
0e63c13
append
mathiasbio Aug 20, 2025
644fe4d
update status check
mathiasbio Aug 20, 2025
ba60ef8
remove restart times
mathiasbio Aug 20, 2025
c063eb1
fix
mathiasbio Aug 20, 2025
a64ca11
refactor
mathiasbio Aug 22, 2025
2e9fc89
black
mathiasbio Aug 22, 2025
d901872
remove backup
mathiasbio Aug 22, 2025
c7e0a97
black
mathiasbio Aug 22, 2025
1040d7d
cleaning up
mathiasbio Aug 22, 2025
e394801
fix pytests
mathiasbio Aug 22, 2025
40135f4
fix pytests
mathiasbio Aug 22, 2025
6744fcc
fix pytests
mathiasbio Aug 22, 2025
d3124b5
git add executor installation
mathiasbio Aug 22, 2025
583b77b
add analysis status content to stderr
mathiasbio Aug 22, 2025
92d6fe9
clean up profile
mathiasbio Aug 22, 2025
48fec3d
fix pytest
mathiasbio Aug 22, 2025
60ab56b
add restart times
mathiasbio Aug 22, 2025
4d5a3ec
refactor
mathiasbio Aug 22, 2025
04f772b
merge conflict
mathiasbio Aug 22, 2025
a094ff3
fix
mathiasbio Aug 25, 2025
68064b2
fix
mathiasbio Aug 25, 2025
1d4bed3
refactor
mathiasbio Aug 25, 2025
fe04e2b
add docstring
mathiasbio Aug 25, 2025
5d14c27
fix init
mathiasbio Aug 25, 2025
db6510e
update env and pytest
mathiasbio Aug 25, 2025
840739a
test
mathiasbio Aug 25, 2025
d66b724
revert
mathiasbio Aug 25, 2025
b570b40
test
mathiasbio Aug 25, 2025
18e9cf2
test
mathiasbio Aug 25, 2025
31f5d52
add pydantic
mathiasbio Aug 25, 2025
f6ea34f
test
mathiasbio Aug 25, 2025
b8f4664
test
mathiasbio Aug 25, 2025
39321bf
fix pytests
mathiasbio Aug 25, 2025
802f766
fixing code after snakemake update
mathiasbio Aug 25, 2025
caa6315
black
mathiasbio Aug 25, 2025
6a6aaaf
Not working
mathiasbio Aug 26, 2025
54aa720
update
mathiasbio Aug 26, 2025
14e6a6f
test
mathiasbio Aug 26, 2025
790cd4d
fix
mathiasbio Aug 26, 2025
88ba7d4
black
mathiasbio Aug 26, 2025
561413b
fix
mathiasbio Aug 26, 2025
c751a3e
refactor
mathiasbio Aug 26, 2025
00e5d65
change
mathiasbio Aug 26, 2025
8126c61
test
mathiasbio Aug 26, 2025
9162584
refactor
mathiasbio Aug 26, 2025
2bca239
fix
mathiasbio Aug 26, 2025
a7b2bfd
fix
mathiasbio Aug 27, 2025
2abf7e3
remove raw
mathiasbio Aug 27, 2025
13c632b
fix typehints
mathiasbio Aug 27, 2025
ee9c855
fix
mathiasbio Aug 27, 2025
aaaa98e
test
mathiasbio Aug 27, 2025
db322b6
fix
mathiasbio Aug 27, 2025
cda98f5
fix pytest
mathiasbio Aug 27, 2025
6ed7aa5
remove unused function
mathiasbio Aug 28, 2025
19b99b5
return shell true
mathiasbio Aug 28, 2025
3104561
black
mathiasbio Aug 28, 2025
c0e8be7
changelog
mathiasbio Aug 28, 2025
4aebdce
remove import
mathiasbio Aug 28, 2025
520cbab
update install inst
mathiasbio Aug 28, 2025
4b0d3fe
add pytests
mathiasbio Aug 29, 2025
4b91b19
clean up
mathiasbio Aug 29, 2025
5f3e094
test report
mathiasbio Sep 1, 2025
ff44bfb
add unknown status
mathiasbio Sep 1, 2025
51c33cf
refactor
mathiasbio Sep 1, 2025
6f934b0
fix
mathiasbio Sep 1, 2025
2636666
add max mem
mathiasbio Sep 1, 2025
7650575
250gb max
mathiasbio Sep 1, 2025
fb55922
fix
mathiasbio Sep 1, 2025
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
78 changes: 0 additions & 78 deletions BALSAMIC/assets/scripts/immediate_submit.py

This file was deleted.

171 changes: 171 additions & 0 deletions BALSAMIC/assets/scripts/scan_finished_jobid_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
#!/usr/bin/env python3
from __future__ import annotations

import logging
import re
import subprocess
from pathlib import Path
from typing import Dict, List, Tuple, Optional
from datetime import datetime
import click


LOG = logging.getLogger(__name__)


def find_job_logs(log_root: Path) -> Dict[str, Path]:
"""
Recursively find *.log files whose basename is a numeric jobid.
Returns {jobid -> log_path}.
"""
job_logs: Dict[str, Path] = {}
for p in log_root.rglob("*.log"):
if p.stem.isdigit(): # e.g. "9727982.log" -> "9727982"
job_logs[p.stem] = p
else:
LOG.debug(f"Skipping non-job log file: {p}")
LOG.info(f"Discovered {len(job_logs)} job logs under {log_root}")
return job_logs


def get_job_state(jobid: str) -> Optional[str]:
"""
Return raw output of `scontrol show job JOBID`, or None if the query fails.
"""
try:
LOG.debug(f"Running show job scontrol {jobid}")
result = subprocess.run(
["scontrol", "show", "job", jobid],
capture_output=True,
text=True,
check=True,
)

Check notice on line 42 in BALSAMIC/assets/scripts/scan_finished_jobid_status.py

View check run for this annotation

codefactor.io / CodeFactor

BALSAMIC/assets/scripts/scan_finished_jobid_status.py#L37-L42

Starting a process with a partial executable path (B607)
return result.stdout
except FileNotFoundError:
LOG.error("scontrol executable not found: scontrol")
return None
except subprocess.CalledProcessError as e:
LOG.warning(f"Could not check job {jobid} (may not exist). rc={e.returncode}")
LOG.debug(f"scontrol stderr for {jobid} {e.stderr}")
return None


def parse_state(scontrol_output: str) -> Optional[str]:
"""
Extract JobState from scontrol text, e.g. 'JobState=FAILED'.
Returns the state string (e.g. 'FAILED') or None if not found.
"""
m = re.search(r"JobState=(\S+)", scontrol_output)
state = m.group(1) if m else None
if state is None:
LOG.debug("JobState not found in scontrol output")
return state


def write_results(
output_file: Path,
failed: List[Tuple[str, Path]],
cancelled: List[Tuple[str, Path]],
unknown: List[str],
) -> None:
"""
Append job results to output_file.
Each run is prefixed with a timestamp header.
"""
output_file.parent.mkdir(parents=True, exist_ok=True)

timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")

with output_file.open("a") as out_f:
out_f.write(f"=== Job status check at {timestamp} ===\n")

if failed:
out_f.write("Failed jobs:\n")
for jobid, log_path in failed:
out_f.write(f"{jobid}\t{log_path}\n")
out_f.write("\n")

if cancelled:
out_f.write("Cancelled jobs:\n")
for jobid, log_path in cancelled:
out_f.write(f"{jobid}\t{log_path}\n")
out_f.write("\n")

if unknown:
out_f.write("Unknown status jobs:\n")
for jobid in unknown:
out_f.write(f"{jobid}\tNA\n")
out_f.write("\n")

if not failed and not cancelled:
out_f.write("SUCCESSFUL\n\n")

LOG.info(
f"Appended results to {output_file} (failed={len(failed)}, cancelled={len(cancelled)} unknown={len(unknown)})"
)


@click.command()
@click.argument(
"log_dir", type=click.Path(exists=True, file_okay=False, path_type=Path)
)
@click.option(
"--output",
"-o",
required=True,
type=click.Path(writable=True, path_type=Path),
help="Path to output file for results (FAILED/CANCELLED or SUCCESS).",
)
@click.option(
"--log-level",
default="INFO",
show_default=True,
type=click.Choice(
["CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG"], case_sensitive=False
),
help="Logging verbosity.",
)
def check_failed_jobs(log_dir: Path, output: Path, log_level: str) -> None:
"""
Recursively scan LOG_DIR for SLURM *.log files (stdout+stderr combined),
extract job IDs from filenames, and check their states via `scontrol show job JOBID`.
"""
logging.basicConfig(
level=getattr(logging, log_level.upper(), logging.INFO),
format="%(asctime)s %(levelname)s %(name)s: %(message)s",
)

LOG.info("Scanning logs under: %s", log_dir)
job_logs = find_job_logs(log_dir)

failed: List[Tuple[str, Path]] = []
cancelled: List[Tuple[str, Path]] = []
unknown: List[str] = []

if not job_logs:
LOG.warning("No job logs found (no files matching '*.log')")
return

for jobid in sorted(job_logs.keys(), key=int):
out_text = get_job_state(jobid)
if not out_text:
# Can't classify without job info; skip but note it.
LOG.warning(
f"Missing scontrol output for job {jobid} -- setting status UNKNOWN"
)
unknown.append(jobid)
continue

state = parse_state(out_text)
if state == "FAILED":
failed.append((jobid, job_logs[jobid]))
elif state == "CANCELLED":
cancelled.append((jobid, job_logs[jobid]))
else:
LOG.debug(f"Job {jobid} state is {state}")

write_results(output, failed, cancelled, unknown)


if __name__ == "__main__":
check_failed_jobs()
34 changes: 31 additions & 3 deletions BALSAMIC/commands/config/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@
OPTION_TUMOR_SAMPLE_NAME,
OPTION_UMI_MIN_READS,
)
from BALSAMIC.constants.analysis import BIOINFO_TOOL_ENV, AnalysisWorkflow, Gender
from BALSAMIC.constants.analysis import (
BIOINFO_TOOL_ENV,
AnalysisWorkflow,
Gender,
LogFile,
)
from BALSAMIC.constants.cache import GenomeVersion
from BALSAMIC.constants.constants import FileType
from BALSAMIC.constants.paths import (
Expand All @@ -57,9 +62,11 @@
get_panel_chrom,
get_sample_list,
get_gens_references,
get_snakefile,
)
from BALSAMIC.utils.io import read_json, write_json
from BALSAMIC.utils.utils import get_absolute_paths_dict
from BALSAMIC.utils.logging import add_file_logging

LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -129,6 +136,19 @@ def case_config(
tumor_sample_name: str,
umi_min_reads: str | None,
):
"""Configure BALSAMIC workflow based on input arguments."""

LOG.info(f"Starting configuring analysis case: {case_id}.")

LOG.info(f"Creating case analysis directory: {analysis_dir}/{case_id}.")
Path(analysis_dir, case_id).mkdir(exist_ok=True)

log_file = Path(analysis_dir, case_id, LogFile.LOGNAME).as_posix()
LOG.info(f"Setting BALSAMIC logfile path to: {log_file}.")
add_file_logging(log_file, logger_name=__name__)

LOG.info(f"Running BALSAMIC version {balsamic_version} -- CONFIG CASE")

references_path: Path = Path(balsamic_cache, cache_version, genome_version)
references: Dict[str, Path] = get_absolute_paths_dict(
base_path=references_path,
Expand All @@ -154,7 +174,6 @@ def case_config(
if path is not None
}
)

variants_observations = {
"artefact_snv_observations": artefact_snv_observations,
"clinical_snv_observations": clinical_snv_observations,
Expand All @@ -176,6 +195,8 @@ def case_config(
analysis_fastq_dir: str = get_analysis_fastq_files_directory(
case_dir=Path(analysis_dir, case_id).as_posix(), fastq_path=fastq_path
)
LOG.info(f"Prepared analysis fastq-dir: {analysis_fastq_dir}")

result_dir: Path = Path(analysis_dir, case_id, "analysis")
log_dir: Path = Path(analysis_dir, case_id, "logs")
script_dir: Path = Path(analysis_dir, case_id, "scripts")
Expand All @@ -186,6 +207,8 @@ def case_config(
for directory in [result_dir, log_dir, script_dir, benchmark_dir]:
directory.mkdir(exist_ok=True)

LOG.info("Created analysis and log directories.")
LOG.info("Validating configuration data in pydantic model.")
config_collection_dict = ConfigModel(
sentieon={
"sentieon_install_dir": sentieon_install_dir,
Expand Down Expand Up @@ -244,5 +267,10 @@ def case_config(
write_json(json_obj=config_collection_dict, path=config_path)
LOG.info(f"Config file saved successfully - {config_path}")

generate_graph(config_collection_dict, config_path)
snakefile = get_snakefile(
analysis_type=config_collection_dict["analysis"]["analysis_type"],
analysis_workflow=config_collection_dict["analysis"]["analysis_workflow"],
)

generate_graph(config_collection_dict, config_path, snakefile)
LOG.info(f"BALSAMIC Workflow has been configured successfully!")
7 changes: 6 additions & 1 deletion BALSAMIC/commands/config/pon.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
get_analysis_fastq_files_directory,
get_bioinfo_tools_version,
get_pon_sample_list,
get_snakefile,
)
from BALSAMIC.utils.io import read_json, write_json
from BALSAMIC.utils.utils import get_absolute_paths_dict
Expand Down Expand Up @@ -144,5 +145,9 @@ def pon_config(
write_json(json_obj=config_collection_dict, path=config_path)
LOG.info(f"PON config file saved successfully - {config_path}")

generate_graph(config_collection_dict, config_path)
snakefile = get_snakefile(
analysis_type=config_collection_dict["analysis"]["analysis_type"],
analysis_workflow=config_collection_dict["analysis"]["analysis_workflow"],
)
generate_graph(config_collection_dict, config_path, snakefile)
LOG.info(f"BALSAMIC PON workflow has been configured successfully!")
Loading
Loading