macでインフォマティクス

macでインフォマティクス

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

RNA-seqのクロスコンタミを検出する Croco

 

 核酸試料間の汚染は、分子生物学における潜在的な問題として長く認識されてきた。ポリメラーゼ連鎖反応(PCR)による増幅や、そして最近ではハイスループット配列決定でのPCR増幅は、ソースにかかわらず、また非常に低レベルの混入した核酸でさえ、十分な範囲で配列決定できることを意味する[ 論文より ref.1-9]。寄生虫、腸内細菌、内寄生虫または環境由来の目的生物の配列と汚染配列とを区別するために、様々なツールが既に開発されている。これらのアルゴリズムは、通常、特定の基準に基づいて汚染配列を同定し、リファレンスデータベースを使用して汚染物質の分類源を推測する。 Blobtoolsパイプライン[ref.10](紹介)はGCの内容、カバレッジおよび分類学的割り当て(Basic Local Alignment Search Tool(BLAST)をNCBI nrに対して実行)に基づいて汚染配列を検出する。わずかに異なる方法であるAnvi'o [ref.11]は、最初にカバレッジおよび/またはk-merスペクトル基づいてコンティグを自動的にビンし、汚染由来ビンを特定する。MCSC(Model-based Categorical Sequence Clustering)[ref.5]は、シーケンスで観測された頻繁なパターンに基づいたクラスタリング手法(分割的階層クラスタリング)を使用し、UniRef90データベース(リンク)に対するブラストによって汚染クラスターを識別する。これらの方法(MCSCを除く)は、ゲノムデータに焦点を当てる。しかし、それらは汚染されていない公共データベースに部分的に依存し、遠く離れた生物からの汚染を検出するように設計されている。トランスクリプトームデータは現在、進化生物学で広く使用されているため、RNAシークエンシング(RNA-seq)データ用に設計された新しいツールCroCoを設計した。これは発現レベル推定値に依存したリファレンスゲノムフリーの方法であり、別のタイプの汚染、すなわちクロスコンタミネーションをターゲットとしている。

 クロスコンタミネーションは、所定のシークエンシングプロジェクトにおいて並行して処理するサンプル間の汚染として定義される。これは実験が汚染の起源であり、サンプル操作、DNA / RNA抽出、ライブラリーの調製および増幅、サンプルの多重化および不正確なバーコード配列決定の複数のベンチワークステップで潜在的に生じ得る。本発明者らの経験的観察は、multiplexによる複数種のcDNAライブラリーのシーケンス(例えば、その後の系統樹再構築のために)では、ある程度のクロスコンタミネーションが避けられないことを示す。この現象は、2つ以上の十分に離れた種の転写産物において、ヌクレオチドレベルで同一またはほぼ同一の配列があるときに明らかである(例えば、論文の図S1参照)。このような症例は、最近のいくつかの進化生物学研究で既に検出されている[ref.9,12-16]。クロスコンタミネーションは、種間の偽の類似性を生じ、あらゆる種類の下流比較分析に有害な結果をもたらす。

 

本研究者らのアプローチは、最初に、ペアワイズBLAST手順を用いてサンプル間で疑わしいほど類似している転写物のサブセットを決定する。 CroCoは全てのリードをメタトランスクリプトームに結合し、全ての転写物の「発現レベル」を定量する。この情報は、次の5つのカテゴリで各トランスクリプトを分類するために使用される。

  1. clean: the transcript origin is from the focal sample.  
  2. cross contamination: the transcript origin is from an alien sample of the same experiment
  3. dubious: expression levels are too close between focal and alien samples to determine the true origin of the transcript..
  4. low coverage: expression levels are too low in all samples, thus hampering our procedure (which relies on differential expression) to confidently assign it to any category.
  5. over expressed: expression levels are very high in at least 3 samples and CroCo will not try to categorize it. Indeed, such a pattern does not correspond to expectations for cross contaminations, but often reflect highly conserved genes such as ribosomal gene, or external contamination shared by several samples (e.g. Escherichia coli contaminations).

CroCoの手順は、潜在的なクロスコンタミネーションを検出し、定量化するために配列類似性を利用する。 そのため、あまりにも密接に関連するサンプルが分析されると(腫瘍と正常細胞との比較など)、疑わしい事例および過剰発現数の過剰推定につながる可能性がある。

 

 

インストール

ubuntu14.04でテストした。

