macでインフォマティクス

macでインフォマティクス

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

複数のリファレンスを使い精度を上げたReference-assisted assembly Multi-CAR

 

リファレンスを足場として使い、コンティグからドラフトゲノムを構築するツールがいくつか提案されているが、ターゲットと参照するゲノムとの間に再編成が起きていたり、系統関係が遠いと誤ったスキャッホールドを生成する可能性がある。これは、単一のリファレンスがドラフトゲノムの構築に十分ではないことを示唆している。Multi-CARは、単一のリファレンスを使用するCARを改良し、複数の完全なゲノムを使用してコンティグをより正確に並べ換える方法論。論文中では、複数のリファレンスを使うRagoutおよびMeDuSaと原核生物のデータを使った比較を行い、感度、精度、ゲノムカバレッジ、スキャフォールド数、N50でより優れていることを示している。初代のCARと同じくwebサーバー版が提供されている。

  

CAR


 exampleデータでランする。

f:id:kazumaxneo:20180205234207j:plain

  

Dot plot

f:id:kazumaxneo:20180205234614j:plain

アセンブル結果もダウンロードできます。

 

Ragoutは以前紹介しています。

http://kazumaxneo.hatenablog.com/entry/2017/06/28/001308

 

引用

Multi-CAR: a tool of contig scaffolding using multiple references.

Chen KT, Chen CJ, Shen HT, Liu CL, Huang SH, Lu CL.

BMC Bioinformatics. 2016 Dec 23;17(Suppl 17):469.

 

原核生物のReference-assisted assembly CAR

 

CARは、近縁な生物のゲノムに基づいて、原核生物のゲノムのコンティグを精度よく並べ換えるアセンブリツール。論文中では、様々なリアルデータのコンティグと系統学的に近縁さが異なる20のゲノムを使い、正解と謝りの割合を調べており、競合ツールよりパフォーマンスが高いことが示されている。ツールとしてwebサーバー版が提供されている。

  

 

右上のウィンドウからexampleデータを選択してランできる。

f:id:kazumaxneo:20180205225957j:plain

 

exampleデータの結果はhelpからもリンクしている。結果を開く。

f:id:kazumaxneo:20180205231550j:plain

 

CAR resultのAssembly of draft chromosomeを開く。contigの並べ替え結果が表示されている。

f:id:kazumaxneo:20180205231640j:plain

 

 

Dot plot                                          <-- Before                        After-->

f:id:kazumaxneo:20180205231835j:plain

 

 

引用

CAR: contig assembly of prokaryotic draft genomes using rearrangements

Chin Lung Lu,corresponding author Kun-Tze Chen, Shih-Yuan Huang, and Hsien-Tai Chiucorresponding author

BMC Bioinformatics. 2014; 15(1): 381.

 

GC-skewと複数アセンブルデータを使ってバクテリアのゲノムアセンブリを改善するGUIツール GFinisher

 

GFinisherはゲノムのアセンブルで得たコンティグを、似たゲノムの情報と他のアセンブルツールのコンティグ情報を使い、contiguityを改善するツール。始めに似たゲノムにコンティグを貼り付け、他のコンティグ情報も使いターゲットのコンティグを並べ替える。それからGC-skew情報を使い、GC-skewが不自然なジャンプを起こす臨界点でコンティグを切断し、並べ替えるというステップで動作する(論文図1)。この各ステップごとに、出力ファイルが生成され、レポート、コンティグシーケンス、GCスキューグラフィックス、アセンブリ比較用のドットプロットグラフィックス、GCスキュークリティカルポイントリスト、QUAST実行スクリプトが生成される。GAGE-Bのデータセットを使った実験で、コンティグの平均数が172.9から23.5に大きく減ったことを示している。

 

 

公式ページ

GFinisher

マニュアル

http://gfinisher.sourceforge.net/manual.php

 

インストール

依存

  • blast+

実行形式のjavaのバイナリがダウンロードできる。

SorceForge

