macでインフォマティクス

macでインフォマティクス

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

アダプタートリミングツール illumiprocessor

2018 10/11 コードの誤り修正 

 

Illumiprocessorは、illuminaのSEとPEのシーケンシングリードからアダプターのコンタミネーションをトリミングするツール。 double-indexのリードのトリミングができる。 scytheとsickle(v1.xで使用)よりtrimmomatiを使った方がパフォーマンスが向上するという観察から、内部で利用するトリミングツールにはtrimmomaticが選択されている。trimmomaticを並列実行することで高速化しており、trimmomatic を高速化するラッパーツールとも言える。本ツールの実行後、scytheを追加実行することで、潜在的なアダプター汚染の全てを徹底的に除くことができるとされる。Illumiprocessor自体は論文にはなっていないが、いくつかの論文で使用されている。

 

バッチ処理に向いた実装をしており、configファイルに記載することで、大量のデータを自動で処理できるようになっている。

 

マニュアル

https://illumiprocessor.readthedocs.io/en/latest/

 

インストール

mac os10.12のminiconda2-4.3.30環境でテストした。

conda install -c bioconda illumiprocessor

> illumiprocessor -h

$ illumiprocessor -h

usage: illumiprocessor [-h] --input INPUT --output OUTPUT --config CONFIG

                       [--trimmomatic TRIMMOMATIC] [--min-len MIN_LEN]

                       [--no-merge] [--cores CORES] [--r1-pattern R1_PATTERN]

                       [--r2-pattern R2_PATTERN] [--se]

                       [--phred {phred33,phred64}] [--log-path LOG_PATH]

                       [--verbosity {INFO,WARN,CRITICAL}]

illumiprocessor: error: argument --input is required

——

user~/local: $ illumiprocessor -h

usage: illumiprocessor [-h] --input INPUT --output OUTPUT --config CONFIG

                       [--trimmomatic TRIMMOMATIC] [--min-len MIN_LEN]

                       [--no-merge] [--cores CORES] [--r1-pattern R1_PATTERN]

                       [--r2-pattern R2_PATTERN] [--se]

                       [--phred {phred33,phred64}] [--log-path LOG_PATH]

                       [--verbosity {INFO,WARN,CRITICAL}]

 

Batch trim Illumina reads for adapter contamination and low quality bases

using Trimmomatic

 

optional arguments:

  -h, --help            show this help message and exit

  --input INPUT         The input directory of raw reads to trim. (default:

                        None)

  --output OUTPUT       The output directory of clean reads to create.

                        (default: None)

  --config CONFIG       A configuration file containing the tag:sample mapping

                        and renaming options. (default: None)

  --trimmomatic TRIMMOMATIC

                        The path to the trimmomatic-0.XX.jar file. (default: /

                        Users/user/.pyenv/versions/miniconda2-4.3.30/bin/trimm

                        omatic)

  --min-len MIN_LEN     The minimum length of reads to keep. (default: 40)

  --no-merge            When trimming PE reads, do not merge singleton files.

                        (default: False)

  --cores CORES         Number of compute cores to use. (default: 1)

  --r1-pattern R1_PATTERN

                        An optional regex pattern to find R1 reads. (default:

                        None)

  --r2-pattern R2_PATTERN

                        An optional regex pattern to find R2 reads. (default:

                        None)

  --se                  Single-end reads. (default: False)

  --phred {phred33,phred64}

                        The type of fastq encoding used. (default: phred33)

  --log-path LOG_PATH   The path to a directory to hold logs. (default: None)

  --verbosity {INFO,WARN,CRITICAL}

                        The logging level to use. (default: INFO)

——

 

実行方法

図のような3組のペアエンドfastq、sample1-3を処理するとする。

f:id:kazumaxneo:20181010163937j:plain

 

1、ランに必要なconfigファイルを作成する(phyluceのマニュアルを参考にした link

cat >illumiprocessor.conf <<EOF
# this is the section where you list the adapters you used. the asterisk # will be replaced with the appropriate index for the sample.
[adapters]
i7:AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC*ATCTCGTATGCCGTCTTCTGCTTG
i5:AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT

# this is the list of indexes we used
[tag sequences]
BFIDT-016:ATGAGGC
BFIDT-045:AATACTT
BFIDT-011:TTCTCCT

# this is how each index maps to each set of reads
[tag map]
sample1_name:BFIDT-016
sample2_name:BFIDT-045
sample3_name:BFIDT-011

# rename
[names]
sample1_name:sample1_output
sample2_name:sample2_output
sample3_name:sample3_output

EOF

 

2、illumiprocessorを実行。

illumiprocessor \
--input input_fastq/ \
--output cleaned_output/ \
--config illumiprocessor.conf \
--cores 12

 出力ディレクトリ。指定した名前のサブディレクトリがデータごとにできる。

f:id:kazumaxneo:20181010164209j:plain

トリミング後のfastqはsplit-adapter-quality-trimmed/に保存される。ペアエンドの順番が保持されているリードはREAD1とREAD2に出力され、片方が除去されアンペアになったリードはsingletonのファイルに出力される。他、logファイルなどが出力される。

f:id:kazumaxneo:20181010164231j:plain

 

 

引用

Faircloth, BC. 2013. illumiprocessor: a trimmomatic wrapper for parallel
adapter and quality trimming. http://dx.doi.org/10.6079/J9ILL.

Bolger, A. M., Lohse, M., & Usadel, B. (2014). Trimmomatic: A flexible
trimmer for Illumina Sequence Data. Bioinformatics.
http://dx.doi.org/10.1093/bioinformatics/btu170.

 

参考HP

https://bi.biopapyrus.jp/rnaseq/qc/trimmomatic.html