Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM python:3.13-bookworm AS deps
WORKDIR /app
COPY --from=ghcr.io/virtool/tools:1.1.0 /tools/bowtie2/2.5.4/bowtie* /usr/local/bin/
COPY --from=ghcr.io/virtool/tools:1.1.0 /tools/pigz/2.8/pigz /usr/local/bin/
COPY --from=ghcr.io/virtool/tools:1.1.0 /tools/samtools/1.22.1/bin/samtools /usr/local/bin/
COPY --from=ghcr.io/virtool/tools:1.2.0 /tools/bowtie2/2.5.4/bowtie* /usr/local/bin/
COPY --from=ghcr.io/virtool/tools:1.2.0 /tools/cd-hit/4.8.1/cd-hit-est /usr/local/bin/
COPY --from=ghcr.io/virtool/tools:1.2.0 /tools/pigz/2.8/pigz /usr/local/bin/
COPY --from=ghcr.io/virtool/tools:1.2.0 /tools/samtools/1.22.1/bin/samtools /usr/local/bin/

FROM python:3.13-bookworm AS uv
WORKDIR /app
Expand Down
57 changes: 49 additions & 8 deletions fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,42 @@
from pyfixtures import fixture


def get_reference_index_path(work_path: Path) -> Path:
return work_path / "reference_index" / "reference"


def get_collapsed_reference_path(work_path: Path) -> Path:
return work_path / "collapsed_reference" / "reference.json"


def get_subtraction_indexes_path(work_path: Path) -> Path:
return work_path / "subtraction_indexes"


def get_isolate_path(work_path: Path) -> Path:
return work_path / "isolates"


def get_isolate_fasta_path(isolate_path: Path) -> Path:
return isolate_path / "isolate_index.fa"


def get_isolate_fastq_path(isolate_path: Path) -> Path:
return isolate_path / "isolate_mapped.fq"


def get_isolate_index_path(isolate_path: Path) -> Path:
return isolate_path / "isolates"


def get_isolate_bam_path(isolate_path: Path) -> Path:
return isolate_path / "to_isolates.bam"


def get_subtracted_bam_path(work_path: Path) -> Path:
return work_path / "subtracted.bam"
Comment on lines +7 to +40

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be inlined if only used once. No need for separate function declaration.



@fixture
def intermediate():
"""A namespace for storing intermediate values."""
Expand All @@ -14,40 +50,45 @@ def intermediate():

@fixture
def isolate_path(work_path: Path):
path = work_path / "isolates"
path = get_isolate_path(work_path)
path.mkdir()

return path


@fixture
def reference_index_path(work_path: Path):
return work_path / "reference_index" / "reference"
return get_reference_index_path(work_path)


@fixture
def collapsed_reference_path(work_path: Path):
return get_collapsed_reference_path(work_path)


@fixture
def subtraction_indexes_path(work_path: Path) -> Path:
return work_path / "subtraction_indexes"
return get_subtraction_indexes_path(work_path)


@fixture
def isolate_fasta_path(isolate_path: Path):
return isolate_path / "isolate_index.fa"
return get_isolate_fasta_path(isolate_path)


@fixture
def isolate_fastq_path(isolate_path: Path):
return isolate_path / "isolate_mapped.fq"
return get_isolate_fastq_path(isolate_path)


@fixture
def isolate_index_path(isolate_path: Path):
return isolate_path / "isolates"
return get_isolate_index_path(isolate_path)


@fixture
def isolate_bam_path(isolate_path: Path):
return isolate_path / "to_isolates.bam"
return get_isolate_bam_path(isolate_path)


@fixture
Expand All @@ -58,4 +99,4 @@ def p_score_cutoff():
@fixture
def subtracted_bam_path(work_path: Path) -> Path:
"""The path to the BAM file after subtraction reads have been eliminated."""
return work_path / "subtracted.bam"
return get_subtracted_bam_path(work_path)
Loading