依存

  • BLAST-2.5.0+
  • R-3.1.0 (optional)
  • R library package visNetwork
  • R library package igraph

Mandatory dependencies - at least one mapping tool in the following list :

  • Bowtie-1.1.2
  • Kallisto-0.43.0
  • Rapmap-0.1.0

3つのマッピングツールは、本体の./install実行時に自動インストールされる。

本体 GitLab

http://gitlab.mbb.univ-montp2.fr/mbb/CroCo

git clone http://gitlab.mbb.univ-montp2.fr/mbb/CroCo.git
cd CroCo/utils/

#osx (実行中にbrew install coreutils gnu-getopt gawk grep gnu-sed gcc48 make cmakeを行うので注意する)
bash ./install_dependencies.sh --tool R --os macosx

#ubuntu (centosなら最後をcentosに変更する)テストではこちらを実行した。
bash ./install_dependencies.sh --tool all --os ubuntu


cd src/

 > bash CroCo_v1.1.sh 

$ bash CroCo_v1.1.sh 

 

CroCo_v1.1.sh is a program that can detect potential cross-contaminations in assembled transcriptomes using sequencing reads to find true origin of transcripts.

 

Usage :

./CroCo_v1.1.sh [--mode p|u] [--tool B|B2|K|R|S] [--fold-threshold INT] [--minimum-coverage FLOAT] [--threads INT] [--output-prefix STR] [--output-level 1|2|3] [--graph yes|no] [--trim5 INT] [--trim3 INT] [--frag-length FLOAT] [--frag-sd FLOAT] [--suspect-id INT] [--suspect-len INT] [--add-option STR] [--recat STR]

 

--mode p|u :            'p' for paired and 'u' for unpaired (default : 'p') [short: -m]

--in STR :            Name of the directory containing the input files to be analyzed (DEFAULT : working directory) [short: -i]

--tool B|K|R :        'B' for bowtie, 'K' for kallisto, 'R' for rapmap (DEFAULT : 'R') [short: -t]

--fold-threshold FLOAT :    Value between 1 and N (DEFAULT : 2) [short: -f]

--minimum-coverage FLOAT :    TPM value (DEFAULT : 0.2) [short: -c]

--overexp FLOAT :            TPM value (DEFAULT : 300) [short: -d]

--threads INT :            Number of threads to use (DEFAULT : 1) [short: -n]

--output-prefix STR :        Prefix of output directory that will be created (DEFAULT : empty) [short: -p]

--output-level 1|2 :        Select whether or not to output fasta files. '1' for none, '2' for all (DEFAULT : 2) [short: -l]

--graph yes|no :        Produce graphical output using R (DEFAULT : no) [short: -g]

--add-option 'STR' :        This text string will be understood as additional options for the mapper/quantifier used (DEFAULT : empty) [short: -a]

--recat SRT :            Name of a previous CroCo output directory you wish to use to re-categorize transcripts (DEFAULT : no) [short: -r]

--trim5 INT :            nb bases trimmed from 5' (DEFAULT : 0) [short: -x]

--trim3 INT :            nb bases trimmed from 3' (DEFAULT : 0) [short: -y]

--suspect-id INT :        Indicate the minimum percent identity between two transcripts to suspect a cross contamination (DEFAULT : 95) [short: -s]

--suspect-len INT :        Indicate the minimum length of an alignment between two transcripts to suspect a cross contamination (DEFAULT : 40) [short: -w]

--frag-length FLOAT :        Estimated average fragment length (no default value). Only used in specific combinations of --mode and --tool  [short: -u]

--frag-sd FLOAT :        Estimated standard deviation of fragment length (no default value). Only used in specific combinations of --mode and --tool [short: -v]

 

It is good practice to redirect information about each CroCo run into an output log file using the following structure :

'2>&1 | tee log_file'

 

Minimal working example :

CroCo_v0.1.sh --mode p 2>&1 | tee log_file

 

Exhaustive example :

CroCo_v0.1.sh --mode p --in data_folder_name --tool R --fold-threshold 2 --minimum-coverage 0.2 --overexp 300 --threads 8 --output-prefix test1_ --output-level 2 --graph yes --add-option '-v 0' --trim5 0 --trim3 0 --suspect-id 95 --suspect-len 40 --recat no 2>&1 | tee log_file

 

Exhaustive example using shortcuts :

