Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
31 changes: 31 additions & 0 deletions bio/alignoth/environment.linux-64.pin.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: linux-64
# created-by: conda 25.9.1
@EXPLICIT
https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2#d7c89558ba9fa0495403155b64376d81
https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2025.10.5-hbd8a1cb_0.conda#f9e5fbc24009179e8b0409624691758a
https://conda.anaconda.org/conda-forge/linux-64/libgomp-15.2.0-h767d61c_7.conda#f7b4d76975aac7e5d9e6ad13845f92fe
https://conda.anaconda.org/conda-forge/linux-64/_openmp_mutex-4.5-2_gnu.tar.bz2#73aaf86a425cc6e73fcf236a5a46396d
https://conda.anaconda.org/conda-forge/linux-64/libgcc-15.2.0-h767d61c_7.conda#c0374badb3a5d4b1372db28d19462c53
https://conda.anaconda.org/conda-forge/linux-64/c-ares-1.34.5-hb9d3cd8_0.conda#f7f0d6cc2dc986d42ac2689ec88192be
https://conda.anaconda.org/conda-forge/linux-64/keyutils-1.6.3-hb9d3cd8_0.conda#b38117a3c920364aff79f870c984b4a3
https://conda.anaconda.org/conda-forge/linux-64/libgcc-ng-15.2.0-h69a702a_7.conda#280ea6eee9e2ddefde25ff799c4f0363
https://conda.anaconda.org/conda-forge/linux-64/libgfortran5-15.2.0-hcd61629_7.conda#f116940d825ffc9104400f0d7f1a4551
https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-15.2.0-h8f9b012_7.conda#5b767048b1b3ee9a954b06f4084f93dc
https://conda.anaconda.org/conda-forge/linux-64/libzlib-1.3.1-hb9d3cd8_2.conda#edb0dca6bc32e4f4789199455a1dbeb8
https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-h2d0b736_3.conda#47e340acb35de30501a76c7c799c41d7
https://conda.anaconda.org/conda-forge/linux-64/openssl-3.5.4-h26f9b46_0.conda#14edad12b59ccbfa3910d42c72adc2a0
https://conda.anaconda.org/conda-forge/linux-64/libedit-3.1.20250104-pl5321h7949ede_0.conda#c277e0a4d549b03ac1e9d6cbbe3d017b
https://conda.anaconda.org/conda-forge/linux-64/libev-4.33-hd590300_2.conda#172bf1cd1ff8629f2b1179945ed45055
https://conda.anaconda.org/conda-forge/linux-64/libgfortran-15.2.0-h69a702a_7.conda#8621a450add4e231f676646880703f49
https://conda.anaconda.org/conda-forge/linux-64/libssh2-1.11.1-hcf80075_0.conda#eecce068c7e4eddeb169591baac20ac4
https://conda.anaconda.org/conda-forge/linux-64/libstdcxx-ng-15.2.0-h4852527_7.conda#f627678cf829bd70bccf141a19c3ad3e
https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb8e6e7a_2.conda#6432cb5d4ac0046c3ac0a8a0f95842f9
https://conda.anaconda.org/conda-forge/linux-64/krb5-1.21.3-h659f571_0.conda#3f43953b7d3fb3aaa1d0d0723d91e368
https://conda.anaconda.org/conda-forge/linux-64/libnghttp2-1.67.0-had1ee68_0.conda#b499ce4b026493a13774bcf0f4c33849
https://conda.anaconda.org/conda-forge/linux-64/libopenblas-0.3.30-pthreads_h94d23a6_2.conda#dfc5aae7b043d9f56ba99514d5e60625
https://conda.anaconda.org/conda-forge/linux-64/libblas-3.9.0-37_h4a7cf45_openblas.conda#8bc098f29d8a7e3517bac5b25aab39b1
https://conda.anaconda.org/conda-forge/linux-64/libcurl-8.16.0-h4e3cde8_0.conda#a401aa9329350320c7d3809a7a5a1640
https://conda.anaconda.org/conda-forge/linux-64/libcblas-3.9.0-37_h0358290_openblas.conda#3794858d4d6910a7fc3c181519e0b77a
https://conda.anaconda.org/bioconda/linux-64/alignoth-1.1.3-h1520f10_0.conda#2be85e366db3bf6f0d302158330d4668
6 changes: 6 additions & 0 deletions bio/alignoth/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
channels:
- conda-forge
- bioconda
- nodefaults
dependencies:
- alignoth =1.1.3
18 changes: 18 additions & 0 deletions bio/alignoth/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: alignoth
description: |
Alignoth generates alignment plots from BAM files.
This wrapper allows specifying BAMs, reference FASTA, VCFs,
highlight regions, auxiliary tags, and output options.
url: https://github.com/alignoth/alignoth
input:
- bam: Path to indexed BAM file
- reference: Path to indexed reference FASTA file
- vcf: Path to indexed VCF file (Optional)
- bed: Path to BED file (Optional)
output: "HTML, JSON or directory path"
authors:
- Felix Wiegand
params:
- extra: "Extra command line arguments to pass directly to alignoth."
notes: |
Output needs to end with .html, .json or a directory path.
Binary file added bio/alignoth/test/1257A.vcf.gz
Binary file not shown.
Binary file added bio/alignoth/test/1257A.vcf.gz.csi
Binary file not shown.
Binary file added bio/alignoth/test/NA12878.bam
Binary file not shown.
Binary file added bio/alignoth/test/NA12878.bam.bai
Binary file not shown.
41 changes: 41 additions & 0 deletions bio/alignoth/test/Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
rule alignoth_json:
input:
bam="NA12878.bam",
reference="ref.fa",
vcf="1257A.vcf.gz"
output:
"out/json_plot.vl.json"
params:
extra="-g 1:50-280 -h coolregion:200-210"
log:
"logs/log.txt"
wrapper:
"master/bio/alignoth"

