macでインフォマティクス

macでインフォマティクス

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

FASTQ headersのバーコード情報によってdemultiplexingする fastq_demux

 

fastq_demuxはFASTQヘッダーのバーコードに基づいてillumina fastqをデマルチプレックスするシンプルなプログラム。

 

インストール

condaで環境を作って導入した。

Github

mamba create -n fastq_demux python=3 -y
conda activate fastq_demux

#本体
git clone https://github.com/Molmed/fastq_demux.git
cd fastq_demux/
pip install -r requirements.txt .

#docker
git clone https://github.com/Molmed/fastq_demux.git
cd fastq_demux/
docker build -t fastq_demux:master .

> fastq_demux --help

Usage: fastq_demux [OPTIONS]

 

Options:

  --R1 PATH               FASTQ file with R1 sequences  [required]

  --R2 PATH               FASTQ file with R2 sequences

  --I1 PATH               FASTQ file with I1 (i7) sequences. If specified,

                          will replace any index present in the FASTQ headers

  --I2 PATH               FASTQ file with I2 (i5) sequences. If specified,

                          will replace any index present in the FASTQ headers

  --samplesheet PATH      Sample sheet containing the barcode to sample-id

                          mapping  [required]

  --mismatches INTEGER    Number of mismatches allowed in each index read

  --prefix TEXT           prefix to use for naming demultiplexed FASTQ files

  --unknown-barcode TEXT  barcode to use for non-matching barcodes  [default:

                          Unknown]

  --outdir PATH           output directory where demultiplexed FASTQ files

                          should be written  [default: (Current Working

                          Directory)]

  --no-gzip-compression   skip gzip-compression of output FASTQ files

  --help                  Show this message and exit.

 

 

 

実行方法

実行するにはサンプルシートTSVファイルを指定する。

single-index

dual-index

サンプルシートには、シングルインデックスリード用またはデュアルインデッ クスリード用に、それぞれ2列または3列のカラムが必要。カラムは SampleID, P7-index(とP5-index)

このシートの情報とfastq headerのindex情報をもとにリードのdemultiplexを行う。indexをシークエンスされたリード中から探索するわけではない。

 

テストラン

single-end(single-index)のdemultipexing

cd fastq_demux/tests/
fastq_demux --R1 single-index_Undetermined_S0_L001_R1_001.fastq.gz --samplesheet samplesheet_single_index.tsv
  • --R1    FASTQ file with R1 sequences  [required]
  • --R2    FASTQ file with R2 sequences
  • --samplesheet    Sample sheet containing the barcode to sample-id mapping  [required]
                              

ジョブが終わるとSample1_GGGGGGGG_R1.fastq.gzとSample2_GAAGATTT_R1.fastq.gz、barcode_Unknown_R1.fastq.gzが出力される。

 

その他

  • マルチプレックスに使用するインデックス配列が通常のリードとして別のFASTQファイルにある場合は、--I1(i7-index用)、デュアルインデックスの場合は--I2(i5-index用)パラメータで指定可能。
  • リードのバーコードとサンプルシートのバーコードを比較する際に、-mismatches パラメータでミスマッチを許容することができる。

引用

https://github.com/Molmed/fastq_demux