fastp使用

news/2024/7/8 2:29:31 标签: fastp, 生信软件
 
fastp 下载及安装
# fastp只依赖于zlib(如果在编译fastp过程中出现“undefined reference to gzbuffer”错误,可更新zlib进行处理)
 
#安装方式一: 下载编译好二进制(仅适用于linux系统)
wget http://opengene.org/fastp/fastp
chmod a+x ./fastp
#安装方式二: 源码编译
git clone https://github.com/OpenGene/fastp.git
cd fastp
make
sudo make install
 
fastp输入输出
单端数据:read1通过-i或--in1输入,-o或者--out1特异性输出
双端数据:read2通过-I或--in2输入,-O或者--out2特异性输出
如果文件名是.gz,默认输出是gzip压缩文件
 
质量过滤
# 质量过滤
默认会进行低质过滤,如果不希望进行,可使用参数-Q或者“disable_quality_filtering”目前支持过滤通过N碱基的数量和不合格碱基的百分比。
    -q,--disable_quality_filtering 设置碱基的质量值。默认平均质量值>=Q15是合格的
    -u,--unqualified_percent_limit 允许多少百分比的碱基不合格(0~100)。默认40%
 
或者通过平均质量值过滤数据
    -e, --average_qual 如果一条reads的平均质量值小于平均质量值,即将这条reads或paire reads丢弃。默认0
 
# 长度过滤
默认进行长度过滤,可以通过参数-L或--disable_length_filtering禁用。最小长度要求可以用-l或--length_required指定
 
# 低复杂过滤
默认不进行低复杂过滤,可以通过参数-y或--low_complexity_filter进行低复杂序列过滤(ase[i] != base[i+1])。
低复杂序列阈值可以使用参数-Y或者--complexity_threshold进行指定,阈值的范围需在0~100之间,默认是30
 
 
接头过滤
 默认进行接头过滤,但可以使用参数-A或者--disable_adapter_trimming禁用,接头序列可自动地在PE/SE数据中发现。
SE数据,通过分析前1Mreads来评估接头,该评估方式不精确。可以通过参数-a或者--adapter_sequence 指定adapter序列。如果接头序列是指定的,自动检测接头序列被禁止。
PE数据,接头序列发现通过overlap分析,该方法粗暴快速,通常不需要输入接头序列,但是也可以通过参数--adapter_sequence指定read1中的接头序列,参数--adapter_sequence_r2指定read2上的接头序列。如果fastp寻找overlap失败(低复杂序列等等原因),则会使用指定的序列去trim接头。
PE数据,接头序列自动查找默认是禁用的,自接头可以通过overlap分析被trimmed,然而,也可以指定--detect_adapter_for_pe去调用
PE数据,如果指定接头序列或者自动检测接头序列fastp运行速度较慢,但输出的结果会更加干净,可能由于测序错误或者接头二聚体导致overlap分析失败
广泛使用的接头序列是Illumina Truseq接头,可将(--adapter_sequence=AGATCGGAAGAGCACACGTCTGAACTCCAGTCA和--adapter_sequence_r2=AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGT)加入到命令行或者通过指定detect_adapter_for_pe自动发现
fastp包含一些内置已知的接头序列用于更好的发现序列中的接头
 
 
具体参数见 fastp -h
 
