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

Set Nallo production QC checks #4288

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion cg/constants/nf_analysis.py
Original file line number Diff line number Diff line change
@@ -16,7 +16,8 @@ class NfTowerStatus(StrEnum):


NALLO_METRIC_CONDITIONS: dict[str, dict[str, Any]] = {
"median_coverage": {"norm": "gt", "threshold": 25},
"median_coverage": {"norm": "gt", "threshold": 20},
"predicted_sex_sex_check": {"norm": "eq", "threshold": None},
}

RAREDISEASE_ADAPTER_BASES_PERCENTAGE_THRESHOLD = 0.005
14 changes: 11 additions & 3 deletions cg/meta/workflow/nallo.py
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

import logging
from pathlib import Path
from typing import Any

from cg.constants import Workflow
from cg.constants.constants import GenomeVersion, FileFormat
@@ -13,7 +14,7 @@
from cg.models.cg_config import CGConfig
from cg.models.nallo.nallo import NalloParameters, NalloSampleSheetEntry, NalloSampleSheetHeaders
from cg.resources import NALLO_BUNDLE_FILENAMES_PATH
from cg.store.models import CaseSample
from cg.store.models import CaseSample, Sample

LOG = logging.getLogger(__name__)

@@ -138,5 +139,12 @@ def get_bundle_filenames_path() -> Path:
"""Return Nallo bundle filenames path."""
return NALLO_BUNDLE_FILENAMES_PATH

def get_workflow_metrics(self, metric_id: str) -> dict:
return NALLO_METRIC_CONDITIONS
def get_workflow_metrics(self, sample_id: str) -> dict:
sample: Sample = self.status_db.get_sample_by_internal_id(internal_id=sample_id)
metric_conditions: dict[str, dict[str, Any]] = dict(NALLO_METRIC_CONDITIONS)
self.set_order_sex_for_sample(sample, metric_conditions)
return metric_conditions

@staticmethod
def set_order_sex_for_sample(sample: Sample, metric_conditions: dict) -> None:
metric_conditions["predicted_sex_sex_check"]["threshold"] = sample.sex

Unchanged files with check annotations Beta

FROM docker.io/library/python:3.11-slim-bullseye
ENV CG_SQL_DATABASE_URI="sqlite:///:memory:"
ENV CG_SECRET_KEY="key"

Check warning on line 4 in Dockerfile

GitHub Actions / docker-image-push

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "CG_SECRET_KEY") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV LIMS_HOST="mocklims.scilifelab.se"
ENV LIMS_USERNAME="limsadmin"
ENV LIMS_PASSWORD="limsadminpassword"

Check warning on line 8 in Dockerfile

GitHub Actions / docker-image-push

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "LIMS_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV MAIL_CONTAINER_URI="http://127.0.0.1:port/container"
ENV GOOGLE_OAUTH_CLIENT_ID="1"
ENV GOOGLE_OAUTH_CLIENT_SECRET="1"

Check warning on line 13 in Dockerfile

GitHub Actions / docker-image-push

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "GOOGLE_OAUTH_CLIENT_SECRET") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV TRAILBLAZER_HOST="host"
ENV TRAILBLAZER_SERVICE_ACCOUNT="service_account"
ENV TRAILBLAZER_SERVICE_ACCOUNT_AUTH_FILE="auth_file"

Check warning on line 17 in Dockerfile

GitHub Actions / docker-image-push

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "TRAILBLAZER_SERVICE_ACCOUNT_AUTH_FILE") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
WORKDIR /home/src/app
RUN poetry install --no-interaction --no-ansi
CMD gunicorn \

Check warning on line 31 in Dockerfile

GitHub Actions / docker-image-push

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/
--config gunicorn.conf.py \
cg.server.auto:app