From ffe8c7f216a82745553e7d0296d023cbd7a8d6c8 Mon Sep 17 00:00:00 2001 From: kedhammar Date: Wed, 11 Feb 2026 09:52:08 +0100 Subject: [PATCH 01/19] use scout_api_38 for rd --- cg/meta/workflow/analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cg/meta/workflow/analysis.py b/cg/meta/workflow/analysis.py index 64984680ea..c1a2aea0ec 100644 --- a/cg/meta/workflow/analysis.py +++ b/cg/meta/workflow/analysis.py @@ -67,7 +67,7 @@ class AnalysisAPI(MetaAPI): def __init__(self, workflow: Workflow, config: CGConfig): super().__init__(config=config) self.workflow = workflow - if self.workflow == Workflow.NALLO: + if self.workflow in [Workflow.NALLO, Workflow.RAREDISEASE]: self.scout_api: ScoutAPI = self.scout_api_38 else: self.scout_api: ScoutAPI = self.scout_api_37 From 16af16ad8b38cb6c01ad31fb6bc912bd375c6ca4 Mon Sep 17 00:00:00 2001 From: Rasmus Burge <80392398+RasmusBurge-CG@users.noreply.github.com> Date: Wed, 11 Feb 2026 10:05:59 +0100 Subject: [PATCH 02/19] WIP --- tests/cli/upload/test_cli_scout.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/cli/upload/test_cli_scout.py b/tests/cli/upload/test_cli_scout.py index 6d8fe95a4f..1a75ea4c11 100644 --- a/tests/cli/upload/test_cli_scout.py +++ b/tests/cli/upload/test_cli_scout.py @@ -14,6 +14,7 @@ from cg.meta.workflow.mip_dna import MipDNAAnalysisAPI from cg.meta.workflow.mip_rna import MipRNAAnalysisAPI 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.tomte import TomteAnalysisAPI from cg.models.cg_config import CGConfig @@ -35,6 +36,7 @@ (Workflow.MIP_DNA, MipDNAAnalysisAPI), (Workflow.MIP_RNA, MipRNAAnalysisAPI), (Workflow.NALLO, NalloAnalysisAPI), + (Workflow.RAREDISEASE, RarediseaseAnalysisAPI), (Workflow.RNAFUSION, RnafusionAnalysisAPI), (Workflow.TOMTE, TomteAnalysisAPI), ] From 6d022760e957e5c427bb905bde5c2564c121a5eb Mon Sep 17 00:00:00 2001 From: Sebastian Diaz Date: Wed, 11 Feb 2026 10:20:34 +0100 Subject: [PATCH 03/19] coverage for create scout config --- tests/cli/upload/test_cli_scout.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/cli/upload/test_cli_scout.py b/tests/cli/upload/test_cli_scout.py index 1a75ea4c11..88b0db03e4 100644 --- a/tests/cli/upload/test_cli_scout.py +++ b/tests/cli/upload/test_cli_scout.py @@ -32,23 +32,24 @@ ] ANALYSIS_API: list = [ - (Workflow.BALSAMIC, BalsamicAnalysisAPI), - (Workflow.MIP_DNA, MipDNAAnalysisAPI), - (Workflow.MIP_RNA, MipRNAAnalysisAPI), - (Workflow.NALLO, NalloAnalysisAPI), - (Workflow.RAREDISEASE, RarediseaseAnalysisAPI), - (Workflow.RNAFUSION, RnafusionAnalysisAPI), - (Workflow.TOMTE, TomteAnalysisAPI), + (Workflow.BALSAMIC, BalsamicAnalysisAPI, "scout_api_37"), + (Workflow.MIP_DNA, MipDNAAnalysisAPI, "scout_api_37"), + (Workflow.MIP_RNA, MipRNAAnalysisAPI, "scout_api_37"), + (Workflow.NALLO, NalloAnalysisAPI, "scout_api_38"), + (Workflow.RAREDISEASE, RarediseaseAnalysisAPI, "scout_api_38"), + (Workflow.RNAFUSION, RnafusionAnalysisAPI, "scout_api_37"), + (Workflow.TOMTE, TomteAnalysisAPI, "scout_api_37"), ] @pytest.mark.parametrize( - "workflow,analysis_api", + "workflow,analysis_api, scout_instance", ANALYSIS_API, ) def test_get_upload_api( cg_context: CGConfig, case_id: str, + scout_instance: str, helpers: StoreHelpers, workflow: Workflow, analysis_api: AnalysisAPI, @@ -65,6 +66,7 @@ def test_get_upload_api( # THEN assert that the type of upload API is correct assert isinstance(upload_api.analysis_api, analysis_api) + assert upload_api.analysis_api.scout_api is getattr(upload_api.analysis_api, scout_instance) @pytest.mark.parametrize( From 2d8272ce1a7764aa1de2bf2eba67c2bb4d11f734 Mon Sep 17 00:00:00 2001 From: Sebastian Diaz Date: Wed, 11 Feb 2026 10:26:59 +0100 Subject: [PATCH 04/19] make raredisease get scout 38 for upload --- cg/cli/upload/utils.py | 6 +++++- tests/cli/upload/test_utils.py | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/cg/cli/upload/utils.py b/cg/cli/upload/utils.py index d97b71b699..09397b9a50 100644 --- a/cg/cli/upload/utils.py +++ b/cg/cli/upload/utils.py @@ -26,7 +26,11 @@ def suggest_cases_to_upload(status_db: Store, workflow: Workflow | None = None) def get_scout_api_by_case(cg_config: CGConfig, case_id: str) -> ScoutAPI: workflow = cg_config.status_db.get_case_by_internal_id(case_id).data_analysis - return cg_config.scout_api_38 if workflow == Workflow.NALLO else cg_config.scout_api_37 + return ( + cg_config.scout_api_38 + if workflow in [Workflow.NALLO, Workflow.RAREDISEASE] + else cg_config.scout_api_37 + ) def get_scout_api_by_genome_build(cg_config: CGConfig, genome_build: str) -> ScoutAPI: diff --git a/tests/cli/upload/test_utils.py b/tests/cli/upload/test_utils.py index ab5f57a6ce..29078ae907 100644 --- a/tests/cli/upload/test_utils.py +++ b/tests/cli/upload/test_utils.py @@ -5,7 +5,7 @@ from tests.store_helpers import StoreHelpers -def test_get_scout_api_by_case_38(upload_context: CGConfig, helpers: StoreHelpers): +def test_get_scout_api_by_case_nallo(upload_context: CGConfig, helpers: StoreHelpers): # GIVEN a Nallo case nallo_case: Case = helpers.ensure_case( @@ -19,6 +19,20 @@ def test_get_scout_api_by_case_38(upload_context: CGConfig, helpers: StoreHelper assert scout_api == upload_context.scout_api_38 +def test_get_scout_api_by_case_raredisease(upload_context: CGConfig, helpers: StoreHelpers): + + # GIVEN a Nallo case + nallo_case: Case = helpers.ensure_case( + store=upload_context.status_db, data_analysis=Workflow.RAREDISEASE + ) + + # WHEN getting the corresponding ScoutAPI + scout_api = get_scout_api_by_case(cg_config=upload_context, case_id=nallo_case.internal_id) + + # THEN the ScoutAPI should be towards the hg38 instance + assert scout_api == upload_context.scout_api_38 + + def test_get_scout_api_by_case_37(upload_context: CGConfig, helpers: StoreHelpers): # GIVEN a MIP-DNA case From b022523b0c748f7908673be8cd37d41d2abc1ae4 Mon Sep 17 00:00:00 2001 From: kedhammar Date: Wed, 11 Feb 2026 10:54:54 +0100 Subject: [PATCH 05/19] parametrize test checking scout instance per workflow --- tests/cli/upload/test_utils.py | 60 +++++++++++++--------------------- 1 file changed, 23 insertions(+), 37 deletions(-) diff --git a/tests/cli/upload/test_utils.py b/tests/cli/upload/test_utils.py index 29078ae907..67793afce2 100644 --- a/tests/cli/upload/test_utils.py +++ b/tests/cli/upload/test_utils.py @@ -1,3 +1,5 @@ +import pytest + from cg.cli.upload.utils import get_scout_api_by_case, get_scout_api_by_genome_build from cg.constants import Workflow from cg.models.cg_config import CGConfig @@ -5,46 +7,30 @@ from tests.store_helpers import StoreHelpers -def test_get_scout_api_by_case_nallo(upload_context: CGConfig, helpers: StoreHelpers): - - # GIVEN a Nallo case - nallo_case: Case = helpers.ensure_case( - store=upload_context.status_db, data_analysis=Workflow.NALLO - ) - - # WHEN getting the corresponding ScoutAPI - scout_api = get_scout_api_by_case(cg_config=upload_context, case_id=nallo_case.internal_id) - - # THEN the ScoutAPI should be towards the hg38 instance - assert scout_api == upload_context.scout_api_38 - - -def test_get_scout_api_by_case_raredisease(upload_context: CGConfig, helpers: StoreHelpers): - - # GIVEN a Nallo case - nallo_case: Case = helpers.ensure_case( - store=upload_context.status_db, data_analysis=Workflow.RAREDISEASE - ) +@pytest.mark.parametrize( + "workflow,scout_instance", + [ + (Workflow.BALSAMIC, "scout_api_37"), + (Workflow.BALSAMIC_UMI, "scout_api_37"), + (Workflow.MIP_DNA, "scout_api_37"), + (Workflow.MIP_RNA, "scout_api_37"), + (Workflow.NALLO, "scout_api_38"), + (Workflow.RAREDISEASE, "scout_api_38"), + (Workflow.TOMTE, "scout_api_37"), + ], +) +def test_get_scout_api_by_case( + workflow: Workflow, scout_instance: str, upload_context: CGConfig, helpers: StoreHelpers +): + + # GIVEN a case + case: Case = helpers.ensure_case(store=upload_context.status_db, data_analysis=workflow) # WHEN getting the corresponding ScoutAPI - scout_api = get_scout_api_by_case(cg_config=upload_context, case_id=nallo_case.internal_id) + scout_api = get_scout_api_by_case(cg_config=upload_context, case_id=case.internal_id) - # THEN the ScoutAPI should be towards the hg38 instance - assert scout_api == upload_context.scout_api_38 - - -def test_get_scout_api_by_case_37(upload_context: CGConfig, helpers: StoreHelpers): - - # GIVEN a MIP-DNA case - nallo_case: Case = helpers.ensure_case( - store=upload_context.status_db, data_analysis=Workflow.MIP_DNA - ) - - # WHEN getting the corresponding ScoutAPI - scout_api = get_scout_api_by_case(cg_config=upload_context, case_id=nallo_case.internal_id) - - # THEN the ScoutAPI should be towards the hg37 instance - assert scout_api == upload_context.scout_api_37 + # THEN the ScoutAPI should be towards the correct scout instance + assert scout_api == getattr(upload_context, scout_instance) def test_get_scout_api_by_reference_genome_hg19(upload_context: CGConfig): From bb197a14157754d4281a20e906bf32fd72d63e20 Mon Sep 17 00:00:00 2001 From: Sebastian Diaz Date: Wed, 11 Feb 2026 11:27:51 +0100 Subject: [PATCH 06/19] WIP integration test --- .../upload/test_upload_raredisease.py | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/integration/upload/test_upload_raredisease.py diff --git a/tests/integration/upload/test_upload_raredisease.py b/tests/integration/upload/test_upload_raredisease.py new file mode 100644 index 0000000000..98fdede052 --- /dev/null +++ b/tests/integration/upload/test_upload_raredisease.py @@ -0,0 +1,37 @@ +from pathlib import Path + +import pytest +from click.testing import CliRunner, Result +from integration.utils import IntegrationTestPaths +from store_helpers import StoreHelpers + +from cg.cli.base import base +from cg.store.store import Store + + +@pytest.mark.xdist_group(name="integration") +@pytest.mark.integration +def test_upload_raredisease_to_scout( + status_db: Store, + helpers: StoreHelpers, + test_run_paths: IntegrationTestPaths, +): + cli_runner = CliRunner() + + # GIVEN a config file with valid database URIs and directories + config_path: Path = test_run_paths.cg_config_file + # test_root_dir: Path = test_run_paths.test_root_dir + + # WHEN running post-process all + result: Result = cli_runner.invoke( + base, + [ + "--config", + config_path.as_posix(), + "upload", + "scout", + ], + catch_exceptions=False, + ) + + assert result.exit_code == 1 From 50741b293ac008d35ed2874c23679dc2fc1193e1 Mon Sep 17 00:00:00 2001 From: kedhammar Date: Wed, 11 Feb 2026 11:42:15 +0100 Subject: [PATCH 07/19] fix faulty imports --- tests/integration/upload/test_upload_raredisease.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/upload/test_upload_raredisease.py b/tests/integration/upload/test_upload_raredisease.py index 98fdede052..2f9d975d53 100644 --- a/tests/integration/upload/test_upload_raredisease.py +++ b/tests/integration/upload/test_upload_raredisease.py @@ -2,11 +2,11 @@ import pytest from click.testing import CliRunner, Result -from integration.utils import IntegrationTestPaths -from store_helpers import StoreHelpers from cg.cli.base import base from cg.store.store import Store +from tests.integration.utils import IntegrationTestPaths +from tests.store_helpers import StoreHelpers @pytest.mark.xdist_group(name="integration") From 737f6e0dfcbd6d1ea27ebe6b7350e7b741304e14 Mon Sep 17 00:00:00 2001 From: kedhammar Date: Wed, 11 Feb 2026 11:58:14 +0100 Subject: [PATCH 08/19] wip --- tests/integration/config/cg-test.yaml | 19 +++++++++++++ .../upload/test_upload_raredisease.py | 28 ++++++++++++++----- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/tests/integration/config/cg-test.yaml b/tests/integration/config/cg-test.yaml index 2535080167..93d37bd6e9 100644 --- a/tests/integration/config/cg-test.yaml +++ b/tests/integration/config/cg-test.yaml @@ -94,6 +94,25 @@ crunchy: number_tasks: 12 conda_env: crunchy_conda_env +raredisease: + compute_env: raredisease_compute_env + conda_env: raredisease_conda_env + config: {test_root_dir}/raredisease_config.config + launch_directory: {test_root_dir}/raredisease_launch_directory + params: {test_root_dir}/raredisease_params.yaml + platform: {test_root_dir}/platform.config + profile: raredisease_profile + resources: {test_root_dir}/raredisease_resources.config + repository: raredisease_repository + revision: raredisease_revision + root: {test_root_dir}/raredisease_root_path + slurm: + account: "raredisease_slurm_account" + mail_user: "raredisease_mail_user@scilifelab.se" + qos: "low" + tower_workflow: raredisease_tower_workflow + workflow_bin_path: {test_root_dir}/raredisease_workflow_bin_path + data-delivery: destination_path: {test_root_dir}/data-delivery_destination_path covid_destination_path: {test_root_dir}/data-delivery_covid_destination_path diff --git a/tests/integration/upload/test_upload_raredisease.py b/tests/integration/upload/test_upload_raredisease.py index 2f9d975d53..193cf241d7 100644 --- a/tests/integration/upload/test_upload_raredisease.py +++ b/tests/integration/upload/test_upload_raredisease.py @@ -1,9 +1,11 @@ +from datetime import datetime as dt from pathlib import Path import pytest from click.testing import CliRunner, Result from cg.cli.base import base +from cg.constants.constants import DataDelivery, Workflow from cg.store.store import Store from tests.integration.utils import IntegrationTestPaths from tests.store_helpers import StoreHelpers @@ -22,16 +24,28 @@ def test_upload_raredisease_to_scout( config_path: Path = test_run_paths.cg_config_file # test_root_dir: Path = test_run_paths.test_root_dir + # GIVEN a raredisease case + case = helpers.add_case( + store=status_db, data_analysis=Workflow.RAREDISEASE, data_delivery=DataDelivery.SCOUT + ) + + # GIVEN a completed raredisease analysis of that case + analysis = helpers.add_analysis( + store=status_db, + case=case, + workflow=Workflow.RAREDISEASE, + data_delivery=DataDelivery.SCOUT, + completed_at=dt.now(), + ) + + # GIVEN a housekeeper bundle for that analysis + hk_bundle = helpers.ensure_hk_bundle() + # WHEN running post-process all result: Result = cli_runner.invoke( base, - [ - "--config", - config_path.as_posix(), - "upload", - "scout", - ], + ["--config", config_path.as_posix(), "upload", "scout", case.internal_id], catch_exceptions=False, ) - assert result.exit_code == 1 + assert result.exit_code == 0 From e39cb192eb7809577c90d7b25d5b697f65e7e8c4 Mon Sep 17 00:00:00 2001 From: Rasmus Burge <80392398+RasmusBurge-CG@users.noreply.github.com> Date: Wed, 11 Feb 2026 13:39:35 +0100 Subject: [PATCH 09/19] Remove integration test - will be done in another PR --- .../upload/test_upload_raredisease.py | 51 ------------------- 1 file changed, 51 deletions(-) delete mode 100644 tests/integration/upload/test_upload_raredisease.py diff --git a/tests/integration/upload/test_upload_raredisease.py b/tests/integration/upload/test_upload_raredisease.py deleted file mode 100644 index 193cf241d7..0000000000 --- a/tests/integration/upload/test_upload_raredisease.py +++ /dev/null @@ -1,51 +0,0 @@ -from datetime import datetime as dt -from pathlib import Path - -import pytest -from click.testing import CliRunner, Result - -from cg.cli.base import base -from cg.constants.constants import DataDelivery, Workflow -from cg.store.store import Store -from tests.integration.utils import IntegrationTestPaths -from tests.store_helpers import StoreHelpers - - -@pytest.mark.xdist_group(name="integration") -@pytest.mark.integration -def test_upload_raredisease_to_scout( - status_db: Store, - helpers: StoreHelpers, - test_run_paths: IntegrationTestPaths, -): - cli_runner = CliRunner() - - # GIVEN a config file with valid database URIs and directories - config_path: Path = test_run_paths.cg_config_file - # test_root_dir: Path = test_run_paths.test_root_dir - - # GIVEN a raredisease case - case = helpers.add_case( - store=status_db, data_analysis=Workflow.RAREDISEASE, data_delivery=DataDelivery.SCOUT - ) - - # GIVEN a completed raredisease analysis of that case - analysis = helpers.add_analysis( - store=status_db, - case=case, - workflow=Workflow.RAREDISEASE, - data_delivery=DataDelivery.SCOUT, - completed_at=dt.now(), - ) - - # GIVEN a housekeeper bundle for that analysis - hk_bundle = helpers.ensure_hk_bundle() - - # WHEN running post-process all - result: Result = cli_runner.invoke( - base, - ["--config", config_path.as_posix(), "upload", "scout", case.internal_id], - catch_exceptions=False, - ) - - assert result.exit_code == 0 From 9b7dc1907667c033eac9c4b0ede273cd09843e2c Mon Sep 17 00:00:00 2001 From: islean Date: Wed, 11 Feb 2026 13:55:52 +0100 Subject: [PATCH 10/19] Add todo --- cg/meta/upload/scout/raredisease_config_builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cg/meta/upload/scout/raredisease_config_builder.py b/cg/meta/upload/scout/raredisease_config_builder.py index b0e538ad27..9e32a07446 100644 --- a/cg/meta/upload/scout/raredisease_config_builder.py +++ b/cg/meta/upload/scout/raredisease_config_builder.py @@ -69,7 +69,7 @@ def build_load_config(self, hk_version: Version, analysis: Analysis) -> Raredise self.load_custom_image_sample( load_config=load_config, analysis=analysis, hk_version=hk_version ) - load_config.human_genome_build = GenomeBuild.hg19 + load_config.human_genome_build = GenomeBuild.hg19 # TODO: Change load_config.rank_score_threshold = RANK_MODEL_THRESHOLD load_config.rank_model_version = self.get_rank_model_version( variant_type=Variants.SNV, hk_version=hk_version From 5edca0f1dbfaaa0f452a9db70638092290ddb18b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linn=C3=A9a=20L=C3=B6fdahl?= Date: Wed, 11 Feb 2026 14:14:26 +0100 Subject: [PATCH 11/19] More TODOs --- .../macros/uploaded_files/uploaded_files.html | 186 +++++++++--------- cg/meta/workflow/raredisease.py | 2 +- .../test_configurator_factory.py | 1 + 3 files changed, 95 insertions(+), 94 deletions(-) diff --git a/cg/meta/delivery_report/templates/macros/uploaded_files/uploaded_files.html b/cg/meta/delivery_report/templates/macros/uploaded_files/uploaded_files.html index e68323e1cf..7d068d6700 100644 --- a/cg/meta/delivery_report/templates/macros/uploaded_files/uploaded_files.html +++ b/cg/meta/delivery_report/templates/macros/uploaded_files/uploaded_files.html @@ -6,115 +6,115 @@ {% macro uploaded_files(case, customer) %} {% set data_delivery = case.data_analysis.data_delivery %} - {% if "fastq" in data_delivery or "analysis" in data_delivery or "scout" in data_delivery %} -
-

Uppladdade filer

- - - {{ scout_files(case=case, customer_id=customer.id, scout_access=customer.scout_access) }} - - {{ caesar_files(case=case, customer_id=customer.id) }} -
- {% endif %} +{% if "fastq" in data_delivery or "analysis" in data_delivery or "scout" in data_delivery %} +
+

Uppladdade filer

+ + + {{ scout_files(case=case, customer_id=customer.id, scout_access=customer.scout_access) }} + + {{ caesar_files(case=case, customer_id=customer.id) }} +
+{% endif %} {% endmacro %} {% macro scout_files(case, customer_id, scout_access) %} {% set workflow = case.data_analysis.workflow %} - {% if scout_access and "scout" in case.data_analysis.data_delivery %} -

Scout

- - {% if "balsamic" in workflow %} - - {{ balsamic_scout_files(scout_files=case.data_analysis.scout_files, case_id=case.id, case_name=case.name) }} - {% elif workflow == "mip-dna" %} - - {{ mip_dna_scout_files(scout_files=case.data_analysis.scout_files, case_id=case.id, case_name=case.name) }} - {% elif workflow == "nallo" %} - - {{ nallo_scout_files(scout_files=case.data_analysis.scout_files, case_id=case.id, case_name=case.name) }} - {% elif workflow == "raredisease" %} - - {{ raredisease_scout_files(scout_files=case.data_analysis.scout_files, case_id=case.id, case_name=case.name) }} - {% elif workflow == "rnafusion" %} - - {{ rnafusion_scout_files(scout_files=case.data_analysis.scout_files, case_id=case.id, case_name=case.name) }} - {% endif %} +{% if scout_access and "scout" in case.data_analysis.data_delivery %} +

Scout

+ +{% if "balsamic" in workflow %} + +{{ balsamic_scout_files(scout_files=case.data_analysis.scout_files, case_id=case.id, case_name=case.name) }} +{% elif workflow == "mip-dna" %} + +{{ mip_dna_scout_files(scout_files=case.data_analysis.scout_files, case_id=case.id, case_name=case.name) }} +{% elif workflow == "nallo" %} + +{{ nallo_scout_files(scout_files=case.data_analysis.scout_files, case_id=case.id, case_name=case.name) }} +{% elif workflow == "raredisease" %} + +{{ raredisease_scout_files(scout_files=case.data_analysis.scout_files, case_id=case.id, case_name=case.name) }} +{% elif workflow == "rnafusion" %} + +{{ rnafusion_scout_files(scout_files=case.data_analysis.scout_files, case_id=case.id, case_name=case.name) }} +{% endif %} +{% endif %} {% endmacro %} {% macro caesar_files(case, customer_id) %} {% set data_delivery = case.data_analysis.data_delivery %} - {% if "fastq" in data_delivery or "analysis" in data_delivery %} -

Leveransinkorg (Caesar)

- - - {{ analysis_files(case=case) }} - - {{ fastq_files(case=case) }} - {% endif %} +{% if "fastq" in data_delivery or "analysis" in data_delivery %} +

Leveransinkorg (Caesar)

+ + +{{ analysis_files(case=case) }} + +{{ fastq_files(case=case) }} +{% endif %} {% endmacro %} {% macro analysis_files(case) %} - {% if "analysis" in case.data_analysis.data_delivery %} - - - - - - - - {{ delivered_files(row_title=case.name, files=case.data_analysis.delivered_files) }} - {% for sample in case.samples %} - {{ delivered_files(row_title=sample.name, files=sample.delivered_files) }} - {% endfor %} - -
Analysfiler
- {% endif %} +{% if "analysis" in case.data_analysis.data_delivery %} + + + + + + + + {{ delivered_files(row_title=case.name, files=case.data_analysis.delivered_files) }} + {% for sample in case.samples %} + {{ delivered_files(row_title=sample.name, files=sample.delivered_files) }} + {% endfor %} + +
Analysfiler
+{% endif %} {% endmacro %} {% macro fastq_files(case) %} - {% if "fastq" in case.data_analysis.data_delivery %} - - - - - - - - {% for sample in case.samples %} - - {{ delivered_files(row_title=sample.name, files=sample.delivered_fastq_files) }} - {% endfor %} - -
Fastq-filer
- {% endif %} -{% endmacro %} - -{% macro delivered_files(row_title, files) %} - {% if files != "N/A" %} +{% if "fastq" in case.data_analysis.data_delivery %} + + - + - {% for file in files %} - - - + + + {% for sample in case.samples %} + + {{ delivered_files(row_title=sample.name, files=sample.delivered_fastq_files) }} {% endfor %} - {% endif %} + +
{{ row_title }}Fastq-filer
{{ file }}
+{% endif %} {% endmacro %} + +{% macro delivered_files(row_title, files) %} +{% if files != "N/A" %} + + {{ row_title }} + +{% for file in files %} + + {{ file }} + +{% endfor %} +{% endif %} +{% endmacro %} \ No newline at end of file diff --git a/cg/meta/workflow/raredisease.py b/cg/meta/workflow/raredisease.py index 42d87b2a2a..45533ff6f4 100644 --- a/cg/meta/workflow/raredisease.py +++ b/cg/meta/workflow/raredisease.py @@ -165,7 +165,7 @@ def get_scout_upload_case_tags(self) -> dict: def get_genome_build(self, case_id: str) -> GenomeVersion: """Return reference genome for a raredisease case. Currently fixed for hg19.""" - return GenomeVersion.HG19 + return GenomeVersion.HG19 # TODO change def parse_analysis(self, qc_metrics_raw: list[MetricsBase], **kwargs) -> NextflowAnalysis: """Parse Nextflow output analysis files and return an analysis model.""" diff --git a/tests/services/analysis_starter/test_configurator_factory.py b/tests/services/analysis_starter/test_configurator_factory.py index ab795d6e01..4627d63c8a 100644 --- a/tests/services/analysis_starter/test_configurator_factory.py +++ b/tests/services/analysis_starter/test_configurator_factory.py @@ -200,6 +200,7 @@ def test_configurator_factory_failure(cg_context: CGConfig): configurator_factory.get_configurator(workflow) +# TODO complete these tests to have full coverage def test_get_scout_api_38(cg_context: CGConfig): # GIVEN a configurator factory configurator_factory = ConfiguratorFactory(cg_config=cg_context) From f93e0e9602ced34a2de976f669b59a09accf0d76 Mon Sep 17 00:00:00 2001 From: kedhammar Date: Wed, 11 Feb 2026 14:47:11 +0100 Subject: [PATCH 12/19] Change rd scout link in delivery report template and add test assertion --- .../templates/macros/uploaded_files/uploaded_files.html | 2 +- tests/meta/delivery_report/test_data_validators.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cg/meta/delivery_report/templates/macros/uploaded_files/uploaded_files.html b/cg/meta/delivery_report/templates/macros/uploaded_files/uploaded_files.html index 7d068d6700..c9a9f3ffeb 100644 --- a/cg/meta/delivery_report/templates/macros/uploaded_files/uploaded_files.html +++ b/cg/meta/delivery_report/templates/macros/uploaded_files/uploaded_files.html @@ -28,7 +28,7 @@

Uppladdade filer

Scout