macでインフォマティクス

macでインフォマティクス

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

SNVをコールしたり、全ゲノムのマルチプルアライメントを行う Snippy

2021 11/16 condaのインストール追記、help更新 

 

Snippyバクテリアのゲノムのマルチプルアライメントを行なって、SNV、indelをコールするツール。バリアントに基づいた系統解析を行う時などに使うことができる。

  

公式ページ

http://www.vicbioinformatics.com/software.snippy.shtml

マニュアル(README.md)

https://github.com/tseemann/snippy/blob/master/README.md

 

インストール

Bioperlがなければインストールしておく。(*いろいろモジュールを入れるので、perlbrewで環境構築した方が良いかもしれません。ここではその前提で書いてます。)。

#perlbrewのインストール 公式
#mac
\curl -L https://install.perlbrew.pl | bash
#linux
\wget -O - https://install.perlbrew.pl | bash

perlbrew -h #インストールの確認
perlbrew install perl-5.16.0 #ここでは5.16.0をインストール 数十分かかる
perlbrew list #利用可能なperlのバージョンを表示 * perl-5.16.0と出るはず
perlbrew switch 5.16.0 #5.16.0に切り替え
perl -v #version確認

perlbrew install-cpanm
cpanm Bio::Perl
cpanm Bio::SeqIO
cpanm File::Slurp
cpanm List::MoreUtils

#2021 1/16
#bioconda (link)
conda install -c bioconda snippy -y
conda install -c bioconda/label/broken snippy -y
conda install -c bioconda/label/cf201901 snippy -y

#dockerhub (公式ではない)
docker pull staphb/snippy

Bioperlのバージョン確認。

bash-3.2$ perl -MBio::Perl -le 'print $Bio::Perl::VERSION'

1.007002

 

本体  GIthub

brew tap tseemann/homebrew-bioinformatics-linux 
brew install snippy
snippy --help

全コマンド

bash-3.2$ snippy -h

Synopsis:

  snippy 3.2-dev - fast bacterial variant calling from NGS reads

Author:

  Torsten Seemann <torsten.seemann@gmail.com>

Usage:

  snippy [options] --outdir <dir> --ref <ref> --pe1 <R1.fq.gz> --pe2 <R2.fq.gz>

  snippy [options] --outdir <dir> --ref <ref> --se <454.fastq>

  snippy [options] --outdir <dir> --ref <ref> --peil <interleaved.fa.gz>

  snippy [options] --outdir <dir> --ref <ref> --ctgs <assembly.fasta>

Options:

  --help            This help

  --version         Print version and exit

  --citation        Print citation for referencing snippy

  --quiet           No screen output (default OFF)

  --cpus [N]        Maximum number of CPU cores to use (default '8')

  --reference [X]   Reference genome. Supports FASTA, GenBank, EMBL (not GFF) (default '')

  --outdir [X]      Output folder (default '')

  --prefix [X]      Prefix for output files (default 'snps')

  --force           Force overwrite of existing output folder (default OFF)

  --pe1|R1|left [X] Reads, paired-end R1 (left) (default '')

  --pe2|R2|right [X] Reads, paired-end R2 (right) (default '')

  --se|single [X]   Single-end reads (default '')

  --ctgs|contigs [X] Don't have reads use these contigs (default '')

  --peil [X]        Reads, paired-end R1/R2 interleaved (default '')

  --unmapped        Keep unmapped reads in BAM and write FASTQ (default OFF)

  --mapqual [N]     Minimum read mapping quality to consider (default '60')

  --basequal [N]    Minimum base quality to consider (default '20')

  --mincov [N]      Minimum coverage of variant site (default '10')

  --minfrac [n.n]   Minumum proportion for variant evidence (default '0.9')

  --report          Produce long report with visual alignment (slow) (default OFF)

  --cleanup         Remove most files not needed for snippy-core (inc. BAMs) (default OFF)

  --rgid [X]        Use this @RG ID: in the BAM header (default '')

  --bwaopt [X]      Extra BWA MEM options, eg. -x pacbio (default '')

 

 

ラン

1、 リファレンスとシーケンスデータ(fastq)を比較して、SNPsをコールする。

(bwa memでアライメント => freebayesでSNPs検出、vcftoolsでフィルタリング)

 /snippy-master/test/のテストデータをランする。

テスト1 ペアリードfastq

snippy --outdir test1 --force --ref example.fna --pe1 reads_R1.fastq.gz --pe2 reads_R2.fastq.gz --cpus 12
  • --outdir  Output folder (default '')
  • --force Force overwrite of existing output folder (default OFF)
  • --pe1|R1|left Reads, paired-end R1 (left) (default '')
  • --pe2|R2|right Reads, paired-end R2 (right) (default '')
  • --cpus  Maximum number of CPU cores to use (default '8')

  

 test1ディレクトリが作製され、その中にゲノムのマルチプルアライメントファイルなどが出力される。

f:id:kazumaxneo:20171209144844p:plain

出力されるのは、アライメントのbam、コンセンサス配列のFASTA、バリアントのVCF(フィルター有り/無し)、BED、GFF3、CSV、html、alnファイルなどになる。これら出力されるファイルの詳細はGithubのトップに記載されている(リンク)。

 

シングルfastq

snippy --outdir test2 --force --ref example.fna --se reads_R1.fastq.gz --cpus 12
  •  --se|single Single-end reads (default '')

 

 

 

 

2、WTとMTゲノムを比較する。

pseudo-readsに分解してアライメントが行われ、バリアントが検出される。

 

WTとMT1の比較

snippy --outdir mut1 --ref ref.gbk --ctgs mut1.fasta --cpus 12

WTとMT2の比較

snippy --outdir mut2 --ref ref.gbk --ctgs mut2.fasta --cpus 12

WTとMT1とMT2のゲノム比較

snippy-core mut1 mut2 

出力されるcore.full.alnが全ゲノム(ここでは3つ)のマルチプルアライメント結果となる。共通するSNPsなどもコールされる。結果をGubbinなどのツールに持ち込み、系統解析(Pan-Genome探索)を行うことができる。

 

 

 

引用

snippy: fast bacterial variant calling from NGS reads

Seemann T (2015)

https://github.com/tseemann/snippy

 

Slideshare

https://www.slideshare.net/torstenseemann/snippy-balti-bioinformatics-brum-uk-tue-5-may-2015

 

関連