Skip to content
Draft
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
363 changes: 363 additions & 0 deletions technical_documentation_examples/metamist_docker/01_metamist.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions technical_documentation_examples/metamist_docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM python:3.10-slim

ARG VERSION=${VERSION:-0.3.1}
RUN pip install fastqe==${VERSION}
15 changes: 15 additions & 0 deletions technical_documentation_examples/metamist_docker/Dockerfile_bulk
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM debian:buster-slim

ENV MAMBA_ROOT_PREFIX /root/micromamba
ENV PATH $MAMBA_ROOT_PREFIX/bin:$PATH

ARG VERSION=${VERSION:-0.3.1}

RUN apt-get update && apt-get install -y git wget bash bzip2 zip curl && \
rm -r /var/lib/apt/lists/* && \
rm -r /var/cache/apt/* && \
wget -qO- https://api.anaconda.org/download/conda-forge/micromamba/0.8.2/linux-64/micromamba-0.8.2-he9b6cbd_0.tar.bz2 | tar -xvj -C /usr/local bin/micromamba && \
mkdir ${MAMBA_ROOT_PREFIX} && \
micromamba install -y --prefix ${MAMBA_ROOT_PREFIX} -c bioconda -c conda-forge \
fastqe=${VERSION} google-cloud-sdk && \
rm -r /root/micromamba/pkgs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions technical_documentation_examples/metamist_docker/test_fastqe.html

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions technical_documentation_examples/metamist_docker/test_fastqe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"""
Jobs to run FastQE.
"""

from os.path import basename

import hailtop.batch as hb
from hailtop.batch.job import Job

from cpg_utils import Path
from cpg_utils.hail_batch import command
from cpg_utils.hail_batch import image_path
from cpg_workflows.filetypes import (
BamPath,
FastqPath,
)
from cpg_workflows.resources import STANDARD


def fastqe(
b: hb.Batch,
output_html_path: Path,
output_zip_path: Path,
input_path1: BamPath | FastqPath,
input_path2: BamPath | FastqPath,
job_attrs: dict | None = None,
) -> Job:
"""
Adds FastQE jobs. If the input is a set of fqs, runs FastQE on each fq file.
"""
j = b.new_job("FASTQE", (job_attrs or {}) | {"tool": "fastqe"})
j.image(image_path("fastqe"))
threads = STANDARD.set_resources(j, ncpu=16).get_nthreads()

cmd = ""
input_file1: str | hb.ResourceFile = b.read_input(str(input_path1))
input_file2: str | hb.ResourceFile = b.read_input(str(input_path2))
fname1 = basename(str(input_path1))
fname2 = basename(str(input_path2))

cmd += f"""\
mkdir -p $BATCH_TMPDIR/outdir
fastqe {input_file1} {input_file2} \\
--outdir $BATCH_TMPDIR/outdir
ls $BATCH_TMPDIR/outdir
ln $BATCH_TMPDIR/outdir/*_fastqe.html {j.out_html}
ln $BATCH_TMPDIR/outdir/*_fastqe.zip {j.out_zip}
unzip $BATCH_TMPDIR/outdir/*_fastqe.zip
"""
j.command(command(cmd, monitor_space=True))
b.write_output(j.out_html, str(output_html_path))
b.write_output(j.out_zip, str(output_zip_path))
return j
12 changes: 12 additions & 0 deletions technical_documentation_examples/metamist_docker/test_fq_r1.fq
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@Read1_r1
GTGCCAGCCGCCGCGGTAGTCCGACGTGGC
+
GGGGGGGGGGGGGGGGGGGGGG!@#$%&%(
@Read2_r1
GTGCCAGCCGCCGCGGTAGTCCGACGTGGC
+
GGGGGGGGGGGGGG!@#$%&%(!@#$%&%(
@Read3_r1
GTGCCAGCCGCCGCGGTAGTCCGACGTGGC
+
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
12 changes: 12 additions & 0 deletions technical_documentation_examples/metamist_docker/test_fq_r2.fq
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@Read1_r2
GTGCCAGCCGCCGCGGTAGTCCGACGTGGC
+
GGGGGGGGGGGGGGGGGGGGGG!@#$%&%(
@Read2_r2
GTGCCAGCCGCCGCGGTAGTCCGACGTGGC
+
GGGGGGGGGGGGGG!@#$%&%(!@#$%&%(
@Read3_r2
GTGCCAGCCGCCGCGGTAGTCCGGGGGGGG
+
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.