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
23 changes: 3 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,9 @@ RUN conda config --set channel_priority strict
## install snakemake
RUN mamba install -y -c conda-forge -c bioconda snakemake graphviz

# install chrome dependencies (for kaleido/plotly to export plot .png/.svg)
RUN apt update && apt-get install -y \
libnss3 \
libatk-bridge2.0-0 \
libcups2 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
libgbm1 \
libxkbcommon0 \
libpango-1.0-0 \
libcairo2

# install python packages
RUN pip install --upgrade pip
RUN pip install kaleido

# install chrome for kaleido
RUN kaleido_get_chrome
# download + install Google Chrome (for kaleido/plotly to export plot .png/.svg)
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get update && apt install -y ./google-chrome-stable_current_amd64.deb

## copy the pipeline code into the container
WORKDIR /app
Expand Down
11 changes: 6 additions & 5 deletions app/workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ VERSION_ENVS = [

# ********** Quarto reports **********
QMD_FILES = glob(os.path.join(REPORTS_DIR, "**", "*.qmd"), recursive=True) if REPORTS_DIR else []
QUARTO_HTML_FILES = [STEP_QUARTO_DIR + os.path.basename(os.path.dirname(f)) + "/" + os.path.splitext(os.path.basename(f))[0] + ".html" for f in QMD_FILES]
QUARTO_HTML_FILES = [STEP_QUARTO_DIR + os.path.splitext(os.path.basename(qmd))[0] + ".html" for qmd in QMD_FILES]

# ********** helper functions to get R1/R2 FASTQ files **********
def get_r1(wildcards):
Expand Down Expand Up @@ -990,21 +990,22 @@ rule prose:
############# Last step: Re-generate user-defined Quarto reports #############
rule render_quarto:
input:
qmd_path=REPORTS_DIR + "{dir_name}/{qmd_name}.qmd",
qmd_path=REPORTS_DIR + "{qmd_name}.qmd",
methods=STEP_PROSE_DIR + "methods.md", # not used; runs Quarto as the last step
output:
STEP_QUARTO_DIR + "{dir_name}/{qmd_name}.html",
STEP_QUARTO_DIR + "{qmd_name}.html",
threads:
CORES
conda:
"envs/quarto.yml"
log:
LOGS + Path(STEP_QUARTO_DIR).name + "/{dir_name}/{qmd_name}.log",
LOGS + Path(STEP_QUARTO_DIR).name + "/{qmd_name}.log",
shell:
# Quarto writes the rendered HTML next to the source .qmd; move it into
# the results reports dir so it matches the declared output. (Quarto's
# --output-dir is resolved relative to the input file, so it can't be
# pointed straight at an arbitrary results path.)
"""
quarto render {input.qmd_path} -M embed-resources:true &> {log}
mkdir -p "$(dirname {output})"
mv "$(dirname {input.qmd_path})/{wildcards.qmd_name}.html" "{output}"
"""