rule alignoth_html:
input:
bam="NA12878.bam",
reference="ref.fa",
vcf="1257A.vcf.gz"
output:
"out/plot.html"
params:
extra="-g 1:50-280 -h coolregion:200-210"
log:
"logs/log.txt"
wrapper:
"master/bio/alignoth"

rule alignoth_output_dir:
input:
bam="NA12878.bam",
reference="ref.fa",
vcf="1257A.vcf.gz"
output:
directory("output-dir/")
params:
extra="-g 1:50-280 -h coolregion:200-210"
log:
"logs/log.txt"
wrapper:
"master/bio/alignoth"
2 changes: 2 additions & 0 deletions bio/alignoth/test/ref.fa
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>1
TGTGCACCCAGGCTAATTAATGTTCATGGGAACTAATTAGAGCTGACATGTACAGCCAGCCTTTTGCTTACTCTGCGGGATCTTGTTCTGTGTGATTTCTCTAGGGGGAGCCTGCTCACTTTGAGTATTTGATGTATCCATTGCACTCAGCACCCATCACCGGTCTAGCTACCTGCATCCGCAAACCCCTTATAGCCACCTGTTCTCTGGATCGATCCATCCGCCTTTGGAATTATGAAACAAAGTAAGGAATGAAAGGCTTGCCTACTTTATTATGCAAGACCCCAGTTGTGAATTTATGTGAATTATTTTAATTACAGTGTTCCAAACTTTAATTATTTAGAAGCTTTCAGTTGGAAAAGATTTTTAAAAAATCAAGTCAGTCAACCTACCTGTTTCTCACTCTTGCGTGGGCTAGAAAACTACTTTGTGGTTTATTTAATGCTTACCACATGCTAGACACTGGGGACATGAAGAGATGAAGACAACACCTCAGTCTCTCACCTTCTTACATAAACTCCTGGGTCCCTCCAGCTCTCCTATCCCCTTGTTTCCCACAGGAACTGCTCTTTGCTTCAGGGAGCTCTCCAGACCCTTTCTTCCTCATCTTTCTCCCAGGACATCACTATCTCAACCACCCCCAACTCCCTCCTGACTTTACCTTCCAGCACAGCTTCCCTGGGAAGCTCCAACCCTAGGTGGACCCCCACCCCCTACTGTTTTCTTTGTTCTTATGTACAACTTCTGGGGCTTCTGGGGAAAAAATACTTGGACAATACTCATGAATTTTGGAATATAAACAGAGCTATGTCTTCAGCATCGCTAGACCACACCTTGACCAGTCTCCCTATCTACCATGCTCCACGCTGGACATTATCCCCTAATAACCAAGATCTAGAAAAGAGAGGAACCAACAATTGCAAACAGTAGTGTGTCTCAAATACGATGATAACAATATATATCAGATACAGTAGATGACTGGAAGGATTTAGTGAGCTAAGCTTACAATTCAGTAATTGATCTTTTTCACAGCACCCTGGAACTATTTAAGGAATACCAAGAAGAGGCATATTCCATCAGCCTTCATCCATCTGGACACTTCATTGTAGTAGGGTTTGCTGACAAACTACGCCTCATGAATCTACTCATTGATGATATACGTTCTTTCAAAGAATACTCTGTTAGAGGATGCGGAGAGGTAAAAAAAAAACTGCTGAAGACAAAAGTCCAGTTTCTTAGAAAGCCACGGCTGAAATATCAGGAACTAACATGATCTGGGGAGGTGGGACCAAAATCTGTCTTGGAGAACTACAGTGGCTTAAAAAAAGGGGGAAGGAGGAAATCCAGTTATTTTCCCAGCAACCTTATTGAGTATATGGTTCCATCCCCATATTCTTATGTCCACCAGACTATTTCATTGAACCTAAAACCTTGTGAGATCCCCGCTATGATAAGTCCTGTCTGTAATTGTGGAATATTAACAAATATTTTAAAAGAAAAGTAATCTCAGAATCAGAGTCACAGCTAAGAAGGTGAGGTTGGAGACGGAGGAGCCAGGGAAAAATAAGCATCAATGGTGAGAGGTAATAAAGAGCGCATCAGCTTTCCCTGAGGTGTCTTGCAGAAACAAGGCAATGATTTCAGGAATTACTTCCCCGGCTCTGAAACATGCTTCTACAGGCAAAATGATTGCTTGTGGTCCCAACGGCTTAATGATTTGTGGGCCTGACAGTGTCAGCATCTGGCCACTATGAGTTACAGGAATAATGAAAGTGTCTGAAAATGTCAGCCACTCCTCAGTCTCATTTGCACCTTCCCCCCACTCCCACCCTCACACGTAGTTTCAGTCTGAACTCGTTGGGAAAAGCACCTCTTGACTGTAACCTCTAATTAGACTGCTCACTTCCTGCTTGCTTGCTCTCTTGCTGTCTTTCCCTATAGTGTTCCTTTAGCAATGGAGGTCACCTGTTTGCTGCAGTCAATGGAAATGTGATTCACGTTTACACCACCACGAGCCTAGAGAACATCTCAAGCCTGAAAGGACACACAGGGAAGGTAAGTGAGTGAACAGTCTCTGGGGAAACAAGGGGCACGGAGCCAAGTATGCCGCCAGCCAGTGGGATACAGGTGAACAAAAGAGAGATGGTTCCTTTCCTCATGGGTTCACTGTCTACTTGGGGAAAGAGACAATAAAACAAATGCACAGACAAATGTAGTTACTAATTGCAGTTCCACTGAAAGAAAAACATGGTGTTGTTGTGAGAGAAATAATGAAGGGGGCGGCATAATTTAGGTGGCTGTATTTGCAAAGGCTTGGTCCTATAAGAGTGAGTAGGAGTTAATCAGACACAACTGGTGGGGATAATCACTGCAGATAGGGATCCAAAGGCCAGAGATGGGAGACTCATAGG
1 change: 1 addition & 0 deletions bio/alignoth/test/ref.fa.fai
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1 2411 3 2411 2412
3 changes: 3 additions & 0 deletions bio/alignoth/test/test.bed
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 260 300 MVSTP1
1 400 450 LH44
1 600 650 GR63
46 changes: 46 additions & 0 deletions bio/alignoth/wrapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
__author__ = "Felix Wiegand"
__copyright__ = "Copyright 2025, Felix Wiegand"
__email__ = "[email protected]"
__license__ = "MIT"

