macでインフォマティクス

macでインフォマティクス

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

CGView Comparison Toolによるバクテリアのゲノム比較 インストール編

2020 6/18  インストール追記

 

CGView Comparison ToolはStothardの研究グループが公開しているバクテリアやプラスミドのゲノム比較ツール(以下CCT)である。複数ゲノムを比較して描画する機能を持つ。以下のような美しい図が簡単なコマンド指定だけで描ける。

f:id:kazumaxneo:20170613140250j:plain

 

比較ゲノム結果をビジュアル化するツールは多いが、CCTは、同時に数千のゲノムを比較できる特徴を持つ。比較も、DNA vs DNAやcDNA vs cDNA、protein vs protein、またNGSデータのアライメント、などに対応している(論文リンクこれらの機能は他のビジュアル比較ツールにないCCTのユニークな特徴となる。バクテリアのゲノム比較に有用なツールと思われるので、インストールからテストランまでを紹介していく。

CCTの公式HP

http://stothard.afns.ualberta.ca/downloads/CCT/installation.html

 

CCTはコマンドラインで動かすローカル版の他に、同じオーサーたちが以前報告したwebサーバー版1つ前の論文)もある。ただwebサーバー版は比較するゲノムが3つまでに制限されており、基本的にローカル版をお勧めする。ローカル版はlinuxmacのインストールに公式対応しており、インストールもunixの知識が多少あれば難しくない。以下、macでローカル版をインストールして、チュートリアルのランを行うまでを説明する。

  

インストール

2020 6/18  追記

1、Bioconda (サポートスクリプトは導入されない)

Cgview :: Anaconda Cloud

conda create -n cgview -y
conda activate cgview
conda install -c bioconda cgview

 

2、condaを使用しない場合(旧解説)

はじめにCCTを公式ページのリンクからダウンロードしておく。 

本体の他に動作に必要なものは公式HPに記載されている。

 

 imagemagickは様々なフォーマットの画像の処理を行うソフトウエアで、brewでインストールできる。

brew install imagemagick
brew install wget #wgetがない人だけ 

CPANからperlモジュールをインストールする。

sudo perl -MCPAN -e shell

パスワードを入力してCPANシェルに入る。(>に変わる)

o conf prerequisites_policy follow #依存モジュールをインストール
o conf commit #設定をコミット

4つのモジュールをインストール。

install Error 
install LWP::UserAgent
install LWP::Protocol::https
install Tie::IxHash
exit #CPANを出る。

 

ホームにある.bash_profileに

export CCT_HOME="/path/to/cgview_comparison_tool"
export PATH="$PATH":"${CCT_HOME}/scripts":/path/to/blast-2.2.25/bin
export PERL5LIB="${CCT_HOME}"/lib/bioperl-1.2.3:"${CCT_HOME}"/lib/perl_modules:"$PERL5LIB"

を記載。これでCCTのツールへのパスが通る。

上記の/path/to/cgview_comparison_toolは自分のCCTのダウンロードパスに変更(パス中には日本語を含まない方が良い)。 /path/to/blast-2.2.25/binもインストールしたlegacy blast (blastall)のbinのパスに変更。

ソースしてパスを通す。

source ~/.bash_profile

cgview -h

$ cgview -h

illegal value '' for option -h/--htmlFile

usage: java -jar cgview.jar [OPTION]...

-A <integer> Specifies a label font size.

-c <integer> Specifies the base to center on when zooming.

-D <integer> Specifies a legend font size.

-d <real> Specifies tick density, between 0 and 1.0. Default is 1.0.

-E <boolean> Whether or not to embed vector-based text in SVG output.

-e <boolean> Whether or not to exclude SVG output from image series.

-f <format> The format of the output: PNG, JPG, SVG, or SVGZ.

-h <file> HTML file to create.

-H <integer> The height of the map.

-i <file> The input file to parse.

-I <boolean> Whether or not to draw labels on the inside of the backbone circle.

-L <integer> The width of an external legend.

-o <file> The image file to create.

-p <path> The path to the image file in the HTML file created using the -h option.

-r <boolean> Whether or not to remove legends.

-R <boolean> Whether or not to remove labels.

-s <directory> Directory to receive an image series.

-S <boolean> Whether or not to reference external stylesheet in HTML output.

-u <boolean> Whether or not to reference overlib.js in HTML output.

-U <integer> Specifies a sequence ruler font size.

-W <integer> The width of the map.

-x <string> Comma separated zoom values for image series.

-z <real> The factor to zoom in by.

Example usage: java -jar cgview.jar -f png -i cybercell.xml -o my_picture.png -h view_image.html.

Example usage: java -jar cgview.jar -i cybercell.xml -s directory_for_series -e true.

 

 

 

テストラン

CCTのディレクトリ内に移動して、以下のテストコマンドを実行。

cd /path/to/cgview_comparison_tool 
./update_cogs.sh
./test.sh

formatdbが見つからないと言う理由でエラーになるなら、legacy blastがmacに入っていない可能性がある。というのも、このツールは内部でblastallプログラムを動かしているが、これは現在NCBIが提供しているblast+とは異なるためで、古いblastツールが必要だからである。このlegacy blastをビルドしてパスを通しておかないと上記プログラムは動かない。

legacy blastはNCBのこちらからダウンロードできる(legacy blastが手に入らないという人はgmailのkazumaxpro@までご連絡ください)。

 

エラーが修復できたら改めてテストランを行う。

 update_cogs.shが正常に終わると最後に以下のようなメッセージが表示される。

.
Removed ‘.listing’.
Remote file no newer than local file ‘whog’ -- not retrieving.
Formatting myva for BLAST
Update complete.

同様にtest.shが正常に終わると、最後に以下のようなメッセージが表示される。

.
The map has been drawn.
Writing picture to ./sample_projects/test_orfs/maps/medium.png
Writing HTML to ./sample_projects/test_orfs/maps/medium.html
[Tuesday June 13 13:13:44 2017] [Notice] CGView maps have been created in ./sample_projects/test_orfs/maps.

testが終わるとsample_projectsができ、その中にたくさんのフォルダが出来ている。

/sample_projects/test_orfs/maps/にあるmedium.pngは以下のようなビットマップ画像である。

 

f:id:kazumaxneo:20170613132041j:plain

 

 

解析は以下の流れで進める。

1、比較元のリファレンスgbkの準備(チュートリアルではダウンロードしている)。

2、比較前のデータベース作成

3、比較するゲノムをデータベースフォルダの中のサブフォルダにダウンロード(検索は正規表現に対応)。

4、blastコマンドによる比較。

 

 

コマンドの使い方は公式ページのコマンドのページで確認してください。公式ページには丁寧なチュートリアルもあります。公式ページのチュートリアルを実行して見た結果も、別のエントリーでまとめています。

 

 チュートリアル1

チュートリアル2

チュートリアル3

 チュートリアル4

チュートリアル5

チュートリアル6

チュートリアル7

 実践編

 

 

引用------------------------------------------------------------------------------------------------

The CGView Server: a comparative genomics tool for circular genomes

Nucleic Acids Res. 2008 Jul 1; 36(Web Server issue): W181–W184.

The CGView Server: a comparative genomics tool for circular genomes

 

Comparing thousands of circular genomes using the CGView Comparison Tool

BMC Genomics 201213:202 

https://bmcgenomics.biomedcentral.com/articles/10.1186/1471-2164-13-202

 

関連

こちらの方が簡単です

anvi'o