刘小泽写于2020.4.6
记录一个小知识点,比对后SAM/BAM的CIGAR这一列中的含义,重点是soft clipping 和 hard clipping的理解
首先了解SAM/BAM中的CIGAR含义
看这篇:再次理解SAM/BAM操作
根据sam的帮助文档:http://samtools.sourceforge.net/SAM1.pdf
op Description
M Alignment match (can be a sequence match or mismatch
I Insertion to the reference
D Deletion from the reference
N Skipped region from the reference
S Soft clip on the read (clipped sequence present in <seq>)
H Hard clip on the read (clipped sequence NOT present in <seq>)
P Padding (silent deletion from the padded reference sequence)
然后来看什么是clipped alignment和spliced alignment
-
clipped alignment:read只有中间部分能比对上,而两侧在比对过程中被忽略
# 3S4M1D5M3S(3 soft, 4 match, 1 deletion, 5 match and 3 soft) Read: CGATTGC-TCCGCCAGG | |||| |||||| Ref:CCGATCGAGACTTGCGTCCGCCTCCCGATCA
-
spliced alignment:read一端比对上,跳过了中间,然后另一端也比对上【CIGAR中用“N”表示】如果是转录组数据的比对结果,N表示内含子;其他类型组学数据中N也可以用,但没有意义,和deletion一个意思(参考:https://www.biostars.org/p/96347/)
# 3M1D4M13N5M # This only makes sense when you're aligning things like cDNA/expression data. REF: ATCGATCGATCGATCGATCGATCGATCGATCG |||||||||||||||||||||||||| QUERY: ATC-ATCG-------------ATCAT # 如果是DNA测序reads的比对,也可以全部用D来表示:即3M1D4M13D3M
然后clipped alignment有两种形式
分为soft和hard(在SAM/BAM的CIGAR列分别用“S”和“H”表示),它们很相似,不同是:
-
soft-clipped: bases in 5' and 3' of the read are NOT part of the alignment. 这部分没比对上但保留在了SAM/BAM比对结果中
-
hard-clipped: bases in 5' and 3' of the read are NOT part of the alignment AND those bases have been removed from the read sequence in the BAM file 这部分没比对上并且没有保留在SAM/BAM比对结果中
# 还是上面👆clipped alignment的例子: # 如果是:3H4M1D5M3H,那么保留在SAM中的结果就是:TTGCTCCGCC,而不是CGATTGCTCCGCCAGG(虽然CGA没有比对上,但依然在soft clipped结果中保留下来) Read: TTGC-TCCGCC | |||| |||||| Ref:CCGATCGAGACTTGCGTCCGCCTCCCGATCA
- soft-clipped: if your cigar is
10S10M10S
then the SEQ and base-quals will be 30 bases long. 利用soft-clipping算法可以避开由于read两侧质量低而导致整条read比对不上的现象。不过即使被标记为soft clipped保留下来,依然不会在找变异、基因组浏览器可视化、计算覆盖度等过程中被使用(例如https://www.biostars.org/p/255062/中就提到:在计算基因组覆盖度时,几乎全部工具bamCoverage/multiBamSummary
甚至samtools view -c
都会忽略soft clip情况) - hard-clipped: if your cigar is:
10H10M10H
then the SEQ will only be 10 bases long.
那么什么时候标记Hard clip,什么时候标记Soft clip呢?
参考:https://www.biostars.org/p/310722/ 和 https://www.biostars.org/p/109333/
-
in bwa, HARD clipping is used for supplementary reads.
-
if the read has a chimeric alignment, the paired
or the top hit uses soft clipping ;All the other hits part of the chimeric alignment will use hard clipping -
chimeric alignment: “嵌合比对” 的形成是由于一条测序read比对到基因组上时分别比对到两个不同的区域,而这两个区域基本没有overlap。因此它在sam文件中需要占用多行记录显示。只有第一个记录被称作"representative",其他的都是"supplementary"【Chimeric reads are also called split reads】;RNA-seq中的chimeric read或许可以说明有融合基因存在,但在基因组中一般作为结构变异的证据
欢迎关注我们的公众号~_~
我们是两个农转生信的小硕,打造生信星球,想让它成为一个不拽术语、通俗易懂的生信知识平台。需要帮助或提出意见请后台留言或发送邮件到jieandze1314@gmail.com
网友评论