from snakemake.shell import shell

log = snakemake.log_fmt_shell(stdout=False, stderr=True)
extra = snakemake.params.get("extra", "")
output = snakemake.output[0]

cmd = ["alignoth"]

# BAM input
if snakemake.input.get("bam", ""):
cmd.append(f"-b {snakemake.input.bam}")
else:
raise ValueError("BAM input required")

# Reference
if snakemake.input.get("reference", ""):
cmd.append(f"-r {snakemake.input.reference}")
else:
raise ValueError("Reference input required")

# Optional VCF
if snakemake.input.get("vcf", ""):
cmd.append(f"-v {snakemake.input.vcf}")

# Optional BED
if snakemake.input.get("bed", ""):
cmd.append(f"--bed {snakemake.input.bed}")

cmd.append(f"{extra}")
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid appending empty extra parameter.

Line 35 appends extra even when it's an empty string (the default). This adds an unnecessary empty element to the command list. Additionally, if extra contains multiple space-separated arguments, appending it as a single string means it will be treated as one argument when the list is joined.

Apply this diff to fix both issues:

-cmd.append(f"{extra}")
+if extra:
+    import shlex
+    cmd.extend(shlex.split(extra))

This ensures:

  • Empty extra is not appended
  • Multiple arguments in extra are properly split and added as separate list elements
🤖 Prompt for AI Agents
In bio/alignoth/wrapper.py around line 35, the code unconditionally appends the
extra string which can add an empty element or treat multiple space-separated
args as one; change it so that you only add extra when non-empty and split it
into separate arguments (use shlex.split or equivalent) and extend the cmd list
with the resulting tokens instead of appending the raw string.


# HTML output
if output.endswith(".html"):
cmd.append("--html")
shell(f"{' '.join(cmd)} > {output} {log}")
# Default: JSON output to single file via stdout
elif output.endswith(".json"):
shell(f"{' '.join(cmd)} > {output} {log}")
# Assume output is directory
else:
cmd.append(f"-o {output}")
shell(f"{' '.join(cmd)} {log}")
7 changes: 7 additions & 0 deletions test_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ def test_agat(run):
)


def test_alignoth(run):
run(
"bio/alignoth",
["snakemake", "--cores", "1", "--use-conda", "-F", "out/json_plot.vl.json", "out/plot.html", "output-dir/"],
)


def test_miller(run):
run(
"utils/miller",
Expand Down
Loading