Skip to content

Commit

Permalink
Merge branch 'master' into patch-existing-parents
Browse files Browse the repository at this point in the history
  • Loading branch information
islean authored Jan 28, 2025
2 parents 0490c0a + 521c45c commit d0a18e0
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 67.0.6
current_version = 67.0.7
commit = True
tag = True
tag_name = v{new_version}
Expand Down
2 changes: 1 addition & 1 deletion cg/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__title__ = "cg"
__version__ = "67.0.6"
__version__ = "67.0.7"
30 changes: 26 additions & 4 deletions cg/cli/workflow/fluffy/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

ARGUMENT_CASE_ID = click.argument("case_id", required=True)
OPTION_EXTERNAL_REF = click.option("-e", "--external-ref", is_flag=True)
OPTION_USE_BWA_MEM = click.option("-b", "--use-bwa-mem", is_flag=True)

LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -51,15 +52,27 @@ def create_samplesheet(context: CGConfig, case_id: str, dry_run: bool):
@DRY_RUN
@click.option("-c", "--config", help="Path to fluffy config in .json format")
@OPTION_EXTERNAL_REF
@OPTION_USE_BWA_MEM
@click.pass_obj
def run(context: CGConfig, case_id: str, dry_run: bool, config: str, external_ref: bool = False):
def run(
context: CGConfig,
case_id: str,
dry_run: bool,
config: str,
external_ref: bool,
use_bwa_mem: bool,
):
"""
Run Fluffy analysis
"""
analysis_api: FluffyAnalysisAPI = context.meta_apis["analysis_api"]
analysis_api.status_db.verify_case_exists(case_internal_id=case_id)
analysis_api.run_fluffy(
case_id=case_id, workflow_config=config, dry_run=dry_run, external_ref=external_ref
case_id=case_id,
workflow_config=config,
dry_run=dry_run,
external_ref=external_ref,
use_bwa_mem=use_bwa_mem,
)
if dry_run:
return
Expand All @@ -78,12 +91,14 @@ def run(context: CGConfig, case_id: str, dry_run: bool, config: str, external_re
@DRY_RUN
@click.option("-c", "--config", help="Path to fluffy config in .json format")
@OPTION_EXTERNAL_REF
@OPTION_USE_BWA_MEM
@click.pass_context
def start(
context: click.Context,
case_id: str,
dry_run: bool,
external_ref: bool = False,
external_ref: bool,
use_bwa_mem: bool,
config: str = None,
):
"""
Expand All @@ -96,7 +111,14 @@ def start(
analysis_api.prepare_fastq_files(case_id=case_id, dry_run=dry_run)
context.invoke(link, case_id=case_id, dry_run=dry_run)
context.invoke(create_samplesheet, case_id=case_id, dry_run=dry_run)
context.invoke(run, case_id=case_id, config=config, dry_run=dry_run, external_ref=external_ref)
context.invoke(
run,
case_id=case_id,
config=config,
dry_run=dry_run,
external_ref=external_ref,
use_bwa_mem=use_bwa_mem,
)


@fluffy.command("start-available")
Expand Down
14 changes: 9 additions & 5 deletions cg/meta/workflow/fluffy.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,12 @@ def make_sample_sheet(self, case_id: str, dry_run: bool) -> None:
fluffy_sample_sheet.write_sample_sheet(sample_sheet_out_path)

def run_fluffy(
self, case_id: str, dry_run: bool, workflow_config: str, external_ref: bool = False
self,
case_id: str,
dry_run: bool,
workflow_config: str,
external_ref: bool,
use_bwa_mem: bool,
) -> None:
"""
Call fluffy with the configured command-line arguments
Expand All @@ -239,10 +244,8 @@ def run_fluffy(
shutil.rmtree(output_path, ignore_errors=True)
if not workflow_config:
workflow_config = self.fluffy_config.as_posix()
if not external_ref:
batch_ref_flag = "--batch-ref"
else:
batch_ref_flag = ""
batch_ref_flag = "" if external_ref else "--batch-ref"
use_bwa_mem_flag = "--bwa-mem" if use_bwa_mem else ""
command_args = [
"--config",
workflow_config,
Expand All @@ -254,6 +257,7 @@ def run_fluffy(
self.get_output_path(case_id=case_id).as_posix(),
"--analyse",
batch_ref_flag,
use_bwa_mem_flag,
"--slurm_params",
self.get_slurm_param_qos(case_id=case_id),
]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[project]
name = "cg"
version = "67.0.6"
version = "67.0.7"
description = "Clinical Genomics command center"
readme = {file = "README.md", content-type = "text/markdown"}
homepage = "https://github.com/Clinical-Genomics/cg"
Expand Down

0 comments on commit d0a18e0

Please sign in to comment.