如何利用fastq去除接头低质量的数据和接头

如何去除测序数据中的接头和低质量的reads?
已有 4320 次阅读
|个人分类:|系统分类:
高通量测序数据下机后得到了fastq的raw_data,通常测序公司在将数据返还给客户之前会做“clean”处理,即得到clean_data。然而,这些clean_data是否真的“clean”呢?首先,我们应该做一下质控。如果质控不合格,就需要一些处理,比如去接头、去除量的reads。(1)去除测序数据中的接头(用到的是fastx_toolkit里面的fastx_clipper工具):Usage: fastx_clipper [-h] [-a ADAPTER] [-D] [-l N] [-n] [-d N] [-c] [-C] [-o] [-v] [-z] [-i INFILE] [-o OUTFILE] &#去掉接头序列 &[-a ADAPTER] =接头序列(默认为CCTTAAGG) &[-l N] & & & = 忽略那些碱基数目少于N的reads,默认为5 &[-d N] & & & = 保留接头序列后的N个碱基默认 &-d 0 &[-c] & & & & = 放弃那些没有接头的序列. &[-C] & & & & = 只保留没有接头的序列. &[-k] & & & & = 报告只有接头的序列. &[-n] & & & & = 保留有N多序列,默认不保留 &[-v] & & & & =详细-报告序列编号 &[-z] & & & & =压缩输出. &[-D] & & & = 输出调试结果. &[-M N] & =要求最小能匹配到接头的长度N,如果和接头匹配的长度小于N不修剪 &[-i INFILE] &= 输入文件 &[-o OUTFILE] = 输出文件Example: fastx_clipper -a AGATCGGAAGAGCACACG -l 25 -d 0 -Q 33 -i SRR.fastq -o SRR_trimmed.fastq(注:-l参数,即忽略那些碱基数目少于N的reads。默认的是5,而对于tophat来说,如果reads长度小于20,就会发出警告。因此,考虑到充分利用这些测序数据同时不损失比对的特异性,这里-l参数,取值为25。-Q参数,对于illumina测序来说,这个参数也是必须要加的,因为illumina测序在给单个碱基作质量打分的时候,加上了33,然后才转成的ASC II, 因此在这里需要加 -Q 33. 否则就会报这样的错误“fastx_clipper: Invalid quality score value (char '#' ord 35 quality value -29) on line 4.”)(2)去除测序数据中的低质量reads(用到的是fastx_toolkit里面的fastq_quality_filter工具):Usage:fastq_quality_filter [-h] [-v] [-q N] [-p N] [-z] [-i INFILE] [-o OUTFILE]过滤低质量序列 &[-q N] & & & = 最小的需要留下的质量值 &[-p N] & & & = 每个reads中最少有百分之多少的碱基需要有-q的质量值 &[-z] & & & & =压缩输出 &[-v] & & & =详细-报告序列编号,如果使用了-o则报告会直接在STDOUT,如果没有则输入到STDERRExample: fastq_quality_filter -q 20 -p 80 -Q 33 -i SRR.fastq -o SRR_filtered.fastq(注:-q参数,即是指最小需要留下的质量值,这里需要保留Q20(99.99%)以上的,所以对应的是20。-p参数,即是指每个reads中最少有百分之多少的碱基需要有-q的质量值,这里我们要求的是一条reads中最少有80%以上的碱基质量值达到Q20我们才作保留,因此对应的是80.&-Q参数,对于illumina测序来说,这个参数也是必须要加的,因为illumina测序在给单个碱基作质量打分的时候,加上了33,然后才转成的ASC II, 因此在这里需要加 -Q 33. 否则就会报这样的错误“fastx_clipper: Invalid quality score value (char '#' ord 35 quality value -29) on line 4.”)(注:如果在做fastq_quality_filter之后,QC结果仍然可以看到reads的尾部有低质量的reads,此时可以将-p参数调大,比如调至90或者99)。
转载本文请联系原作者获取授权,同时请注明本文来自熊朝亮科学网博客。链接地址:
上一篇:下一篇:
当前推荐数:1
评论 ( 个评论)
扫一扫,分享此博文
作者的其他最新博文
热门博文导读
Powered by
Copyright &AdapterRemoval: easy cleaning of next-generation sequencing readsBMC Res NotesS. Lindgreen
BACKGROUND: With the advent of next-generation sequencing there is an increased demand for tools to pre-process and handle the vast amounts of data generated. One recurring problem is adapter contamination in the reads, i.e. the partial or complete sequencing of adapter sequences. These adapter sequences have to be removed as they can hinder correct mapping of the reads and influence SNP calling and other downstream analyses. FINDINGS: We present a tool called AdapterRemoval which is able to pre-process both single and paired-end data. The program locates and removes adapter residues from the reads, it is able to combine paired reads if they overlap, and it can optionally trim low-quality nucleotides. Furthermore, it can look for adapter sequence in both the 5' and 3' ends of the reads. This is a flexible tool that can be tuned to accommodate different experimental settings and sequencing platforms producing FASTQ files. AdapterRemoval is shown to be good at trimming adapters from both single-end and paired-end data. CONCLUSIONS: AdapterRemoval is a comprehensive tool for analyzing next-generation sequencing data. It exhibits good performance both in terms of sensitivity and specificity. AdapterRemoval has already been used in various large projects and it is possible to extend it further to accommodate application-specific biases in the data.
AdapterRemoval:下一代测序片段的容易清理
背景:随着下一代测序的到来,有对预处理和操作所产生的大量数据的工具的越来越多的需要。一个重复性问题是片段(reads)中的接头污染,即部分或全部接头序列的测序。由于接头序列能够阻碍片段的正确比对,并影响SNP识别和其他下游分析,所以这些接头序列必需被去除。发现:我们提出了一个叫做AdapterRemoval的工具,它能够预处理单端和双端数据。该程序定位并去除片段中的接头残基,它能够合并双端片段(若它们重叠),并能够可选择地去除低质量核苷酸。此外,它能够寻找片段5'和3'末端的接头序列。这是一个灵活的工具,它能够被调整以适应产生FASTQ文件的不同实验环境和测序平台。显示AdapterRemoval擅长从单端和双端数据中去除接头。结论:AdapterRemoval是一个分析下一代测序数据的综合工具。它在敏感性和特异性方面表现出良好的性能。AdapterRemoval已经被用于各种大型项目,并可能扩展以适应数据中的应用特异性偏差。/p/adapterremoval/
http://dx.doi.org/10.00-5-337http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3532080/pdf/-337.pdf
下载次数:0
超级管理员
最近编辑者
编辑次数: 1次
当前时区GMT+8
现在时间是 12-31 06:12Enterprise Solutions
Mobile Apps
Engineering, R&D
Web & Software
Finance, Statistics & Business Analysis
Need Help?
Premium Support
Work with Us
Initiatives
WOLFRAM LANGUAGE IMPORT/EXPORT FORMAT
FASTQ (.fastq, .fq)
support all common variants of the FASTQ file format, including short-read sequencing data and long sequences.
■ MIME type: chemical/seq-na-fastq
■ FASTQ molecular biology format.
■ Standard format for storing and exchanging DNA sequences with base qualities.
■ Plain text format.
■ Stores nucleic acid sequences and base qualities as character strings.
■ Various conventions are in use to represent meta-information.
[&file.fastq&] imports DNA sequences from a FASTQ file.
[&file.fastq&,expr] exports a sequence or a list of sequences to the FASTQ format.
[&file.fastq&] returns a list of strings representing the sequences stored in the file.
[&file.fastq&,{seq,qual}] exports a character string representing a DNA sequence with base qualities to FASTQ.
[&file.fastq&,{{seq1,seq2,…},{qual1,qual2,…}}] exports multiple DNA sequences with base qualities.
[&file.fastq&,elem] imports the specified element from a FASTQ file.
[&file.fastq&,{{elem1,elem2,…}}] imports multiple elements.
The import format can be specified with [&file&,&FASTQ&] or [&file&,{&FASTQ&,elem,…}].
[&file.fastq&,expr,elem] creates a FASTQ file by treating expr as specifying element elem.
[&file.fastq&,{expr1,expr2,…},{{elem1,elem2,…}}] treats each expri as specifying the corresponding elemi.
[&file.fastq&,expr,opt1-&val1,…] exports expr with the specified option elements taken to have the specified values.
[&file.fastq&,{elem1-&expr1,elem2-&expr2,…},&Rules&] uses rules to specify the elements to be exported.
See the reference pages for full general information on
support the FASTQ format.
&Elements&list of elements and options available in this file
&Rules&full list of rules for each element and option
&Options&list of rules for options, properties, and settings
Data representation elements:
&Header&raw header lines
&Sequence&DNA sequences as a list of strings
&Qualities&base qualities as a list of strings
uses the &Sequence& element by default for the FASTQ format.
Additional data elements:
&Data&&Header&, &Sequence&, and &Qualities& elements combined in a list
&LabeledData&list of rules for each sequence stored in the file
The Wolfram Language uses the standard IUB/IUPAC abbreviations for nucleic acids:
Aadenosine
Tthymidine
Rpurine (G or A)
Ypyrimidine (T or C)
Kketone (G or T)
Mamino group (A or C)
Sstrong interaction (G or C)
Wweak interaction (A or T)
BC or G or T
DA or G or T
HA or C or T
VA or C or G
Nany nucleic acid (A or C or G or T)
-gap of indeterminate length
The Wolfram Language uses ASCII characters for the base qualities.
&LineWidth&70maximum number of characters in a line
This reads the raw header lines from a sample FASTQ file:
Out[1]//Short=
Read the DNA sequence:
Out[1]//Short=
Read the DNA sequence with qualities:
This converts a short sequence to the FASTQ format, automatically adding default header information:
This exports two sequences:
This exports a pair of headers and sequences:
Importing the previous output using the &Data& element gives raw headers and sequences:
Import as a list of rules:
       
