Skip to content

Commit

Permalink
Merge branch 'master' into update-jinja2
Browse files Browse the repository at this point in the history
# Conflicts:
#	poetry.lock
  • Loading branch information
henrikstranneheim committed Jan 15, 2025
2 parents 595cba0 + 6a42e69 commit d86e243
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 10 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 = 65.0.10
current_version = 65.0.13
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__ = "65.0.10"
__version__ = "65.0.13"
10 changes: 6 additions & 4 deletions cg/cli/workflow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from cg.cli.workflow.mip_dna.base import mip_dna
from cg.cli.workflow.mip_rna.base import mip_rna
from cg.cli.workflow.mutant.base import mutant
from cg.cli.workflow.nallo.base import nallo
from cg.cli.workflow.raredisease.base import raredisease
from cg.cli.workflow.rnafusion.base import rnafusion
from cg.cli.workflow.taxprofiler.base import taxprofiler
Expand All @@ -27,16 +28,17 @@ def workflow():

workflow.add_command(balsamic)
workflow.add_command(balsamic_qc)
workflow.add_command(balsamic_umi)
workflow.add_command(balsamic_pon)
workflow.add_command(balsamic_umi)
workflow.add_command(fluffy)
workflow.add_command(jasen)
workflow.add_command(microsalt)
workflow.add_command(mip_dna)
workflow.add_command(mip_rna)
workflow.add_command(fluffy)
workflow.add_command(jasen)
workflow.add_command(mutant)
workflow.add_command(nallo)
workflow.add_command(raredisease)
workflow.add_command(raw_data)
workflow.add_command(rnafusion)
workflow.add_command(taxprofiler)
workflow.add_command(tomte)
workflow.add_command(raw_data)
1 change: 1 addition & 0 deletions cg/cli/workflow/nallo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Init for module"""
20 changes: 20 additions & 0 deletions cg/cli/workflow/nallo/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""CLI support to create config and/or start NALLO."""

import logging

import rich_click as click

from cg.cli.utils import CLICK_CONTEXT_SETTINGS
from cg.constants.constants import MetaApis
from cg.meta.workflow.analysis import AnalysisAPI
from cg.meta.workflow.nallo import NalloAnalysisAPI

LOG = logging.getLogger(__name__)


@click.group(invoke_without_command=True, context_settings=CLICK_CONTEXT_SETTINGS)
@click.pass_context
def nallo(context: click.Context) -> None:
"""GMS/Nallo analysis workflow."""
AnalysisAPI.get_help(context)
context.obj.meta_apis[MetaApis.ANALYSIS_API] = NalloAnalysisAPI(config=context.obj)
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h4 class="mt-4 mb-3">Teknisk beskrivning och begränsningar av analysen</h4>
<tbody>
{% for application in applications %}
<tr>
<th scope="row">{{ application.tag }} (v{{ application.version }})</th>
<th scope="row">{{ application.tag }}</th>
<td class="text-start">{{ application.description }}</td>
<td class="text-start">{{ application.details }}</td>
<td class="text-start">
Expand Down
2 changes: 1 addition & 1 deletion cg/meta/delivery_report/templates/macros/order.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h3 class="mb-4">Beställning</h3>
<td>{{ sample.name }} ({{ sample.id }})</td>
<td>{{ sample.timestamps.ordered_at }}</td>
<td>{{ sample.ticket }}</td>
<td>{{ sample.application.tag }} (v{{ sample.application.version }})</td>
<td>{{ sample.application.tag }}</td>
<td>{% if customer_workflow != "taxprofiler" %} {{ sample.sex }} {% endif %}</td>
<td>{{ sample.source }}</td>
<!-- Sample status value -->
Expand Down
20 changes: 20 additions & 0 deletions cg/meta/workflow/nallo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""Module for Nallo Analysis API."""

import logging
from cg.constants import Workflow
from cg.meta.workflow.nf_analysis import NfAnalysisAPI
from cg.models.cg_config import CGConfig

LOG = logging.getLogger(__name__)


class NalloAnalysisAPI(NfAnalysisAPI):
"""Handles communication between Nallo processes
and the rest of CG infrastructure."""

def __init__(
self,
config: CGConfig,
workflow: Workflow = Workflow.NALLO,
):
super().__init__(config=config, workflow=workflow)
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 = "65.0.10"
version = "65.0.13"
description = "Clinical Genomics command center"
readme = {file = "README.md", content-type = "text/markdown"}
homepage = "https://github.com/Clinical-Genomics/cg"
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/workflow/nf_analysis/test_cli_workflow_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@pytest.mark.parametrize(
"workflow",
NEXTFLOW_WORKFLOWS + [Workflow.JASEN],
NEXTFLOW_WORKFLOWS + [Workflow.JASEN] + [Workflow.NALLO],
)
def test_workflow_no_args(cli_runner: CliRunner, workflow: Workflow, request):
"""Test to see that workflow is added and prints help when no subcommand is specified."""
Expand Down
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
from cg.meta.tar.tar import TarAPI
from cg.meta.transfer.external_data import ExternalDataAPI
from cg.meta.workflow.jasen import JasenAnalysisAPI
from cg.meta.workflow.nallo import NalloAnalysisAPI
from cg.meta.workflow.raredisease import RarediseaseAnalysisAPI
from cg.meta.workflow.rnafusion import RnafusionAnalysisAPI
from cg.meta.workflow.taxprofiler import TaxprofilerAnalysisAPI
Expand Down Expand Up @@ -2481,6 +2482,16 @@ def sequencing_platform() -> str:
return SequencingPlatform.ILLUMINA


# Nallo fixtures
@pytest.fixture(scope="function")
def nallo_context(
cg_context: CGConfig,
) -> CGConfig:
"""Context to use in cli."""
cg_context.meta_apis["analysis_api"] = NalloAnalysisAPI(config=cg_context)
return cg_context


# Raredisease fixtures
@pytest.fixture(scope="function")
def raredisease_dir(tmpdir_factory, apps_dir: Path) -> str:
Expand Down

0 comments on commit d86e243

Please sign in to comment.