macでインフォマティクス

macでインフォマティクス

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

バクテリアのプラスミド自動アセンブリツール Plassembler

 

 近年のシーケンシング技術の進歩により、ロングリードファーストアセンブリアプローチとショートリードポリッシングを組み合わせることで、ほぼ完全な細菌染色体アセンブリを安価かつ効率的に得ることが可能になった。しかしながら、long-read-first assembliesから細菌プラスミドをアセンブリする既存の方法では、しばしば細菌のプラスミドをミスアセンブルしたり、あるいは完全に見落としたりすることがあり、そのため手作業によるキュレーションが必要である。Plassemblerは、ハイブリッドアセンブリアプローチを用いて細菌プラスミドを自動的にアセンブルし、出力するツールを提供するために開発された。既存のゴールドスタンダードツールUnicyclerと比較して、マッピングアプローチにより入力リードセットから染色体リードを除去することで、精度と計算効率の向上を実現している。
PlassemblerはPythonで実装されており、biocondaパッケージとして'conda install -c bioconda plassembler'でインストールできる。ソースコードGitHubhttps://github.com/gbouras13/plassemblerにある。完全なベンチマークパイプラインはhttps://github.com/gbouras13/plassembler_simulation_benchmarkingベンチマークの入力FASTQと出力ファイルはhttps://doi.org/10.5281/zenodo.7996690で利用できる。

 

Documentation

https://plassembler.readthedocs.io/en/latest/

Method

https://github.com/gbouras13/plassembler#method

 

レポジトリより

  • なぜPlassemblerは存在するの?
    ロングリードでアセンブルされたバクテリアゲノムにおいて、小さなプラスミドはロングリードアセンブラで正しくアセンブルするのが難しい。JohnsonらによるMicrobial Genomics誌の最近の論文も、ロングリード・アセンブラが特に小さなプラスミドを見逃すことを示唆している。そこでPlassemblerは、Unicyclerのようなハイスループット用途で、プラスミドが重複領域なしで正しくアセンブルされていることを確認するための高速自動化ツールとして作られた。
  • Plassemblerは既存のゴールドスタンダードツールUnicyclerよりも小さなプラスミドを多く回収する。これはchromosomeのリードは捨てるからだと考えられるが、ショートリードセットをサブサンプリングして回収率を向上させるのと似ている。リードセット全体に占めるプラスミドリードの割合が多いため、より小さなプラスミドを回収できる可能性が高いようである。この精度とスピードの向上は、シミュレーションと実データセットベンチマーク結果で確認できる。
    Plassemblerはまた、アセンブルされた各コンティグがPLSDBに類似のヒットがあるかどうかを判定する迅速な方法としてmashを使用している。
  • Plassemblerはそのマッピングアプローチにより、ロングリードセットとショートリードセットが同じ単離株から得られたものであるかどうかをチェックする品質管理ツールとしても使用できる。これは、リードセットが異なる抽出物から得られている場合や、多くのサンプルをマルチプレックスしている場合(ミスラベルを避けたい場合)に特に有用である。

 

インストール

condaで環境を作って導入した。レポジトリでは、M1 macでも工夫すればインストール可能なことが説明されている。

依存

  • Flye >=2.9
  • Unicycler >=0.4.8
  • Minimap2 >=2.11
  • fastp >=0.18.0
  • chopper >=0.5.0
  • mash >=2.2
  • Raven >=1.8
  • Samtools >=0.15.0

Github

#conda
mamba create -n plassembler -y
conda activate plassembler
mamba install -c bioconda plassembler -y
#condaで導入するとmashだけ共有ライブラリのエラーが出たので、static binaryをここからダウンロードして置き換えた。
cp mash $(which mash)

#pip(依存は別に導入する必要がある)
pip install plassembler

> plassembler -h

Usage: plassembler [OPTIONS] COMMAND [ARGS]...

 

Options:

  -h, --help     Show this message and exit.

  -V, --version  Show the version and exit.

 

Commands:

  assembled  Runs assembled mode

  citation   Print the citation(s) for this tool

  download   Downloads Plassembler DB

  long       Plassembler with long reads only - experimental and untested

  run        Runs Plassembler

>  plassembler assembled -h

Usage: plassembler assembled [OPTIONS]

 

  Runs assembled mode

 

