macでインフォマティクス

macでインフォマティクス

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

ONTリードのシミュレーター NanoSim

 

NanoSImは2017年に発表されたOxford nanoporeのロングリードのシミュレーター。ユーザーが指定したONTリードからプロファイルを作成し、それに基づいてロングリードを発生させることができる。

 

 

インストール

 

依存

  • minimap2 (Tested with version 2.10)
  • LAST (Tested with version 581 and 916)
  • Python (2.7 or >= 3.4)

Python packages:

  • six
  • numpy (Tested with version 1.10.1 or above)
  • HTSeq
  • scipy (Tested with verson 1.0.0)

本体 Github

git clone https://github.com/bcgsc/NanoSim.git
cd NanoSim/

 

実行方法

ランは二段階で行う。第一ステップはONTのシーケンスデータを指定してのモデルの構築となる。

./read_analysis.py -i ONT.fasta -r reference.fa
  • -r eference genome of the training reads
  • -m User can provide their own alignment file, with maf extension
  • -b number of bins (for development), default = 20
  • -o The prefix of output file, default = 'training'

LASTを使いリファレンスゲノムにONTリードをアライメントしている。エラーを評価するため、ONTリード自身からアセンブルしたcontigをリファレンスに使ったりしてはならない。

カレントディレクトリにref_genome~とtrainning~というファイルがいくつかできる(-o 指定がない時)。

 

 

オーサーらにより、yeastと、E.coliの1dと2dで読んだONTリードのプロファイルやシーケンスデータが用意されている(R7とR9両方あり)。指定のONTリードがないならそれを使う。FTPサーバーリンク

wget ftp://ftp.bcgsc.ca/supplementary/NanoSim/yeast* #例えばyeastのデータをダウンロード

yeast_2D.fasta

yeast_S288C_ref.fa

yeast_profile.zip

がダウンロードされる。yeast_2D.fastaがONTリード、yeast_S288C_ref.faがリファレンスゲノムになる。

 

 

第二段階- 配列のシミュレーション。先ほど作ったtraining~を指定して走らせる。

./simulator.py linear -r referenceg.fa -c training
  •  -r reference genome in fasta file, specify path and file name  
  •  --max_len Maximum read length, default = Inf
  • --min_len Minimum read length, default = 50
  • --perfect Output perfect reads, no mutations, default = False  
  • --KmerBias prohibits homopolymers with length >= 6 bases in output reads, can be omitted  
  • -o The prefix of output file, default = 'simulated' 
  • -n Number of generated reads, default = 20,000 reads  
  • -c the prefix of training set profiles, same as the output prefix in read_analysis.py, default = training  
  • circular | linear Do not choose 'circular' when there is more than one sequence in the reference <options>:

 -oで指定しなければ、simulated_reads.fastaが出力される。環状ゲノムならcircularにすること。

出力された配列をseqkitで簡単に分析する。

user$ seqkit stats simulated_reads.fasta 

file                   format  type  num_seqs      sum_len  min_len  avg_len  max_len

simulated_reads.fasta  FASTA   DNA     20,000  139,782,497      168  6,989.1   25,253

最長25253-bp、最短168-bp、平均6989-bpのリードが出力された。

 

 seqkitは以下で紹介しています。

引用

NanoSim: nanopore sequence read simulator based on statistical characterization.

Chen Yang, Justin Chu, René L Warren, Inanç Birol

Gigascience 2017 gix010