https://sourceforge.net/projects/gfinisher/

https://sourceforge.net/projects/gfinisher/

#bioconda (link)
conda install -c bioconda -y gfinisher

 

 

実行方法

3つのモードと、それを全て走らすcompleteモードがある。

  • Misassemblies detection - points of maximum and minimum in Fuzzy GC Skew curve are used to identify probable spurious assemblies.
  • jContigSort - ordering contig base and reference genome.
  • jFGap - combine alternatives assemblies to close gap.

 

completeモードを走らせる。マニュアルに従い、GAGEのBacteroides fragilis のテストデータをダウンロードする。

アセンブルデータ GAGE-B

リファレンス Here

起動。

java -Xms2G -Xmx4G -jar GenomeFinisher.jar

 

OLCのMaSuRCAでアセンブルしたスキャッホールドを、de brujib graphのアセンブルツール5つの結果で伸ばすことを試みる。GUIのwindowが出てくるので、まずblastのパスを指定する。自分の場合はbrewでblastを入れており、/usr/local/binにはblastnとmakeblastdbのシンボリックリンクしかないので、blastのフルパスは以下のようになる。

f:id:kazumaxneo:20180203152209j:plain

 

ダウンロードしたscaffoldsとcontig、リファレンスと出力パスを指定する。

f:id:kazumaxneo:20180203152212j:plain

 

左上のランボタンを押すと解析が始まる。終わるまで10分以上かかる。

f:id:kazumaxneo:20180203152612j:plain

./out/なら、カレントディレクトリのout/に結果のFASTAファイルなどが出力される。

f:id:kazumaxneo:20180203152731j:plain

 

out/verbose/にもいくつかレポートが出力される。

下は6回サイクル後のdot plotとGC skewのレポート。

f:id:kazumaxneo:20180203152959p:plain

 

f:id:kazumaxneo:20180203153026p:plain

 

f:id:kazumaxneo:20180204151809p:plain

 

 

 

