搜索
查看: 9929|回复: 2

[alignment] bam文件里面的测序质量值问题 phred64 vs phred33

[复制链接]

365

主题

513

帖子

1717

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1717
发表于 2017-8-26 21:06:46 | 显示全部楼层 |阅读模式
本帖最后由 ydchen 于 2017-8-26 21:09 编辑

现在主流的测序仪都是phred33系统的质量值,也就是说你看到你的fastq序列的第四行质量值应该都是大写字母。
如果你看到是小写字母,那么你就麻烦了,需要格外的主意。

我就是忽略了,导致我的bam文件里面是phred64,这样GATK就报错。

##### ERROR ------------------------------------------------------------------------------------------
##### ERROR A USER ERROR has occurred (version 3.5-0-g36282e4):
##### ERROR
##### ERROR This means that one or more arguments or inputs in your command are incorrect.
##### ERROR The error message below tells you what is the problem.
##### ERROR
##### ERROR If the problem is an invalid argument, please check the online documentation guide
##### ERROR (or rerun your command with --help) to view allowable command-line arguments for this tool.
##### ERROR
##### ERROR Visit our website and forum for extensive documentation and answers to
##### ERROR commonly asked questions http://www.broadinstitute.org/gatk
##### ERROR
##### ERROR Please do NOT post this error to the GATK forum unless you have really tried to fix it yourself.
##### ERROR
##### ERROR MESSAGE: SAM/BAM/CRAM file htsjdk.samtools.SamReader$PrimitiveSamReaderToSamReaderAdapter@33ffe19c appears to be using the wrong encoding for quality scores: we encountered an extremely high quality score of 65. Please see https://www.broadinstitute.org/gatk/guide?id=6470 for more details and options related to this error.
##### ERROR ------------------------------------------------------------------------------------------


刚开始看到这个错误一脸懵逼,这个pipeline我用了3年了,木有任何问题。

仔细谷歌才发现是这个问题,这个数据是一个朋友委托我处理的公共数据,而公共数据一般很老旧。

搜索了一下,有一个脚本可以解决

[Shell] 纯文本查看 复制代码
samtools view file.bam | \
perl -lane 'if('/^#/){print; next;}  
  @qual=split //, $F[$qualIndex]; $_=chr(ord($_)+33) for(@qual); $F[$qualIndex]=join("",@qual); print join("\t",@F)' | \
samtools -bS > file.corrected.bam


其实就是改变第11列即可。

回复

使用道具 举报

29

主题

131

帖子

1208

积分

金牌会员

Rank: 6Rank: 6

积分
1208
发表于 2017-8-26 22:00:48 | 显示全部楼层
GATK 有专门参数处理这个问题哈,我也遇到过,我是在BQSR步骤中出现的,使用-fixMisencodedQuals就好了

https://software.broadinstitute. ... article.php?id=6470

不知道你是不是也是这个哈
回复 支持 反对

使用道具 举报

12

主题

26

帖子

592

积分

版主

Rank: 7Rank: 7Rank: 7

积分
592
发表于 2017-12-19 13:11:24 | 显示全部楼层
我今天也碰到这个问题。,加了-fixMisencodedQuals就可以了.多谢分享
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|生信技能树 ( 粤ICP备15016384号-2  

GMT+8, 2023-6-9 19:16 , Processed in 0.129480 second(s), 31 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.