Introduced in 2012 (9.0)
Please complete this field.
Name (optional)
Email address (optional)
Send Feedback
For Customers
Public Resources
Enable JavaScript to interact with content and submit forms on Wolfram websites.生物信息学(17)
1,拿到测序结果,是fastq.gz格式的压缩文件,(批量)解压得到& (可以不用解压)
Sample_1R__GTCCGC_L001_R1.fastq   Sample_1R__GTCCGC_L001_R2.fastq
注:该文件是双向测序所得的结果,所以有1,2之分
2,拿到原始文件后我们需要对测序质量进行一个评估 ,使用软件为FastQC&
nohup perl /home/lixiangyong/software/FastQC/fastqc -o qc --noextract -f fastq
Sample_1R__GTCCGC_L001_R1.fastq Sample_1R__GTCCGC_L001_R2.fastq-o 选择一个输出的文件夹(我选的是qc,注意,该程序不会自己创建文件夹)
--noextract&输出的结果是.zip文件,默认自动解压缩,命令里加上--noextract则不解压缩
简便点可以这样(fastqc 可以处理gz压缩文件)
fadtqc *.R1.fastq.gz
*R2.fastq.gz
检测完毕后会得到.html文件,里面有关于这个测序结果的之来年个报告(那个压缩包里面就是.html里面的图片,没啥用)
根据这个结果,我们会发现以下问题,针对这些问题,需要对序列进行处理。
3,清理reads,分为好几步 &
清理的原则是
1含有过多non-ATCG碱基N的reads &
2测序质量较低的碱基数占的比例过高的reads &(例如序列前几个位点)
3含有Primer/Adaptor(接头)的reads&
nohup perl /home/Software/NGSQCToolkit_v2.3.3/QC/IlluQC_PRLL.pl -pe /home/data/RNA2016bak/Sample_1R__GTCCGC_L001_R1.fastq Sample_ye__GTCCGC_L001_R2.fastq 2 5 -c 4 -l 70 -s 20 -o Filename/ &
& 使用软件为
 NGSQCToolkit_v2.3.3    中的 IlluQC_PRLL.pl
