Skip to content

Commit 2c1dcb0

Browse files
authored
Merge pull request #1 from alignoth/embedding
docs: Add embedding documentation for Alignoth outputs
2 parents 330993c + 131131e commit 2c1dcb0

File tree

3 files changed

+78
-1
lines changed

3 files changed

+78
-1
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,26 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414

15+
- name: Install stable toolchain
16+
uses: actions-rs/toolchain@v1
17+
with:
18+
toolchain: stable
19+
20+
- name: Install alignoth
21+
run: cargo install alignoth
22+
23+
- name: Checkout alignoth repo
24+
uses: actions/checkout@v4
25+
with:
26+
repository: alignoth/alignoth
27+
path: alignoth
28+
29+
- name: Build preview html
30+
run: alignoth -b alignoth/tests/sample_3/NA12878.bam -r alignoth/tests/sample_3/ref.fa -g 1:250-500 --html --max-read-depth 40 > src/preview.html
31+
1532
- name: locosopa
1633
uses: koesterlab/locosopa@main
1734
with:
1835
config: src/config.yaml
1936
path: build
20-
deploy: "false"
37+
deploy: "false"

src/docs/embedding.rst

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
.. _embedding:
2+
3+
**************************
4+
Embedding Alignoth Outputs
5+
**************************
6+
7+
Alignoth produces fully self-contained HTML files that can be easily embedded into other reports and workflows.
8+
This allows users to integrate alignment visualizations directly into existing analysis pipelines, documentation,
9+
or automated reporting systems such as Snakemake or Datavzrd.
10+
11+
Below we demonstrate how to embed Alignoth visualizations within a Snakemake report.
12+
Additional examples for Datavzrd and other tools will be added in future updates.
13+
14+
Embedding in Snakemake
15+
======================
16+
17+
Snakemake can generate detailed, self-contained HTML reports that include any desired output file produced by the workflow.
18+
By wrapping an Alignoth HTML output in the ``report()`` function, it will be automatically integrated into the resulting Snakemake report.
19+
20+
Example rule
21+
------------
22+
23+
.. code-block:: python
24+
25+
rule alignoth:
26+
input:
27+
bam="results/mapped/{sample}.bam",
28+
bam_index="results/mapped/{sample}.bam.bai",
29+
ref="results/ref.fasta"
30+
output:
31+
report("results/alignoth/{sample}/pileup.html")
32+
log:
33+
"logs/alignoth/{sample}.log"
34+
conda:
35+
"envs/alignoth.yaml"
36+
shell:
37+
"""
38+
alignoth -b {input.bam} -r {input.ref} -g chr1:1-1000 --html > {output} 2> {log}
39+
"""
40+
41+
The corresponding Conda environment definition:
42+
43+
.. code-block:: yaml
44+
45+
name: alignoth
46+
channels:
47+
- conda-forge
48+
- bioconda
49+
dependencies:
50+
- alignoth=0.16.4
51+
52+
After your regular workflow execution the snakemake report can be generated via the following command:
53+
54+
.. code-block:: bash
55+
56+
snakemake --report report.zip
57+
58+
The resulting report will contain the interactive Alignoth plot.
59+

src/docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ This launches a wizard that guides you through selecting input files, defining t
1212
.. toctree::
1313
installation
1414
usage
15+
embedding

0 commit comments

Comments
 (0)