Skip to content

Commit 54c9a70

Browse files
committed
fix: fix workflow
1 parent 1219e56 commit 54c9a70

File tree

2 files changed

+28
-19
lines changed

2 files changed

+28
-19
lines changed

Dockerfile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
FROM python:3.13-bookworm AS build
22
WORKDIR /app
3-
RUN curl -sSL https://install.python-poetry.org | python -
4-
ENV PATH="/root/.local/bin:${PATH}" \
5-
POETRY_CACHE_DIR='/tmp/poetry_cache' \
6-
POETRY_NO_INTERACTION=1 \
7-
POETRY_VIRTUALENVS_IN_PROJECT=1 \
8-
POETRY_VIRTUALENVS_CREATE=1
9-
COPY pyproject.toml poetry.lock ./
10-
RUN poetry install --without dev --no-root
3+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
4+
ENV UV_COMPILE_BYTECODE=1 \
5+
UV_LINK_MODE=copy
6+
COPY pyproject.toml uv.lock ./
7+
RUN --mount=type=cache,target=/root/.cache/uv \
8+
uv sync --locked --no-install-project --no-dev
119

1210
FROM python:3.13-bookworm AS base
1311
WORKDIR /app
1412
RUN apt-get update && \
1513
apt-get install -y --no-install-recommends default-jre && \
1614
rm -rf /var/lib/apt/lists/* && \
1715
apt-get clean
18-
COPY --from=ghcr.io/virtool/workflow-tools:2.0.1 /opt/fastqc /opt/fastqc
16+
COPY --from=ghcr.io/virtool/tools:1.1.0 /tools/fastqc/0.11.9/ /opt/fastqc
1917
ENV VIRTUAL_ENV=/app/.venv \
2018
PATH="/app/.venv/bin/:/opt/fastqc:${PATH}"
2119
RUN chmod ugo+x /opt/fastqc/fastqc

workflow.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from types import SimpleNamespace
44

55
from pyfixtures import fixture
6-
from virtool_workflow import hooks, step
7-
from virtool_workflow.analysis.fastqc import FastQCRunner
8-
from virtool_workflow.analysis.utils import ReadPaths
9-
from virtool_workflow.data.samples import WFNewSample
6+
from virtool.quality.fastqc import parse_fastqc
7+
from virtool.workflow import hooks, step, RunSubprocess
8+
from virtool.workflow.analysis import ReadPaths
9+
from virtool.workflow.data.samples import WFNewSample
1010

1111

1212
@fixture
@@ -24,19 +24,30 @@ def read_paths(new_sample: WFNewSample) -> ReadPaths:
2424

2525
@step(name="Run FastQC")
2626
async def run_fastqc(
27-
fastqc: FastQCRunner,
2827
intermediate: SimpleNamespace,
2928
read_paths: ReadPaths,
29+
run_subprocess: RunSubprocess,
3030
work_path: Path,
3131
):
3232
"""
3333
Run `fastqc` on the read files.
3434
3535
Parse the output into a dictionary and add it to the scope.
3636
"""
37-
output_path = work_path / "fastqc"
38-
await asyncio.to_thread(output_path.mkdir)
39-
intermediate.quality = await fastqc(read_paths, output_path)
37+
command = [
38+
"fastqc",
39+
"-f",
40+
"fastq",
41+
"-o",
42+
str(work_path),
43+
"--extract",
44+
*[str(path) for path in read_paths],
45+
]
46+
47+
await run_subprocess(command)
48+
49+
intermediate.quality = await asyncio.to_thread(parse_fastqc, work_path)
50+
4051

4152

4253
@step
@@ -51,9 +62,9 @@ async def finalize(
5162
"""
5263
for i, path in enumerate(read_paths):
5364
new_path = await asyncio.to_thread(path.rename, f"reads_{i + 1}.fq.gz")
54-
await new_sample.upload(new_path, "fastq")
65+
await new_sample.upload(new_path)
5566

56-
await new_sample.finalize(intermediate.quality)
67+
await new_sample.finalize(intermediate.quality.dict())
5768

5869

5970
@hooks.on_failure

0 commit comments

Comments
 (0)