Cutadapt拆分MGI数据

用Cutadapt拆分MGI测序仪的下机数据

背景说明

用华大测序仪上机测序时,如果选择不由测序仪自动拆分,测序完成后,只会得到一个包含index序列的Fastq文件。
使用Cutadapt,可以比较方便地按你需要的index,拆分成多个Fastq文件;还可以参数指定用多个线程拆分,会比较快。
同样的方法也可以用于一些包含Tag序列的Fastq文件,例如基因表达谱分析(DGE,Digital Gene Expression Tag Profiling)的数据。

输入文件

  • MGI下机的包含index序列的Fastq文件
    以下示例是测序读长是50,用的是Dual Barcode 8 bp + 8 bp的Fastq文件。
    Input_Fq

  • 目标index序列的Fasta文件
    按以下格式写成Fasta文件。序列末尾的*$*符号,是为了保证检出的index序列是完整地出现在序列3’末端,详见Cutadapt文档 Overview of adapter types
    Index_Fa

拆分脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Shell

### 参数 ###
# 输入Fastq文件
Input="xxxxxx.fq.gz"
# Index Fasta文件
Index="index.fa"
# 输出目录
Result_Dir="Result"
# 测序读长
Read_Length=50
# 调用核数量
Core=6

### 拆分 ###
rm -fr $Result_Dir
mkdir -p $Result_Dir
# 用{name}可以使输出文件名用$Index中的Reads ID作为文件名前缀
cutadapt -j $Core --no-indels -e 0 --quality-cutoff 0 --minimum-length $Read_Length --maximum-length $Read_Length -a file:$Index -o $Result_Dir/{name}.fq.gz $Input

参考资料

Cutadapt文档 Demultiplexing