QUESTwebサーバー(http://quast.bioinf.spbau.ru)でも確認してみる。

 左端の破線がリファレンス、その右の黒がGFinisherで改善されたcontigとなる。他のアセンブルツールよりcontiguityが良くなっている。

f:id:kazumaxneo:20180203154057j:plain

この領域付近はよく繋がっている(一番下がGFinisher出力)

f:id:kazumaxneo:20180203154053j:plain

 

近縁なリファレンスがなければリファレンスなしで実行することもできますが、その場合は大きく精度が低下するようです。また、そっくりなリファレンスがあっても結果は必ずしも正しいわけでなく、ゲノムによってはキメラのドラフトゲノムを作ってしまう可能性があります。他の手法でクオリティコントロールを行うなどして、注意して使ってください。

 

引用

GFinisher: a new strategy to refine and finish bacterial genome assemblies.

Guizelini D, Raittz RT, Cruz LM, Souza EM, Steffens MB, Pedrosa FO.

Sci Rep. 2016 Oct 10;6:34963.

ロングリードやcontig情報を使いスキャッホールドのギャップを埋める GMcloser

2019 9/4 インストール追記

 

NGSのリードやアセンブルしたコンティグを使い、スキャッホールドのギャップを埋めるツールがいくつか発表されているが、オーサーらは、これらのツールに起因するアセンブリのエラー率が、デノボアセンブルで起こるエラー率よりも20〜500倍高いことを指摘している。それをmotive forceとして、オーサーらは、アセンブルしたコンティグxまたはエラー修正されたPacBioのロングリードでこれらのギャップを正確に閉じるGMcloserを開発した。GMcloserはスキャッホールド、コンティグ、ペアエンドリードのアライメント統計から計算した尤度ベースの分類子を使用して、ギャップにコンティグやロングリードを正しく割り当て、正確かつ効率的なギャップクローズを行う。比較実験の結果から、GMcloserは他の利用可能なツールと同様の効率かつ3〜100倍精度が高いと主張されている。

 

 

テストデータ

https://sourceforge.net/projects/gmcloser/files/?source=navbar

 

インストール

依存

  • Perl 5.6 or later
  • MUMmer 3.23(MUMmer 3.22 is not allowed)
  • blast+ 2.2.18 or later
  • Bowtie 2 (tested on ver. 2.1.0)
  • YASS (yass) (tested on ver. 1.14)

YASSは下記リンクからバイナリをダウンロードできる。

YASS : genomic similarity search tool

名前はyassに修正して、パスの通ったディレクトリに移動しておく。他のツールも、bowtie2nucmerblastn、で$PATHに定義されている必要がある。

 本体 SourceForge

#bioconda (link)
conda install gmcloser -c bioconda -y

> gmcloser -h

$ gmcloser -h

Usage:

      GMcloser ver. 1.5

  

      Options:

       --target_scaf or -t <STR>       input target scaffold fasta file (e.g., scaf.fa) [mandatory]

       --query_seq or -q <STR>         input query contig (or long-read) fasta file (e.g., contig.fa) (if long reads are used, -lr option must be specified) [mandatory]

       --prefix_out or -p <STR>        prefix name of output files [mandatory]

   

       --read_file or -r <STR>         space-separated list of fastq or fasta files (or gzip compressed files) of paired-end reads (e.g., -r read_pe1.fq read_pe2.fq)

       --read_len or -l <INT>          read length of paired-end reads specified with the -r, -st, -sq, or -sd option (mean read length if read lengths are variable) [mandatory]

       --insert or -i <INT>            average insert size of paired-end reads [>read_len <20001, default: 400]

       --sd_insert or -d <INT>         standard deviation of insert size of paired-end reads [default: 40]

       --read_format or -f <STR>       fastq or fasta [default: fastq]

       --sam_talign or -st <STR>       space-separated list of sam alignment file(s) for target scaffolds, created in a single-end read alignment mode for paired-end reads (e.g., -sa tPE1.sam tPE2.sam, for paired-end read files PE1.fq and PE2.fq)

       --sam_qalign or -sq <STR>       space-separated list of sam alignment file(s) for query contigs, created in a single-end read alignment mode for paired-end reads (e.g., -sa qPE1.sam qPE2.sam, for paired-end read files PE1.fq and PE2.fq)

       --sam_dir or -sd <STR>          path of directory (i.e., bowtie_align) containing sam alignment files generated from a previous job with GMcloser (this can be used in place of -st and -sq option)

       --align_file or -a <STR>        Nucmer alignment file for query against target [optional]

 

       --connect_subcon or -c          connect between gap-encompassing subcontig pairs with their original (not merged with query contigs) termini [default: false]

       --extend or -et                 extend scaffold temini with aligned query sequences [default: false] (When using long read query, this option is disabled in the current version)

       --blast or -b                   conduct alignment between target and query contigs with BLASTn [default: false] (Nucmer alignment by default)

   

       --min_match_len or -mm <INT>    minimum overlap length to be filtered for Nucmer alignments.

                                       Contig-alignments that satisfy both the values specified with -mm and -mi are selected, irrespective of any mapping rates of PE-reads. [>49, default: 300]

       --min_identity or -mi <INT>     minimum overlap identity (%) to be filtered for Nucmer alignments. Alignments are selected by combination with -mm option. [95~100, default: 99]

       --min_len_local or -ml <INT>    minimum overlap length for merging between neighbor subcontigs with YASS aligner [>14, default: 20]

       --min_subcon or -ms <INT>       minimum length of subcontigs, to be used for gapclosing [default: 100]

       --min_gap_size or -g <INT>      minimum length of gap, when spliting the target scaffold sequences into subcontigs  [>0, default: 1]

       --max_indel or -is <INT>        maximum length of indel, observed in alignments between target subcontigs and query contigs. The alignments separated by the indel will be merged. [default: 70]

       --max_qsc or -qsc <INT>         maximum alignment coverage (%) of query singletones for target subcontigs (query with >= INT is excluded from query singletone output) [default: 60]

       --base_qual or -bq <STR>        base call quality format of fastq read file; illumina (phred64) or sanger (phred33) [default: auto]

       --nuc_len or -nl <INT>          nucmer exact match length, a value specified with '-l' option of the Nucmer aligner [default: auto, increased from 30 to 50 depending on the total contig length]

       --ad_score or -as <FLOAT>       score to add to (subtract from) the standard threshold score for selection of correct contig-subcontig alignments (e.g., 1 or -1) [default: 0]

       --hetero or -ht                 heterozygosity factor (specify this if your sequenced genome is heterozygous (>0.2% difference of the haploid size)) [default: false]

       --thread or -n <INT>            number of threads (for machines with multiple processors), enabling all the alignment processes in parallel [default: 5]

       --thread_connect or -nc <INT>   number of threads (for machines with multiple processors), enabling the subcontig-connection process in parallel [default: number specified with --thread]

       --help or -h                    output help message

   

       [Options for long read query]

       --long_read or -LR              query sequence file is a fasta file of long reads (PacBio reads must be error-corrected) [default: false] (alignment is peformed with blast)

       --lr_cov or -lc <INT>           fold coverage of long reads for target scaffolds [default: auto ; automatically calculated by dividing a total length of query by a total length of target]

       --min_qalign or -mq <INT>       minimum number of queries that are aligned to either 5'- or 3'-terminus of a target subcontig [default: 1]

       --iterate or -it <INT>          number of iteration [default: 3]

       --alignq or -aq <STR>           BLASTn alignment file for query against query [optional]

 

> gmvalue -h

$ gmvalue -h

Usage:

      GMvalue ver. 1.3

  

      Usage: gmvalue [contig|subcon|scaf] [options]

      (see the details of options for each command by e.g., gmval contig -h)

       contig     find misassemblies in contigs and/or output an error-free contig set where misassembled contigs are corrected

       subcon     find misassemblies in (sub)contigs that were split at gaps in scaffolds and/or output an error-free subcontig set

       scaf       find misassemblies (mislinks between contigs and misassemblies within contigs) in scaffilds and/or output an error-free scaffold set

 

 

ラン

上記リンクからテストデータをダウンロードし、テストランを行う。Rhodobacter sphaeroidesのデータとなる。NGSのリード、NNNありのscaffolds、アセンブルしたコンティグ、エラー補正したロングリードが収納されている。

gmcloser -t Sample_data/scaffolds.fasta -q Sample_data/contigs.fasta -r Sample_data/pe300-40x_1.fastq Sample_data/pe300-40x_2.fastq -l 100 -i 300 -d 40 -c -n 4 -p sample

scaffoldsやcontigについては、PDFマニュアルの22ページに記載されている。ランが終わると、ギャップがクローズされたスキャッホールドが出力される。

 

リファレンスゲノムと比較して、結果を評価する。

gmvalue subcon -r Sample_data/Rhodobacter.genome.fasta -q sample.gapclosed.fa 

終わるとout.misassemble.list.txtとout.stat.txtが出力される。

 

> cat out.stat.txt 

Number of contigs: 1545

Total number of misassembled contigs = 1 (0%)

Total number of truely assembled contigs = 1544 (99.9%)

Total number of misassembled events = 1

Number of unmapped contigs = 0 (0%)

 

Misassembly events on the same chromosome (break point distance > 100 bp, < 1000 bp): 0

Misassembly events (Relocation) on the same chromosome (break point distance >= 1000 bp): 0

Misassembly events (Translocation): 0

Misassembly events (Inversion): 0

Misassembly events (alignment coverage < 99%): 1

Medium indels (> 5 bp and <= 100 bp): 6

 

Total contig length: 4351438

Contig N50: 5546

Corrected contig N50: 5546

 

Total scaffold length: 4728132

Gap length: 376694 (7.9%)

> cat out.stat.txt 

$ cat /Users/user/Downloads/GMcloser-1.6.1/out.misassemble.list.txt 

scaffold18/20 1 5891 5993 CP000143 local-misassembly

 

ロングリードを使ったやり方はPDFマニュアルで確認してください。

 

引用

GMcloser: closing gaps in assemblies accurately with a likelihood-based selection of contig or long-read alignments.

Kosugi S1, Hirakawa H1, Tabata S1.

Bioinformatics. 2015 Dec 1;31(23):3733-41.

 

アセンブルのギャップクローズを支援する GapBlaster

 

 GapBlasterは、ゲノムのアセンブリで得られたコンティグを用いて、NNNで繋がったスキャフォールドのクローズを支援するjavaのツール。GUIで動作する。アセンブリで得られたコンティグをblast+/legacy blast/mummerの新井面ツールでスキャホールドにアライメントして、NNNの配列に一致するだろうcontigを絞り込んでいる。論文の表5には、GAGE-Bのデータセットを使って、 Abyss、ABySS2、AllPaths-LG、Bambus2、MSR-CA、SGA、SOAPdenovo、VelvetのNNNが解消された割合がまとめられている。

   

マニュアル

https://sourceforge.net/projects/gapblaster2015/files/?source=navbar

 

インストール

依存

  • mummer
  • blast+
  • legacy blast

ubuntuDebian)ならapt-getで導入できる。

