macでインフォマティクス

macでインフォマティクス

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

SPAdesのアセンブリを改善する Shovill

2019 7/16 インストールの説明の誤りエラー修正

2019 9/25 twitterリンク追加

2019 10/25 dockerリンク追加

 

 SPAdesゲノムアセンブラは、バクテリアや他の真核微生物(主に1倍体)のIlluminaホールゲノムシーケンシング(WGS)データのデファクトスタンダードアセンブラとなっている。 SPAdesはVelvetのような以前のアセンブラーよりも大幅に改善されているが、計算集約的なde novo assemblyのステップを繰り返し行うため、実行速度が非常に遅く、またオーバーラップしたペアエンドリード(interlaceのfastq)をうまく扱えない。

 Shovillは、コアでSPAdesを使用するパイプラインだが、プライマリアセンブリステップの前後のステップを変更して、短時間で同様の結果を得ることができる。Shovillは、SKESAやMegahit(紹介)のような他のアセンブラもサポートしているので、Shovillが提供する前処理と後処理を利用することもできる。

 

以下の手順でアセンブリが実行される。

 

  • Estimate genome size and read length from reads (unless --gsize provided)
  • Reduce FASTQ files to a sensible depth (default --depth 100)
  • Trim adapters from reads (with --trim only)
  • Conservatively correct sequencing errors in reads
  • Pre-overlap ("stitch") paired-end reads
  • Assemble with SPAdes/SKESA/Megahit with modified kmer range and PE + long SE reads
  • Correct minor assembly errors by mapping reads back to contigs
  • Remove contigs that are too short, too low coverage, or pure homopolymers
  • Produce final FASTA with nicer names and parseable annotations

シングルエンドのfastqはサポートしていない。データはilluminaのシーケンスデータのみ利用できる。

 

インストール

centos7のAnaconda 2.1.0でテストした(pyenvで管理)。また、ubuntu18.04のpython2.7環境でもテストした(docker使用、ホストOSmac os101.4)(macでテストした時はkmcのチェック時にエラーで落ちた(error 256))。

依存

  • SPAdes >= 3.11
  • SKESA
  • MEGAHIT
  • Velvet >= 1.2
  • Lighter
  • FLASH
  • SAMtools >= 1.3
  • BWA MEM
  • MASH >= 2.0
  • seqtk
  • pigz
  • Pilon (Java)
  • Trimmomatic (Java)

brewかcondaで本ツールをインストールすれば、依存は全て導入されます。

本体 Github

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

#homebrew
brew install brewsci/bio/shovill

#他にdockerコンテナも用意されています。

#dockerhub (link )
docker pull staphb/shovill:latest

パスが全て通っているか確認する。

> shovill --check

$ shovill --check

Using seqtk - /usr/local/bin/seqtk

Using pigz - /usr/local/bin/pigz

Using kmc - /usr/local/bin/kmc

Using trimmomatic - /usr/local/bin/trimmomatic

Using lighter - /usr/local/bin/lighter

Using flash - /usr/local/bin/flash

Using spades.py - /usr/local/bin/spades.py

Using bwa - /usr/local/bin/bwa

Using samtools - /usr/local/bin/samtools

Using java - /usr/bin/java

Using pilon - /usr/local/bin/pilon

Using tee - /usr/bin/tee

Using sysctl - /usr/sbin/sysctl

shovill

$ shovill -h

SYNOPSIS

  De novo assembly pipeline for Illumina paired reads

USAGE

  shovill [options] --outdir DIR --R1 R1.fq.gz --R2 R2.fq.gz

GENERAL

  --help          This help

  --version       Print version and exit

  --check         Check dependencies are installed

INPUT

  --R1 XXX        Read 1 FASTQ (default: '')

  --R2 XXX        Read 2 FASTQ (default: '')

  --depth N       Sub-sample --R1/--R2 to this depth. Disable with --depth 0 (default: 100)

  --gsize XXX     Estimated genome size eg. 3.2M <blank=AUTODETECT> (default: '')

OUTPUT

  --outdir XXX    Output folder (default: '')

  --force         Force overwite of existing output folder (default: OFF)

  --minlen N      Minimum contig length <0=AUTO> (default: 0)

  --mincov n.nn   Minimum contig coverage <0=AUTO> (default: 2)

  --namefmt XXX   Format of contig FASTA IDs in 'printf' style (default: 'contig%05d')

  --keepfiles     Keep intermediate files (default: OFF)

RESOURCES

  --tmpdir XXX    Fast temporary directory (default: '/var/folders/f2/r9ydwd5d5vxgfzz5h48grzgc0000gn/T/')

  --cpus N        Number of CPUs to use (0=ALL) (default: 16)

  --ram n.nn      Try to keep RAM usage below this many GB (default: 32)

ASSEMBLER

  --assembler XXX Assembler: velvet megahit spades skesa (default: 'spades')

  --opts XXX      Extra assembler options in quotes eg. spades: "--untrusted-contigs locus.fna" ... (default: '')

  --kmers XXX     K-mers to use <blank=AUTO> (default: '')

MODULES

  --trim          Enable adaptor trimming (default: OFF)

  --noreadcorr    Disable read error correction (default: OFF)

  --nostitch      Disable read stitching (default: OFF)

  --nocorr        Disable post-assembly correction (default: OFF)

HOMEPAGE

  https://github.com/tseemann/shovill - Torsten Seemann

 

 

実行方法

テストデータのラン。

git clone https://github.com/tseemann/shovill.git
cd shovill/

#実行
shovill --outdir shovill_output --R1 test/R1.fq.gz --R2 test/R2.fq.gz --ram 8 --cpus 8
  • --cpus       Number of CPUs to use (default: 8)
  • --ram         Try to keep RAM usage below this many GB (default: 8)
  • --outdir      Output folder (default: '')
  • --R1           Read 1 FASTQ (default: '')

  • --R2           Read 2 FASTQ (default: '')

 

out/に結果は出力される。

> ls -alh

f:id:kazumaxneo:20180624111908j:plain

デフォルトではk-merサイズはautoになる。test logを見ると31から111まで20きざみになっている。k-merのサブディレクトリは残らない。logを貼っておく。

f:id:kazumaxneo:20180624112710j:plain

最後にbwa memでmappingしてbamを作り、pilonでpolishしている。

 

bacteraのアセンブリデータをSPAdesのアセンブリデータと比較した。下はQUESTのアセンブリ評価metrics。オリジナルのSPAdes 3.11よりcontiguityがわずかに改善されている。これに伴い、contig数は144から125まで減少した。

f:id:kazumaxneo:20180624113735j:plain

 

引用

GitHub - tseemann/shovill: Faster SPAdes assembly of Illumina reads


2021 10/22

ShovillのONT向けforkに相当するdragonflye