macでインフォマティクス

macでインフォマティクス

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

メタゲノムアセンブリの高精度なbin refinementツール Binette

2024/04/24 誤字修正

 

 メタゲノム解析は、ショットガンシーケンスによる微生物群集とその個々のメンバーの研究を可能にする。メタゲノム解析に不可欠な段階は、メタゲノムアセンブリゲノム(MAG)の回収である。メタゲノム解析では、シーケンスリードをコンティグにアセンブルし、それを共通の特徴に基づいてビンにグループ化し、MAGを生成する。メタゲノムデータセットからより多くの、より質の高いMAGを得るための有用なアプローチは、複数のビニング法を適用し、それらをbin refinementと呼ばれるプロセスで組み合わせることである。本著者らは、metaWRAPのbin refinementモジュールにインスパイアされたbin refinementツールであるBinetteを紹介する。Binetteは、入力されたビンアセンブリから基本的な集合演算を用いて新しいハイブリッドビンを作成することでこれを実現する。その後、CheckM2を用いてビンの品質を評価し、可能な限り最良のビンを選択する。

 

レポジトリより

Binetteは、複数のビニングツールの出力から高品質のMAGを構築する、高速かつ高精度なビニング精密化ツールである。入力ビンセットから、Binetteは新しいハイブリッドビンを構築する。ビンはコンティグの集合と見なすことができる。少なくとも2つのビンがオーバーラップしている場合、つまり少なくとも1つのコンティグを共有している場合、Binetteは基本的なセット操作を利用して新しいビンを作成する。

  • 交差ビン: オーバーラップしているビンで共有されているコンティグから構成される。
  • 差分ビン: あるビンにのみ存在し、他のビンには存在しないコンティグを含む。
  • Unionビン: ユニオンビンには、オーバーラップしているビンに含まれるすべてのコンティグが含まれる。

その後、CheckM2を用いてビンの品質を評価し、最終的に最良のビン配列を選択する。BinetteはmetaWRAP bin-refinementツールからインスパイアされているが、そのツールの問題点をすべて効果的に解決している。

  • スピードの向上: Binetteは洗練プロセスのスピードを大幅に向上させた。Binetteは、CheckM2の最初のステップであるProdigalやDiamondの実行を、全てのコンティグに対して一度だけ実行することにより、これを実現している。これらの中間結果は、任意のビンの品質を評価するために利用され、冗長な計算を排除し、精密化プロセスを高速化する。
  • 入力ビンセットの制限なし: Binetteは、その前身とは異なり、入力ビンセットの数に制約を受けない。複数のビンセットを同時に処理することができます。

インストール

ubuntu20でテストした(way1の手順に従った)。

Github

#way1 conda environnement
git clone https://github.com/genotoul-bioinfo/Binette
cd Binette
mamba env create -n binette -f binette.yaml
conda activate binette
pip install .

#way2 conda(link)
mamba install -c conda-forge -c bioconda -c defaults binette -y
conda activate binette

#way3 PyPI(link)
pip install Binette
#他の依存
pip install pyfastx pyrodigal tqdm pandas checkm2

> binette -h

usage: binette [-h] (-d BIN_DIRS [BIN_DIRS ...] | -b CONTIG2BIN_TABLES [CONTIG2BIN_TABLES ...]) -c CONTIGS [-m MIN_COMPLETENESS] [-t THREADS] [-o OUTDIR] [-w CONTAMINATION_WEIGHT] [--checkm2_db CHECKM2_DB] [--low_mem] [-v] [--debug] [--resume]

               [--version]

 

Binette version=1.0.0

 

optional arguments:

  -h, --help            show this help message and exit

 