sudo apt-get install blast2 
sudo apt-get install mummer
sudo apt-get install ncbi-blast+

本体はjavaの実行形式のバイナリで配布されている。

SourceForge

https://sourceforge.net/projects/gapblaster2015/

 

ラン

ターミナルでバイナリを実行すればGUIパネルが起動する。

java -jar GapBlaster_v1.1.2.jar

contigとscaffolds(NNN..を含む)を選択してRunを押す。

f:id:kazumaxneo:20180203121637j:plain

 

ランが終わると、アライメントされたscaffoldsとcontigの延期部分が表示される。また、NNNの解消を試みたscaffoldのFASTAファイルが自動出力される。

 

 

引用

GapBlaster—A Graphical Gap Filler for Prokaryote Genomes

Pablo H. C. G. de Sá , Fábio Miranda , Adonney Veras, Diego Magalhães de Melo, Siomar Soares, Kenny Pinheiro, Luis Guimarães, Vasco Azevedo, Artur Silva, Rommel T. J. Ramos

PLoS One. 2016 May 12;11(5):e0155327.

 

リードをマッピングしてゲノムアセンブリの精度を評価する REAPR

2021 7/11 link追加

 

REAPRは、リファレンスゲノムを使わずゲノムアセンブリの精度を評価するツール。カバレッジおよびインサートサイズの分布などのマッピング情報を分析して、ミスアセンブリの位置が特定される。 誤ったアセンブリはレポートされ、新しいアセンブリが出力される。 解析にはFASTA形式のアセンブリと、アセンブリにマップされたペアのBAMファイルが必要となる。 大きなインサートサイズのマッピング情報(≥1000bp)がある時に最適に機能する。

 