Options:

  -h, --help                Show this message and exit.

  -V, --version             Show the version and exit.

  -d, --database PATH       Directory of PLSDB database.  [required]

  -l, --longreads PATH      FASTQ file of long reads.

  -1, --short_one PATH      R1 short read FASTQ file.

  -2, --short_two PATH      R2 short read FASTQ file.

  -c, --chromosome INTEGER  Approximate lower-bound chromosome length of

                            bacteria (in base pairs).  [default: 1000000]

  -o, --outdir PATH         Directory to write the output to.  [default:

                            plassembler.output/]

  -m, --min_length TEXT     minimum length for filtering long reads with

                            chopper.  [default: 500]

  -q, --min_quality TEXT    minimum quality q-score for filtering long reads

                            with chopper.  [default: 9]

  -t, --threads TEXT        Number of threads.  [default: 1]

  -f, --force               Force overwrites the output directory.

  -p, --prefix TEXT         Prefix for output files. This is not required.

                            [default: plassembler]

  --skip_qc                 Skips qc (chopper and fastp).

  --pacbio_model TEXT       Pacbio model for Flye.  Must be one of pacbio-raw,

                            pacbio-corr or pacbio-hifi.  Use pacbio-raw for

                            PacBio regular CLR reads (<20 percent error),

                            pacbio-corr for PacBio reads that were corrected

                            with other methods (<3 percent error) or pacbio-

                            hifi for PacBio HiFi reads (<1 percent error).

  --input_chromosome TEXT   Input FASTA file consisting of already assembled

                            chromosome with assembled mode.  Must be 1

                            complete contig.

  --input_plasmids TEXT     Input FASTA file consisting of already assembled

                            plasmids with assembled mode.  Requires FASTQ file

                            input (short only, long only or long + short).

 

> plassembler long -h

$ plassembler long -h

Usage: plassembler long [OPTIONS]

 

  Plassembler with long reads only - experimental and untested

 

Options:

  -h, --help                Show this message and exit.

  -V, --version             Show the version and exit.

  -d, --database PATH       Directory of PLSDB database.  [required]

  -l, --longreads PATH      FASTQ file of long reads.  [required]

  -c, --chromosome INTEGER  Approximate lower-bound chromosome length of

                            bacteria (in base pairs).  [default: 1000000]

  -o, --outdir PATH         Directory to write the output to.  [default:

                            plassembler.output/]

  -m, --min_length TEXT     minimum length for filtering long reads with

                            chopper.  [default: 500]

  -q, --min_quality TEXT    minimum quality q-score for filtering long reads

                            with chopper.  [default: 15]

  -t, --threads TEXT        Number of threads.  [default: 1]

  -f, --force               Force overwrites the output directory.

  -p, --prefix TEXT         Prefix for output files. This is not required.

                            [default: plassembler]

  --skip_qc                 Skips qc (chopper and fastp).

  --pacbio_model TEXT       Pacbio model for Flye.  Must be one of pacbio-raw,

                            pacbio-corr or pacbio-hifi.  Use pacbio-raw for

                            PacBio regular CLR reads (<20 percent error),

                            pacbio-corr for PacBio reads that were corrected

                            with other methods (<3 percent error) or pacbio-

                            hifi for PacBio HiFi reads (<1 percent error).

  -r, --raw_flag            Use --nano-raw for Flye.  Designed for Guppy fast

                            configuration reads.  By default, Flye will assume

                            SUP or HAC reads and use --nano-hq.

  --keep_chromosome         If you want to keep the chromosome assembly.

  --use_raven               Uses Raven instead of Flye for long read assembly.

                            May be useful if you want to reduce runtime.

 

 

> plassembler run -h

Usage: plassembler run [OPTIONS]

 

  Runs Plassembler

 

Options:

  -h, --help                Show this message and exit.

  -V, --version             Show the version and exit.

  -d, --database PATH       Directory of PLSDB database.  [required]

  -l, --longreads PATH      FASTQ file of long reads.  [required]

  -1, --short_one PATH      R1 short read FASTQ file.  [required]

  -2, --short_two PATH      R2 short read FASTQ file.  [required]

  -c, --chromosome INTEGER  Approximate lower-bound chromosome length of

                            bacteria (in base pairs).  [default: 1000000]

  -o, --outdir PATH         Directory to write the output to.  [default:

                            plassembler.output/]

  -m, --min_length TEXT     minimum length for filtering long reads with

                            chopper.  [default: 500]

  -q, --min_quality TEXT    minimum quality q-score for filtering long reads

                            with chopper.  [default: 9]

  -t, --threads TEXT        Number of threads.  [default: 1]

  -f, --force               Force overwrites the output directory.

  -p, --prefix TEXT         Prefix for output files. This is not required.

                            [default: plassembler]

  --skip_qc                 Skips qc (chopper and fastp).

  --pacbio_model TEXT       Pacbio model for Flye.  Must be one of pacbio-raw,

                            pacbio-corr or pacbio-hifi.  Use pacbio-raw for

                            PacBio regular CLR reads (<20 percent error),

                            pacbio-corr for PacBio reads that were corrected

                            with other methods (<3 percent error) or pacbio-

                            hifi for PacBio HiFi reads (<1 percent error).

  -r, --raw_flag            Use --nano-raw for Flye.  Designed for Guppy fast

                            configuration reads.  By default, Flye will assume

                            SUP or HAC reads and use --nano-hq.

  --keep_fastqs             Whether you want to keep FASTQ files containing

                            putative plasmid reads  and long reads that map to

                            multiple contigs (plasmid and chromosome).

  --keep_chromosome         If you want to keep the chromosome assembly.

  --use_raven               Uses Raven instead of Flye for long read assembly.

                            May be useful if you want to reduce runtime.

 

 

