版本:0.20.1
fastp之前的版本不支持拼接,
-m, --merge for paired-end input, merge each pair of reads into a single read if they are overlapped. The merged reads will be written to the file given by --merged_out, the unmerged reads will be written to the files specified by --out1 and --out2. The merging mode is disabled by default.
--merged_out in the merging mode, specify the file name to store merged output, or specify --stdout to stream the merged output (string [=])
--include_unmerged in the merging mode, write the unmerged or unpaired reads to the file specified by --merge. Disabled by default.
-c, --correction enable base correction in overlapped regions (only for PE data), default is disabled
--overlap_len_require the minimum length to detect overlapped region of PE reads. This will affect overlap analysis based PE merge, adapter trimming and correction. 30 by default. (int [=30])
--overlap_diff_limit the maximum number of mismatched bases to detect overlapped region of PE reads. This will affect overlap analysis based PE merge, adapter trimming and correction. 5 by default. (int [=5])
--overlap_diff_percent_limit the maximum percentage of mismatched bases to detect overlapped region of PE reads. This will affect overlap analysis based PE merge, adapter trimming and correction. Default 20 means 20%. (int [=20])
本次测试的数据为PE250,共85,109对reads。
mkdir -p fastp
mkdir -p SE
ls *1.fastq.gz|while read id;
do
fastp -m -c --overlap_len_require 10 \
--overlap_diff_percent_limit 25 \
-i ${id%_*}_R1.fastq.gz -I ${id%_*}_R2.fastq.gz \
--merged_out ./SE/${id%_*}.clean.fq.gz \
--out1 ./SE/${id%_*}.unmerge1.fq.gz --out2 ./SE/${id%_*}.unmerge2.fq.gz \
-j ./fastp/${id%_*}.json -h ./fastp/${id%_*}.html;
done
主要参数说明:
-m开启merge模式;
-c 校准重叠区域内的碱基;
--overlap_len_require 设置重叠区最小长度;
--overlap_diff_limit 设置重叠区域的最大不匹配碱基数
--overlap_diff_percent_limit 设置重叠区域最大不匹配碱基数百分比
fastp拼接得到62,925条tag,未拼接成功21,543对reads。
mkdir -p flash
ls *1.fastq.gz |while read id;
do
flash ${id%_*}_R1.fastq.gz -O ${id%_*}_R2.fastq.gz \
-m 10 -M 100 -x 0.25 -z -o ${id%_*} -d ./flash
done
主要参数说明:
-m 拼接时overlap区的最小长度阈值,默认10bp;
-M 拼接时overlap区的最大长度阈值,默认65bp;
-x 拼接时overlap区允许的最大碱基错配比率(最大碱基错配数目/overlap区长度),默认为0.25;
-z 压缩输出文件;
-d 输出文件存放目录,默认当前工作目录
flash拼接得到78,054条tag,未拼接成功7,055对reads。
挑选一条tag比对拼接质量
fastp和flash拼接都得到一条445 bp的tag,唯一不同的是,在tag的257位,二者拼接的碱基不一样,查看原始序列
R1
R2
能看到247位两者的测序质量都是70(F),但R1碱基为T,R2碱基为A(T),此时软件不好区分,但是结合周围碱基的测序质量,R1的247位的碱基靠近末端,相邻碱基测序质量较差,而R1的199位靠近中间,相邻碱基测序质量稳定,因此判断247位处应该为A。即flash拼接的较好。