HP

https://www.sanger.ac.uk/tool/reapr/

 

 マニュアル

ftp://ftp.sanger.ac.uk/pub/resources/software/reapr/Reapr_1.0.18.manual.pdf

 

 

インストール

ubuntu14.04にインストールした。

依存

  • R
  • perl
  • File::Basename
  • File::Copy
  • File::Spec
  • File::Spec::Link
  • Getopt::Long
  • List::Util

perlのモジュールで持ってないものがあれば、cpanmでインストールしておく。

cpanm xxx

#またはCPANに入って(CPANとうつ)
>install File::Spec::Link

#または作者のサイトやCPANからダウンロード
perl Makefile.PL
make make
test make #OKが出るか確認
sudo make install

 

本体はパッケージマネージャで導入できる。

sudo apt install reapr

自分でビルドするならサンガー研の公式サイトからダウンロードする。

http://www.sanger.ac.uk/science/tools/reapr

解凍して以下のように打つ。

cd Reapr_1.0.18 
./install.sh #perlライブラリが入ってるかチェックし、OKならビルドが始まる

src/にreapr.plができる。

f:id:kazumaxneo:20180201173044p:plain

 

 ラン

テストデータを公式からダウンロードして解凍する。

中に入り、./test.shと打つ。

cd Reapr_1.0.18.test_data 
./test.sh

  

