macでインフォマティクス

macでインフォマティクス

HTS (NGS) 関連のインフォマティクス情報についてまとめています。

軽量かつインタラクティブなアライメントの視覚化を行う Alignoth

 

Alignothは、DNAシーケンシングリードアライメントパイルアップの自己完結型でポータブルなHTMLレポートを生成する軽量コマンドラインアプリケーションである。PNGSVG、PDFなどの静的フォーマットやJSONベースの埋め込み可能な形式へのエクスポートもサポートしている。HTMLレポートはリード名検索機能とマッピング品質に基づくリードのハイライト表示機能を備え、最小限のストレージしか必要としないため、共有、検証、あるいはより広範なレポートシステムへの統合が容易になっている。ヘッドレス(つまりターミナルのみ)環境で作成でき、作成後にインタラクティブに検証することもできる。Alignothは、MITライセンスに基づき、https://github.com/alignoth/alignoth (doi: https://doi.org/10.5281/zenodo.15837719) から無料で入手できる。Rustで実装されており、CargoまたはConda経由でインストールできる。

 

レポジトリより

alignothはbam ファイルからアライメントプロットを作成するツールです。生成された vega-lite プロットはデフォルトで標準出力に書き出されます。生成されたプロットの例は  https://alignoth.github.io/preview.htmlで閲覧できます。alignoth という名前は、視覚化されたalignmentsと星座のスター alioth(vega プロットの使用法)を組み合わせたことに由来します。

インストール

Github

#conda
mamba create -n Alignoth -y
conda activate Alignoth
mamba install alignoth -c conda-forge -c bioconda -c nodefaults -y


#cargo
cargo install alignoth

#Pixi
pixi global install alignoth

> alignoth --help

$ alignoth --help

alignoth 1.4.1

A tool to create alignment plots from bam files.

 

USAGE:

    alignoth [FLAGS] [OPTIONS]

 

FLAGS:

        --help           Prints help information

        --html           If present, the generated plot will inserted into a plain html file containing the plot

                         centered which is then written to stdout

        --no-embed-js    If present, the generated html will not embed javscript dependencies and therefore be

                         considerably smaller but require internet access to load the dependencies

        --plot-all       A short command to plot the whole bam file. We advise to only use this command for small bam

                         files

    -V, --version        Prints version information

 

OPTIONS:

    -a, --around <around>

            Chromosome and single base for the visualization. The plotted region will start 500bp before and end 500bp

            after the given base. Example: 2:20000

        --around-vcf-record <around-vcf-record>

            Plots a region around a specified VCF record taken via its index from the VCF file given via the --vcf

            option

    -x, --aux-tag <aux-tag>...

            Displays the given content of the aux tags in the tooltip of the plot. Multiple usage for more than one tag

            is possible

    -b, --bam-path <bam-path>                                            BAM file to be visualized

        --bed <bed>

            Path to a BED file that will be used to highlight all BED records overlapping the given region

 

        --coverage-output <coverage-output>

            If present coverage data will be written to the given file path

 

    -f, --data-format <data-format>

            Set the data format of the read, reference and highlight data [default: json]

 

    -h, --highlight <highlight>...

            Interval or single base position that will be highlighted in the visualization. Example: 132440-132450 or

            132440

        --highlight-data-output <highlight-data-output>

            If present highlight data will be written to the given file path

 

    -d, --max-read-depth <max-read-depth>

            Set the maximum rows of reads that will be shown in the alignment plots [default: 500]

 

    -w, --max-width <max-width>

            Sets the maximum width of the resulting plot [default: 1024]

 

        --mismatch-display-min-percent <mismatch-display-min-percent>

            The minimum percentage of mismatches compared to total read depth at that point to display in the coverage

            plot [default: 1.0]

    -o, --output <output>

            If present, data and vega-lite specs of the generated plot will be split and written to the given directory

 

        --read-data-output <read-data-output>

            If present read data will be written to the given file path

 

        --ref-data-output <ref-data-output>

            If present reference data will be written to the given file path

 

    -r, --reference <reference>                                          Path to the reference fasta file

    -g, --region <region>

            Chromosome and region for the visualization. Example: 2:132424-132924

 

        --spec-output <spec-output>

            If present vega-lite specs will be written to the given file path

 

    -v, --vcf <vcf>

            Path to a VCF file that will be used to highlight all variant position located within the given region

 

 

実行方法

bamとリファレンスfasta、可視化対象の染色体と領域を指定する。

alignoth -b input.bam -r reference.fa -g chr1:200-300 --html > plot.html

出力例

 

マウスホイールで拡大・縮小できる。またクリックしてドラッグすると水平方向にスクロールできる。


リードをクリックするとハイライト表示されリードの詳細がポップアップ表示される。


Shiftキーを押しながら複数選択すると他のすべてのリードの不透明度が下がり、選択したリードがより見やすくなる。特にリードメイトが重なっている場合に役立つ(helpより)。

上の表にはそのリードのSAMフラグ情報も表示される。

alignothだけ叩くと対話式に実行できる。

入力ファイルの選択、関心のある領域の定義、対話型 HTML 出力または Vega-Lite 仕様を選択していく。

 

論文より

  • アラインメントされたリード(パイルアップ)の目視による検査は、様々な種類のDNAまたはRNAシーケンシング解析において重要な役割を持っている(Corominas et al. 2022)。これらのプロットを作成するために、様々なアラインメントビューアが開発されているが、不十分な点が多くある。IGVなどのグラフィカルデスクトップアプリケーションは強力だが、自動化にはほとんど適していない。対照的に、samtools tviewなどのコマンドラインツールは自動化できるものの、静的またはテキストベースのビューしか提供せず、インタラクティブ性も限られている。さらに、Webベースのツールは通常、サーバー側のコンポーネントに依存しており、プライバシーが重視される環境や制限された環境ではユーザビリティが制限される。

  • Alignoth は、上記のすべてのアプローチの個々の長所を統合し、それに伴う欠点を生じさせないことを目的として開発された。Alignoth は、再現可能な実行と自動化のためのコマンドラインインターフェースを提供しながら、 Snakemakeや Nextflowワークフローと連携し、専用のソフトウェアをインストールしなくても表示、探索、共有できる、高度にインタラクティブな Web ブラウザー ベースのパイルアップ プロットを生成する。

引用

Alignoth: portable and interactive visualization of read alignments

Felix Wiegand , Felix Mölder , Johannes Köster

Bioinformatics, Volume 42, Issue 1, January 2026

 

関連