CroCo_v0.1.sh -m p -i data_folder_name -t R -f 2 -c 0.2 -d 300 -n 8 -p test1_ -l 2 -g yes -a '-v 0' -x 0 -y 0 -s 95 -w 40 -r no 2>&1 | tee log_file

 

Example for re-categorizing previous CroCo results

CroCo_v0.1.sh -i data_folder_name -r previous_CroCo_results_folder_name -f 10 -c 0.5 -g yes 2>&1 | tee log_file

CrocoはDockerコンテナでも導入できます。

 

 

ラン

 付属のテストデータを分析する。テストデータはsampleAとBの比較になっている。

tar -xvzf CroCo_dataset_test.tgz 
bash src/CroCo_v1.1.sh --mode p --in CroCo_dataset_test -l 1 --graph no # --graph yesだと図も出力

--inで指定したディレクトリに以下の命名規則FASTAとfastqを準備して置く必要がある。

for paired-end reads :
NAME.fasta (assembled transcriptome seqs)
NAME.L.fastq (raw illumina data LEFT)
NAME.R.fastq (raw illumina data RIGHT)

for unpaired reads :
NAME.fasta (assembled transcriptome seqs)
NAME.fastq (raw illumina data)

ファイル名やヘッダーに特殊文字は使用してはならない(e.g. \/[]()|:;) 。

 

output

最初に説明した5グループのFASTAファイル及び5グループのリードカウントファイルが出力される(検出数がゼロならファイルはできない)。"all"ファイルには5グループ全ての発現量が記載される。

f:id:kazumaxneo:20180502202758j:plain

 

> column -t species_A.all |head -n 20

 $ column -t species_A.all |head -n 20

Contig                       species_A_reads  species_B_reads  MaxOtherSpCov  log2FoldChange  Status

species_A|comp10376_c0_seq1  0                0                0              inf             lowcov

species_A|comp6343_c0_seq1   0                0                0              inf             lowcov

species_A|comp4018_c0_seq1   0                0                0              inf             lowcov

species_A|comp16598_c0_seq1  0                136.775          136.775        -20.3834        contam

species_A|comp453_c0_seq1    0                0                0              inf             lowcov

species_A|comp4443_c0_seq1   0                0                0              inf             lowcov

species_A|comp6002_c0_seq1   0                0                0              inf             lowcov

species_A|comp2523_c1_seq1   0                0                0              inf             lowcov

species_A|comp20352_c0_seq1  223.257          0                0              inf             clean

species_A|comp11276_c0_seq1  0                0                0              inf             lowcov

species_A|comp10316_c0_seq1  0                0                0              inf             lowcov

species_A|comp14979_c0_seq1  0                0                0              inf             lowcov

species_A|comp1090_c0_seq1   0                0                0              inf             lowcov

species_A|comp20633_c0_seq1  0                0                0              inf             lowcov

species_A|comp7168_c0_seq1   0                0                0              inf             lowcov

species_A|comp1371_c0_seq1   0                0                0              inf             lowcov

species_A|comp17691_c0_seq1  0                0                0              inf             lowcov

species_A|comp17691_c0_seq2  0                0                0              inf             lowcov

species_A|comp16963_c0_seq1  0                0                0              inf             lowcov

contaminationと判定されたtrasncriptも見つかる。

 

column -t All_transcripts.quants |head -n 20

 $ column -t All_transcripts.quants |head -n 20

Contig                       species_A_reads  species_B_reads

species_A|comp18265_c0_seq1  0                0

species_B|sb_528476_         0                0

species_B|sb_540258_         0                0

species_B|sb_534367_         0                0

species_A|comp7973_c0_seq1   0                0

species_B|sb_561352_         0                0

species_B|sb_555461_         0                0

species_B|sb_538423_         0                0

species_B|sb_550205_         0                0

species_B|sb_549570_         0                0

species_B|sb_544314_         0                0

species_B|sb_550979_         0                112.563

species_B|sb_536865_         0                0

species_B|sb_519827_         0                0

species_B|sb_531609_         0                0

species_B|sb_542756_         0                0

species_B|sb_525718_         0                0

species_B|sb_546812_         0                0

species_B|sb_539098_         0                0

 

 

引用

A software tool ‘CroCo’ detects pervasive cross-species contamination in next generation sequencing data

Paul Simion, Khalid Belkhir, Clémentine François, Julien Veyssier, Jochen C. Rink, Michaël Manuel, Hervé Philippe, and Maximilian J. Telford

BMC Biol. 2018; 16: 28.