引用

REAPR: a universal tool for genome assembly evaluation

Martin Hunt, Taisei Kikuchi, Mandy Sanders, Chris Newbold, Matthew Berriman and Thomas D Otto

Genome Biology 2013 14:R47

 

利用例

https://minerva-access.unimelb.edu.au/bitstream/handle/11343/250244/PMC6807382.pdf;jsessionid=7A0E0D04AC50D9B02FC12BD3121C715C?sequence=1

複数のアセンブラのコンティグをマージする Metassembler

2019 6/10 追記

2019 6/11 関連ツール追記

 

ゲノムアセンブリプロジェクトでは、通常、単一の最良のアセンブリを見つけるために複数のアルゴリズムを実行するが、それらのアセンブリには、未開発の場合は補完的な長所と短所がある。 本著者らは、ゲノムの複数のアセンブリを単一の優れた配列に併合するMetassemblerアルゴリズムを提示する。本著者はそれをAssemblathonコンペティションからの4つのゲノムに適用し、それが一貫してそして各々のアセンブリの連続性と品質を実質的に改善することを示す。 

 

Metassemblerは複数のアセンブルツールのcontigをマージし、他のツールの短所を補い合うことで(例えばOLCのアセンブルツールとde brujin graphのアセンブルツール)、より長いcontigを作るツール。アセンブルコンペティションのAssemblathonの1と2のデータを使い、N50が改善されたことを報告している。

 

 

PDFマニュアル

https://sourceforge.net/projects/metassembler/files/?source=navbar

 

インストール

cent OSにインストールした。

依存

  • MUMmer whole genome alignment package
  • bowtie2
  • samtools
  • python
  • perl
  • argparse
  • Statistics::Descriptive

perlのモジュールとpythonのモジュールがなければインストールしておく。

cpanm Statistics::Descriptive
pip install argparse

mummer、bowtie2も無ければbrewで導入しておく。

 

本体 SOurceForge

https://sourceforge.net/projects/metassembler/?source=typ_redirect

解凍して中に入りビルドする。

make install
cd bin/
./metassemble

$ metassemble

usage: metassemble [-h] --conf <configuration file> [--outd <out directory>]

                   [--mgage <mail>] [--dogage <ref path>]

metassemble: error: argument --conf is required

[uesaka@cyano meta1]$ metassemble -h

usage: metassemble [-h] --conf <configuration file> [--outd <out directory>]

                   [--mgage <mail>] [--dogage <ref path>]

 

Metassemble a set of input assemblies.

 

optional arguments:

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

  --outd <out directory>

  --mgage <mail>        For each intermediate metassembly send an email to

                        <mail> when the merging step is done and the GAGE

                        evaluation tool can be run by the user. This will only

                        work if the Unix mail command is available and

                        functioning

  --dogage <ref path>   For each intermediate metassembly run the GAGE

                        evaluation tool using <ref path> as the reference.

 

required arguments:

  --conf <configuration file>

                        Path to configuration file. (Required)

bin/のパスを通しておく。

  

ラン

--テストラン--

configファイルを自動で作って解析される。

cd Metassembler/Sample/meta1/
sh Metassemble_script.sh

マージされたcontigはMetassembly/に保存される。 

 

 configファイルの詳細はPDFファイルで確認してください。

 

 

追記

Mixの方が簡単に動きます。 

 

引用

Metassembler: merging and optimizing de novo genome assemblies

Alejandro Hernandez Wences and Michael C. Schatz

Genome Biology 201516:207