Input Arguments:

  -d BIN_DIRS [BIN_DIRS ...], --bin_dirs BIN_DIRS [BIN_DIRS ...]

                        List of bin folders containing each bin in a fasta file. (default: None)

  -b CONTIG2BIN_TABLES [CONTIG2BIN_TABLES ...], --contig2bin_tables CONTIG2BIN_TABLES [CONTIG2BIN_TABLES ...]

                        List of contig2bin table with two columns separated with a tabulation: contig, bin (default: None)

  -c CONTIGS, --contigs CONTIGS

                        Contigs in fasta format. (default: None)

 

Other Arguments:

  -m MIN_COMPLETENESS, --min_completeness MIN_COMPLETENESS

                        Minimum completeness required for final bin selections. (default: 40)

  -t THREADS, --threads THREADS

                        Number of threads to use. (default: 1)

  -o OUTDIR, --outdir OUTDIR

                        Output directory. (default: results)

  -w CONTAMINATION_WEIGHT, --contamination_weight CONTAMINATION_WEIGHT

                        Bin are scored as follow: completeness - weight * contamination. A low contamination_weight favor complete bins over low contaminated bins. (default: 2)

  --checkm2_db CHECKM2_DB

                        Provide a path for the CheckM2 diamond database. By default the database set via <checkm2 database> is used. (default: None)

  --low_mem             Use low mem mode when running diamond (default: False)

  -v, --verbose         increase output verbosity (default: False)

  --debug               Activate debug mode (default: False)

  --resume              Activate resume mode. Binette will examine the 'temporary_files' directory within the output directory and reuse any existing files if possible. (default: False)

  --version             show program's version number and exit

 

 

データベース

checkM2のデータベースが必要

checkm2 database --download --path <checkm2/database/>

 

実行方法

Binetteは2種類のbin情報入力フォーマットをサポートしている。

A - Contig2binテーブル:各コンティグと対応するbinの関係を確立するcontig2binテーブルを使ってbinセットを提供する。このフォーマットは”--contig2bin_tables”オプションを使って指定する。

(レポジトリより転載)

ランするには、binのTSVファイルとメタゲノムアセンブリfastaを指定する。

binette --contig2bin_tables bin_set1.tsv bin_set2.tsv -c assembly.fasta -t 20 -o outdir
  • -b, --contig2bin_tables   List of contig2bin table with two columns separated with a tabulation: contig, bin (default: None)
  • -c    Contigs in fasta format. (default: None)
  • -t     Number of threads to use. (default: 1)
  • -o    Output directory. (default: results) 

 

B - binディレクトリの指定: 各binが別々のFASTAファイルで保存されている場合。このフォーマットでは、-bin_dirs引数を指定する。

ランするには、binディレクトリとメタゲノムアセンブリfastaを指定する。

binette --bin_dirs bin_set1/ bin_set2/ --contigs assembly.fasta -t 20 -o outdir
  • -d, --bin_dirs     List of bin folders containing each bin in a fasta file. (default: None)

出力例

outdir/

final_bins/

選択されたすべてのビンがfasta形式で格納されている。

final_quality_reports.tsv

フォーマットについてはレポジトリで説明されています。

 

その他(論文とレポジトリより)

  • 出力のtemporary_filesディレクトリには中間ファイルが格納される。--resumeオプションを選択すると、temporary_filesを利用して迅速に結果を出力できる(パラメータ変更時など)。
  • CAMI IIチャレンジの準備のためにリリースされた模擬マウス腸内メタゲノムデータを使用してビニング性能が評価されている。DAS ToolとBinetteはいずれも平均ビンの完全性と純度の統計量両方において同等かつ優れた結果を示したが、Binetteは高品質ゲノムの回収においてDAS Toolをより上回っていた。

引用

Binette: a fast and accurate bin refinement tool to construct high quality Metagenome Assembled Genomes.

Jean Mainguy,  Claire Hoede

bioRxiv, Posted April 22, 2024.

 

関連

機械学習を用いた微生物ゲノム品質の迅速で正確かつスケール可能な評価ツール CheckM2 

複数のbiningツールを統合し、包括的なメタゲノム解析を行うパイプライン metaWRAP

メタゲノムのbinner評価ツール AMBER