usage: ./fastp [options] ...
options:
  -i, --in1                            read1 input file name (string [=])
  -o, --out1                           read1 output file name (string [=])
  -I, --in2                            read2 input file name (string [=])
  -O, --out2                           read2 output file name (string [=])
      --unpaired1                      for PE input, if read1 passed QC but read2 not, it will be written to unpaired1. Default is to discard it. (string [=])
      --unpaired2                      for PE input, if read2 passed QC but read1 not, it will be written to unpaired2. If --unpaired2 is same as --umpaired1 (default mode), both unpaired reads will be written to this same file. (string [=])
      --failed_out                     specify the file to store reads that cannot pass the filters. (string [=])
  -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.
  -6, --phred64                        indicate the input is using phred64 scoring (it'll be converted to phred33, so the output will still be phred33)
  -z, --compression                    compression level for gzip output (1 ~ 9). 1 is fastest, 9 is smallest, default is 4. (int [=4])
      --stdin                          input from STDIN. If the STDIN is interleaved paired-end FASTQ, please also add --interleaved_in.
      --stdout                         stream passing-filters reads to STDOUT. This option will result in interleaved FASTQ output for paired-end output. Disabled by default.
      --interleaved_in                 indicate that <in1> is an interleaved FASTQ which contains both read1 and read2. Disabled by default.
      --reads_to_process               specify how many reads/pairs to be processed. Default 0 means process all reads. (int [=0])
      --dont_overwrite                 don't overwrite existing files. Overwritting is allowed by default.
  -V, --verbose                        output verbose log information (i.e. when every 1M reads are processed).
  -A, --disable_adapter_trimming       adapter trimming is enabled by default. If this option is specified, adapter trimming is disabled
  -a, --adapter_sequence               the adapter for read1. For SE data, if not specified, the adapter will be auto-detected. For PE data, this is used if R1/R2 are found not overlapped. (string [=auto])
      --adapter_sequence_r2            the adapter for read2 (PE data only). This is used if R1/R2 are found not overlapped. If not specified, it will be the same as <adapter_sequence> (string [=auto])
      --adapter_fasta                  specify a FASTA file to trim both read1 and read2 (if PE) by all the sequences in this FASTA file (string [=])
      --detect_adapter_for_pe          by default, the auto-detection for adapter is for SE data input only, turn on this option to enable it for PE data.
  -f, --trim_front1                    trimming how many bases in front for read1, default is 0 (int [=0])
  -t, --trim_tail1                     trimming how many bases in tail for read1, default is 0 (int [=0])
  -b, --max_len1                       if read1 is longer than max_len1, then trim read1 at its tail to make it as long as max_len1. Default 0 means no limitation (int [=0])
  -F, --trim_front2                    trimming how many bases in front for read2. If it's not specified, it will follow read1's settings (int [=0])
  -T, --trim_tail2                     trimming how many bases in tail for read2. If it's not specified, it will follow read1's settings (int [=0])
  -B, --max_len2                       if read2 is longer than max_len2, then trim read2 at its tail to make it as long as max_len2. Default 0 means no limitation. If it's not specified, it will follow read1's settings (int [=0])
  -g, --trim_poly_g                    force polyG tail trimming, by default trimming is automatically enabled for Illumina NextSeq/NovaSeq data
      --poly_g_min_len                 the minimum length to detect polyG in the read tail. 10 by default. (int [=10])
  -G, --disable_trim_poly_g            disable polyG tail trimming, by default trimming is automatically enabled for Illumina NextSeq/NovaSeq data
  -x, --trim_poly_x                    enable polyX trimming in 3' ends.
      --poly_x_min_len                 the minimum length to detect polyX in the read tail. 10 by default. (int [=10])
  -5, --cut_front                      move a sliding window from front (5') to tail, drop the bases in the window if its mean quality < threshold, stop otherwise.
  -3, --cut_tail                       move a sliding window from tail (3') to front, drop the bases in the window if its mean quality < threshold, stop otherwise.
  -r, --cut_right                      move a sliding window from front to tail, if meet one window with mean quality < threshold, drop the bases in the window and the right part, and then stop.
  -W, --cut_window_size                the window size option shared by cut_front, cut_tail or cut_sliding. Range: 1~1000, default: 4 (int [=4])
  -M, --cut_mean_quality               the mean quality requirement option shared by cut_front, cut_tail or cut_sliding. Range: 1~36 default: 20 (Q20) (int [=20])
      --cut_front_window_size          the window size option of cut_front, default to cut_window_size if not specified (int [=4])
      --cut_front_mean_quality         the mean quality requirement option for cut_front, default to cut_mean_quality if not specified (int [=20])
      --cut_tail_window_size           the window size option of cut_tail, default to cut_window_size if not specified (int [=4])
      --cut_tail_mean_quality          the mean quality requirement option for cut_tail, default to cut_mean_quality if not specified (int [=20])
      --cut_right_window_size          the window size option of cut_right, default to cut_window_size if not specified (int [=4])
      --cut_right_mean_quality         the mean quality requirement option for cut_right, default to cut_mean_quality if not specified (int [=20])
  -Q, --disable_quality_filtering      quality filtering is enabled by default. If this option is specified, quality filtering is disabled
  -q, --qualified_quality_phred        the quality value that a base is qualified. Default 15 means phred quality >=Q15 is qualified. (int [=15])
  -u, --unqualified_percent_limit      how many percents of bases are allowed to be unqualified (0~100). Default 40 means 40% (int [=40])
  -n, --n_base_limit                   if one read's number of N base is >n_base_limit, then this read/pair is discarded. Default is 5 (int [=5])
  -e, --average_qual                   if one read's average quality score <avg_qual, then this read/pair is discarded. Default 0 means no requirement (int [=0])
  -L, --disable_length_filtering       length filtering is enabled by default. If this option is specified, length filtering is disabled
  -l, --length_required                reads shorter than length_required will be discarded, default is 15. (int [=15])
      --length_limit                   reads longer than length_limit will be discarded, default 0 means no limitation. (int [=0])
  -y, --low_complexity_filter          enable low complexity filter. The complexity is defined as the percentage of base that is different from its next base (base[i] != base[i+1]).
  -Y, --complexity_threshold           the threshold for low complexity filter (0~100). Default is 30, which means 30% complexity is required. (int [=30])
      --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])
  -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])
  -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])
  -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])
  -j, --json                           the json format report file name (string [=fastp.json])
  -h, --html                           the html format report file name (string [=fastp.html])
  -R, --report_title                   should be quoted with ' or ", default is "fastp report" (string [=fastp report])
  -w, --thread                         worker thread number, default is 2 (int [=2])
  -s, --split                          split output by limiting total split file number with this option (2~999), a sequential number prefix will be added to output name ( 0001.out.fq, 0002.out.fq...), disabled by default (int [=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            the digits for the sequential number padding (1~10), default is 4, so the filename will be padded as 0001.xxx, 0 to disable padding (int [=4])
      --cut_by_quality5                DEPRECATED, use --cut_front instead.
      --cut_by_quality3                DEPRECATED, use --cut_tail instead.
      --cut_by_quality_aggressive      DEPRECATED, use --cut_right instead.
      --discard_unmerged               DEPRECATED, no effect now, see the introduction for merging.
  -?, --help                           print this message

 


http://www.niftyadmin.cn/n/1721985.html

相关文章

python进行信息匹配

最近需要根据样本编号比对信息&#xff0c;故写了脚本进行处理&#xff0c;满足日常的匹配需求&#xff0c;初步编写的脚本如下&#xff1a; # —*—coding:utf-8_*_ # date: 2020-05-04import xlrd import csv import argparse,os,io def pre_prepration(cur_path,sample_lis…

数据可视化--表格融合练习

数据可视化--表格融合练习pd.merge()函数说明代码演练参考书籍pd.merge()函数说明 使用共有列作为两个数据框数据融合的依据&#xff0c;主要使用pd.merge()函数&#xff1a; 参数说明&#xff1a; left: 传递左表数据right: 传递右表数据how: 数据融合方式 left:保留左表的数…

练习系列:Python字典:一键对应多值

需求&#xff1a; 遍历文本文件&#xff0c;生成一键对应多值的字典&#xff0c;如下所示&#xff1a; 文本文件内容("\t"分割字符串)&#xff1a; “”" A 1 A 2 A 3 B c B d C 4 C 5 C e “”" 目标生成文件格式&#xff1a; target_dict {“A”:[1,2,3…

从分析结果中根据list提取突变信息

# _*_coding:utf-8_*_ # author: 稻田工作者 # date: 2020-06-13"""根据原始样本对应的突变信息从数据分析文件中提取检出结果&#xff0c;如&#xff1a; 原始样本LC-BR3对应的突变信息如下&#xff1a; NM_000245.2:exon14_intron14:c.3028_302816del17:p.? …

bwa mem 报错处理:[mem_sam_pe] paired reads have different names

背景&#xff1a; 从samtools sort 默认排序后的bam文件中提取fastq序列并对其格式化&#xff0c;对格式化后的fastq文件重新比对到参考基因组&#xff0c;报错如下&#xff1a;”[mem_sam_pe] paired reads have different names: “A00575:297:HWHKYDMXX:1:1331:22372:31814…

python windows环境下批量修改文件的创建时间、访问时间、修改时间

引用&#xff1a;https://blog.csdn.net/dengnihuilaiwpl/article/details/86551720 常见的修改文件时间有两种方式&#xff1a; 方式一&#xff1a;修改访问和修改时间&#xff1b; 使用utime函数 方法二&#xff1a;修改创建时间 使用pywin32file库 以下代码可以实现两种…

pip更新时出错pip install --upgrade pip

pip更新时出错pip install --upgrade pip 今天在配置电脑的时候安装anaconda后&#xff0c;在用pip下载包时&#xff0c;照例pip install --upgrade pip更新pip却出现如下错误 这是一个下载解压工具结果安装包是压缩包的烦恼呀。 看论坛里大家众说纷纭&#xff0c;挨个试了试…

pip安装包时ImportError: cannot import name 'main'

使用标准的 pip install packge时出现的错误 解决办法&#xff1a; python -m pip install packge如&#xff1a; python -m pip install numpy