&然后是参数,可以--help查看具体的规则
根据测序及其,1.8版本以后的都选5
选用的cpu多点,相对快一些
去除了数据中碱基质量低于20(q20)的为低质量碱基; ( ‘-l’ 参数)低质量碱基在reads中比例 &30% 的为低质量reads
-o 选着输出的文件夹
3.2 对reads进行trim,剪裁,
根据前面FastQC的结果,我去掉了5‘端15个碱基,因为我们发现在序列的前15个bp 位点ATCG的比例比那话较大,表明这部分数据不可靠,理论上每个位点ATCG出现的概率是一定的,同时去除了长度小于25的reads(默认20)
TrimmingReads.pl
nohup perl /home/lixiangyong/software/NGSQCToolkit_v2.3.3/Trimming/TrimmingReads.pl -i Sample_gen__GTGAAA_L001_R1.fastq_filtered_trm
-l 15 -n 25
3.3 去掉接头序列
此处使用的软件是FastX
nohup /home/software/FastX/fastx_clipper -a ./a.txt G -l 25 -d 0 -Q 33 -i ../hua_R2.fastq -o trimmed-hua-R2.fastq &
其中 a.txt 里面放的是我们的接头序列,因为我们去掉的接头序列不止一个,如5‘3’的,为了保证数据准确他的样本的接头也一快放在里面去掉
也可以像帖子一样
/blog-439.html
fastx_clipper -a AGATCGGAAGAGCACACG -l 25 -d 0 -Q 33 -i SRR.fastq -o SRR_trimmed.fastq
/content/14/351.shtml
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:10672次
排名:千里之外
原创:45篇
转载:28篇
(10)(1)(2)(7)(18)(28)(4)(1)(2)Roche454测序得到的sff数据如何转换为fastq格式
Roche454测序得到的sff数据如何转换为fastq格式
方法一、使用python脚本sff_extract.py,下载及使用方法地址av.upv.es/sff_extract/usage.html标准用法:python sff_extract.py -s seq.fasta -q seq.qual -x anci.xml& my_454_file.sffs for the sequence file,q for the quality file andx for the ancilliary xml file.python sff_extract.py&& my_454_file.sff,直接加sff文件名,不使用其他参数,则可以直接生成fastq文件注意:该方法不会把测序生成的序列开头几个无用碱基去除掉,所以推荐使用下一种方法。方法二、使用454的Analysis Tools下载地址:/products/analysis-software/使用其中的sffinfo提取sff文件中的序列及得分,即fasta文件和qual文件sffinfo&-s&-n&file.sff&&&file.fastasffinfo&-q -n&file.sff&&&file.qual 小写字母代表的是低质量的base,如果不加-n,软件会自动将低质量的删掉,因此我们如果要保留就需要加-n,如果不要保留,直接sffinfo&-s&file.sff&&&file.fasta得到这两个文件后用Crumbs中的fastqual_to_fastq脚本进行整合成fastq格式,fastaqual_to_fastq file.fasta file.qual。以下介绍Crumbs的安装:1、下载av.upv.es/seq_crumbs/available_crumbs.html 2、安装biopython,有两种方法如下方法一:使用apt-get install方式安装 sudo apt-get install python-biopython 只有一行命令,可是这种方法安装的不是最新版本,很多新的功能不能用,非常不爽,不建议使用这种方法安装。 方法二:使用easy_install安装 (1)安装python-dev,不然会出现Setup script exited with error: command ‘gcc’ failed with exit status 1错误 sudo apt-get install python-dev (2)安装easy_install工具 sudo apt-get install python-setuptools (3)安装biopythonsudo easy_install biopython,开始自动下载安装 sudo easy_install -f http://biopython.org/DIST/ biopython& (DIST/和biopython之间有个空格)&如果numpy安装出现问题,则使用命令sudo easy_install python-numpy尝试重新安装,如果仍不能安装好,只能用(4)中的方法继续安装,否则可以跳过(4),由于biopython会默认装到该路径下/usr/local/lib/python2.7/dist-packages/biopython-1.61-py2.7-linux-x86_64.egg,因此有时在python中调用时会找不到,所以需要首先添加到python path中,类似于添加普通的环境变量:export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/dist-packages/biopython-1.61-py2.7-linux-x86_64.egg(4) 安装Numpysudo apt-get install python-numpy 从http://numpy.scipy.org/下载numpy,现在的最新版本是numpy-1.6.1.tar.gz tar -xzvpf numpy-1.6.1.tar.gz cd numpy-1.6.1/ python setup.py build sudo python setup.py install 还可以继续安装一些其它的dependencies,如flex,ReportLab等等,暂时不装,需要的时候再装也可以。测试biopython是否安装好:进入pyhton,输入import Bio,如果不提示找不到该模块,则证明安装完成。
感谢关注 Ithao123Python频道,是专门为互联网人打造的学习交流平台,全面满足互联网人工作与学习需求,更多互联网资讯尽在 IThao123!
Laravel是一套简洁、优雅的PHP Web开发框架(PHP Web Framework)。它可以让你从面条一样杂乱的代码中解脱出来;它可以帮你构建一个完美的网络APP,而且每行代码都可以简洁、富于表达力。
Hadoop是一个由Apache基金会所开发的分布式系统基础架构。
用户可以在不了解分布式底层细节的情况下,开发分布式程序。充分利用集群的威力进行高速运算和存储。
Hadoop实现了一个分布式文件系统(Hadoop Distributed File System),简称HDFS。HDFS有高容错性的特点,并且设计用来部署在低廉的(low-cost)硬件上;而且它提供高吞吐量(high throughput)来访问应用程序的数据,适合那些有着超大数据集(large data set)的应用程序。HDFS放宽了(relax)POSIX的要求,可以以流的形式访问(streaming access)文件系统中的数据。
Hadoop的框架最核心的设计就是:HDFS和MapReduce。HDFS为海量的数据提供了存储,则MapReduce为海量的数据提供了计算。
随着国内互联网的发展,产品经理岗位需求大幅增加,在国内,从事产品工作的大部分岗位为产品经理,其实现实中,很多从事产品工作的岗位是不能称为产品经理,主要原因是对产品经理的职责不明确,那产品经理的职责有哪些,本专题将详细介绍产品经理的主要职责
Swift是Apple在WWDC2014所发布的一门编程语言,用来撰写OS X和iOS应用程序[1]。在设计Swift时.就有意和Objective-C共存,Objective-C是Apple操作系统在导入Swift前使用的编程语言
Swift是供iOS和OS X应用编程的新编程语言,基于C和Objective-C,而却没有C的一些兼容约束。Swift采用了安全的编程模式和添加现代的功能来使得编程更加简单、灵活和有趣。界面则基于广受人民群众爱戴的Cocoa和Cocoa Touch框架,展示了软件开发的新方向。
IThao123周刊

我要回帖

更多关于 fastq 的文章

 

随机推荐