注意:软件工具一般会定期进行迭代更新,如果使用出现问题,请查看官方文档。
fastp是一款数据质控过滤软件,作者是陈实富,来自深圳海普洛斯公司。他们将这款工具开源免费使用,这一点是非常值得称赞的。其实国内很多测序公司都有自己开发的数据处理程序,不过很多都在内部使用。
1、fastp可以实现处理数据的一次性处理,包括过滤低质量,过滤adapter,截取reads,split分割大文件等操作
2、支持长reads,也就是不仅仅适用与illumina测序平台,还可以处理Pacbio和Ion torrent的测序数据
3、直接输出质控和统计报告,包括json格式和html格式;
4、使用c++写的,执行效率非常高;
## conda: 但可能不是最新版本
conda install -c bioconda fastp
## 编译好的二进制版本,只适用于Linux
wget http://opengene.org/fastp/fastp
chmod a+x ./fastp
## 源码安装
# get source (you can also use browser to download from master or releases)
git clone https://github.com/OpenGene/fastp.git
# build
cd fastp
make
# Install
make install
## 单末端测序数据,非压缩格式
fastp -i in.fq -o out.fq
## 双末端测序数据,gzip压缩格式
fastp -i in.R1.fq.gz -I in.R2.fq.gz -o out.R1.fq.gz -O out.R2.fq.gz
## 使用案例:
fastp -i reads.1.fq.gz -I reads.2.fq.gz -o clean.1.fq.gz -O clean.2.fq.gz -z 4 -q 20 -u 30 -n
默认情况下,HTML格式报告保存在fastp.html,可以通过-h
参数指定;JSON格式报告保存在fastp.json,可以通过-j
参数指定## I/O 相关
-i, --in1 输入read1文件名
-o, --out1 输出read1文件名
-I, --in2 输入read2文件名
-O, --out2 输出read2文件名,软件默认是根据扩展名识别压缩文件,所以输出文件需要加上*.gz扩展名;
-6, --phred64 指定质量体系是phred64。目前主流测序数据都采用phred33,如果从NCBI下载以前hiseq 2000以及之前的数据,可能是Phred 64质量体系。
-z, --compression 输出压缩格式。给定一个数字1-9,调整压缩比率和效率的平衡;
## adapter相关选项
-A 关闭adapter trimming,默认软件会切出adapter,如果设置-A,则关闭这个功能;
-a 给定一个adapter序列文件;
## 全局裁剪选项
-f, --trim_front1 裁剪read1前多少个碱基,默认0;
-F, --trim_front2 裁剪read2前多少个碱基,默认0,如果没有指定,将保持与read1相同设置;
-t, --trim_tail1 裁剪read1末尾多少个碱基,默认0;
-T, --trim_tail2 裁剪read2末尾多少个碱基,默认0,如果没有指定,将保持与read1相同设置;
-b, --max_len1 如果read1比max_len1长,就从末尾截取一段使read1与max_len1等长,默认0,代表没有限制;
-B, --max_len2 如果read2比max_len2长,就从末尾截取一段使read2与max_len2等长,默认0,代表没有限制,如果没有指定,就保持与read1相同设置;
## polyG尾裁剪,针对NextSeq/NovaSeq数据
-g, --trim_poly_g 截取polyG尾,对于Illumina NextSeq/NovaSeq测序数据时默认自动操作的;
--poly_g_min_len 检测read末尾的polyG的长度,默认10;
-G, --disable_trim_poly_g 取消-g的功能;
## polyX tail trimming
-x, --trim_poly_x 截取3‘末端polyX
--poly_x_min_len 检测read末尾的polyX的长度,默认10;
## 通过质量值对每条read进行裁剪
-5, --cut_front 从read的5‘端至末尾移动窗口,去除窗口中平均质量值小于‘<‘阈值的碱基;
-3, --cut_tail 从read的3‘端值至开头移动窗口,去除窗口中平均质量值小于‘<‘阈值的碱基;
-r, --cut_right 从read的开头到末尾移动窗口,如果某一窗口的平均质量值小于阈值,去除窗口中的碱基及其右侧部分,并停止;
-W, --cut_window_size 滑动窗口过滤,这个类似于计算kmer,1~1000, 默认是4个碱基;
-M -W选择的窗口中,碱基平均质量值,范围1~36,默认是Q20,如果这个区域窗口平均低于20,则认为是一个低质量区域,处理掉;
## 质量过滤选项
-Q 控制是否去除低质量,默认自动去除,设置-Q关闭;
-q 设置低质量的标准,默认是15,也就是质量值小于15认为是低质量碱基,一般我们设置20,常说的Q20;
-u 低质量碱基所占百分比,并不是包含低质量碱基就把一条reads丢掉,而是设置一定的比例,默认40代表40%,也就是150bpreads,包含60个以上低质量的碱基就丢掉,只要有一条reads不满足条件就成对丢掉;
-n 过滤N碱基过多的reads,如果N碱基含量大于n,这条read/pair将被舍弃,默认5;
## 长度过滤选项
-L 关闭reads长度过滤选项;
-l 接一个长度值,小于这个长度reads被丢掉,默认是15,这个在处理非illumina测序数据时很有用。
## 低复杂度过滤
-y, --low_complexity_filter 使用低复杂度过滤,这里低复杂度的定义是与其下一个碱基不同的碱基比例(base[i] != base[i+1]).
-Y, --complexity_threshold 低复杂度的阈值(0~100),默认30;
## 根据indexes过滤reads--删除可能的污染
--filter_by_index1 specify a file contains a list of barcodes of index1 to be filtered out, one barcode per line (string [=])
--filter_by_index2 specify a file contains a list of barcodes of index2 to be filtered out, one barcode per line (string [=])
--filter_by_index_threshold the allowed difference of index barcode for index filtering, default 0 means completely identical. (int [=0])
## base correction by overlap analysis options
-c 是对overlap的区域进行纠错,所以只适用于pairend reads。
## UMI processing 分子标签处理
-U, --umi enable unique molecular identifier (UMI) preprocessing
--umi_loc specify the location of UMI, can be (index1/index2/read1/read2/per_index/per_read, default is none (string [=])
--umi_len if the UMI is in read1/read2, its length should be provided (int [=0])
--umi_prefix if specified, an underline will be used to connect prefix and UMI (i.e. prefix=UMI, UMI=AATTCG, final=UMI_AATTCG). No prefix by default (string [=])
--umi_skip if the UMI is in read1/read2, fastp can skip several bases following UMI, default is 0 (int [=0])
# overrepresented sequence analysis
-p, --overrepresentation_analysis enable overrepresented sequence analysis.
-P, --overrepresentation_sampling One in (--overrepresentation_sampling) reads will be computed for overrepresentation analysis (1~10000), smaller is slower, default is 20. (int [=20])
# reporting options
-j, --json 输出json格式报告文件名(string [=fastp.json])
-h, --html 输出html 格式报告文件名,可以用浏览器直接查看(string [=fastp.html])
-R, --report_title should be quoted with ‘ or ", default is "fastp report" (string [=fastp report])
# threading options
-w, --thread 使用线程数,默认是2(int [=2])
# 控制split选项,有时候单条reads文件太大,可以分割为多份分别比对,在合并bam结果,这样可以提高效率。
-s, --split 切割数目(2~999),默认是0,不分割
-S, --split_by_lines split output by limiting lines of each file with this option(>=1000), a sequential number prefix will be added to output name ( 0001.out.fq, 0002.out.fq...), disabled by default (long [=0])
-d, --split_prefix_digits 输出前缀位数,默认是4,0001,0002这种命名,如果设置为3,就是001,002这种;
# help
-?, --help 输出帮助信息
原文:https://www.cnblogs.com/dataanaly/p/13197991.html