> plassembler download -h

$ plassembler download -h

Usage: plassembler download [OPTIONS]

 

  Downloads Plassembler DB

 

Options:

  -h, --help           Show this message and exit.

  -V, --version        Show the version and exit.

  -d, --database PATH  Directory where database will be stored.  [required]

  -f, --force          Force overwrites the database directory.

 

> plassembler citation

Please cite plassembler in your paper using:

 

Bouras, G., Sheppard A.E., Mallawaarachchi, V., Vreugde S. (2023)

Plassembler https://github.com/gbouras13/plassembler.

 

 

 

データベース

plassembler download -d databse_dir

databse_dirができる。

 

実行方法

plassembler run -d database_dir -l long_read.fq.gz -o outdir -1 R1.fq.gz -2 R2.fq.gz -c <estimated chromosome length> -t <threads> -p prefix
  • -c   default to 1000000 if it is absent.

ロングリードアセンブラとしてFlyeの代わりにRavenを使用するには"--use_raven"を使う。chopperによるフィルタリングで、ロングリードの最小長と最小のクオリティスコアを指定するには"-m <length>"と"-q <quality>"を使う。

 

出力例

 

なぜUnicyclerを使わないのか?(レポジトリより)

Unicyclerは素晴らしく、ハイブリッドシーケンスからプラスミドをアセンブルする良い方法である!しかし、代わりにplassemblerを使う理由がいくつかある:

  • 時間。plassemberはUnicyclerを実行する前にすべての染色体リード(つまりほとんどのリード)を捨てるので、はるかに速い(一般的に3~10倍速い)。
  • 精度。Plassemblerは、小さなプラスミドを回収するという点ではUnicyclerよりも優れていることがベンチマークで示されている。
  • Plassemblerは可能性の高いプラスミドだけを出力し、パイプラインにより簡単に組み込むことができる。
  • Plassemblerは、ロングリードとショートリードの両方について、デプスとコピー数の統計情報の要約を提供する。
  • Plassembler の結果で多くの非環状コンティグ(特に PLSDB でヒットしないコンティグ)が得られた場合、それはリードセットが同じ単離株から得られていない可能性がある。Quality Controlを参照。
  • アセンブルされた各コンティグがPLSDBに同様のエントリーがあるかどうかの情報が得られる。特にデータベースによく登録されている一般的な病原体種については、サンプルにどのプラスミドが含まれているかが具体的にわかる可能性が高い。
    注:特に、あまり一般的に配列決定されていない生物種では、PLSDBにヒットしなくてもあまり意味のあることではない。特にヒットしない環状のコンティグが得られた場合、PLSDBには無い新規プラスミドである可能性が高いだろう。

その他

  • plassemblerはUnicycler v0.5.0で最適に動作する。Unicycler v0.4.8でもplassemblerは問題なく実行でき、満足のいくアセンブリを提供するはずだが、plassemblerを実行するときに警告が表示される。plassemblerはUnicyclerの古いバージョンでは動作しない。
  • メタゲノムデータセットでの使用は推奨されていない(Unicyclerはメタゲノムには推奨されない)。しかし、plassemblerはモックコミュニティデータセットでテストされ5つの既知のプラスミドを回収し、非常にうまく機能している。もし試してうまくいったら連絡をください(著者らに)。

引用

Plassembler: an automated bacterial plasmid assembly tool 
George Bouras,  Anna E Sheppard,  Vijini Mallawaarachchi,  Sarah Vreugde
Bioinformatics, Published: 27 June 2023

 

関連