一般人都知道 H 和 S 的表面上的区别,即 S 就是 soft, H 就是 hard,S 后,序列里还是会保留序列的信息,而 H 则不会。

-------------------------------------------后面都不用看了,H和S没有区别,比对软件不能发现嵌合体--------------------------------------

但这只是表面上的,在深层次的意义上, H 和 S 又有什么本质的不同呢?

首先要了解嵌合体的概念:

嵌合体就是两个不同的序列错误的拼接到了一起,也就是一条序列分别比对到了 ref 的两个地方(这和多重比对、次级比对之间又有区别)

 

Example of extended CIGAR and the pileup output.

(a) Alignments of one pair of reads and three single-end reads.

(b) The corresponding SAM file. The ‘@SQ’ line in the header section gives the order of reference sequences. Notably, r001 is the name of a read pair. According to FLAG 163 (=1 + 2 + 32 + 128), the read mapped to position 7 is the second read in the pair (128) and regarded as properly paired (1 + 2); its mate is mapped to 37 on the reverse strand (32). Read r002 has three soft-clipped (unaligned) bases. The coordinate shown in SAM is the position of the first aligned base. The CIGAR string for this alignment contains a P (padding) operation which correctly aligns the inserted sequences. Padding operations can be absent when an aligner does not support multiple sequence alignment. The last six bases of read r003 map to position 9, and the first five to position 29 on the reverse strand. The hard clipping operation H indicates that the clipped sequence is not present in the sequence field. The NM tag gives the number of mismatches. Read r004 is aligned across an intron, indicated by the N operation.

(c) Simplified pileup output by SAMtools. Each line consists of reference name, sorted coordinate, reference base, the number of reads covering the position and read bases. In the fifth field, a dot or a comma denotes a base identical to the reference; a dot or a capital letter denotes a base from a read mapped on the forward strand, while a comma or a lowercase letter on the reverse strand.


clipped alignment因为着在比对过程中,并没有用到全部的read的序列,read两段的序列被截取了(clip or trim)。如下表示,即为clip alignment。

Alignment:
Read:          ACGGTTGCGTTAA-TCCGCCACG
|                           ||||||||| ||||||
Reference: TAACTTGCGTTAAATCCGCCTGG

与clipped alignment对应的是spliced alignment,即read的中间没有比对到而两段比对上了。对应的表示如下:

Alignment:
Read:          ACGGTTGCGTTAAGCTCATCCGCCACG
|                 |||||||||||||         |||||||||
Reference: ACGGTTGCGTTAA…..TCCGCCACG

clip alignment对应的CIGAR表示有两种S (soft clip) 和H (hard clip)。
BWA提到If the read has a chimeric alignment, the paired or the top hit uses soft clipping and is marked with neither 0x800 nor 0x100 bits. All the other hits part of the chimeric alignment will use hard clipping and be marked with 0x800 if option “-M” is not in use, or marked with 0x100 otherwise.

即如果发现嵌合比对,最好的比对top hit标记为soft clipping,其余的则标记为hard clipping。

如果是hard clip,则截取的部分不会在SAM文件对应的read中出现 (clipped sequences not present in SEQ),如果是soft clip (clipped sequences present in SEQ),则会出现。

Understand?

Ref:https://github.com/lh3/bwa/blob/master/NEWS.md

转自:http://wp.zxzyl.com/?p=131


理解1:

Hard masked bases do not appear in the SEQ string, soft masked bases do.

So, if your cigar is: `10H10M10H` then the SEQ will only be 10 bases long.

if your cigar is 10S10M10S then the SEQ and base-quals will be 30 bases long.

首先,结果展示方式有区别:​比如说10H10M10H,第10列的碱基序列只显示10bp;而如果是10S10M10S的话,就会显示30bp的序列,尽管开头和结尾的20bp也没比上。

In the case of soft-masking, even though the SEQ is present, it is not used by variant callers and not displayed when you view your data in a viewer. In either case, masked bases should not be used in calculating coverage.

在soft中,即使显示的序列比hard的要长,但是计算变异或可视化比对结果时,这些序列也不会被考虑。而且,2种情况计算覆盖度​时,mask的碱基都不会考虑。

例子:

20692128    97    viral_genome    21417    60    69M32S    chr7    101141242    0    TACATCTTCTCCCTCTCTCACGACACAAGAATTAGTCACATAGGGATGTTCTCGTAAATCTACATTATCTTACAAAAACATTTTTTAAAAATTTGCTAGGT (101bp)    GGGGGGGGGGGGGGEGGEGGGGGGGGGFGGGGGGGGGGGGGEGFFGGGGGGGFGGFGGGGEGGGGGGGGGGGEGEFFGGGFEGGGGGFGCGGGFBGGGBG@    NM:i:4    MD:Z:6G34G6C5C14    AS:i:49    XS:i:0    SA:Z:chr7,101141091,+,66S35M,60,0;
20692128    353    chr7    101141091    60    66H35M    =    101141242    252    ATCTTACAAAAACATTTTTTAAAAATTTGCTAGGT  (35bp)GGGGGGEGEFFGGGFEGGGGGFGCGGGFBGGGBG@    NM:i:0    MD:Z:35    AS:i:35    XS:i:23    SA:Z:gi|224020395|ref|NC_001664.2|,21417,+,69M32S,60,4;
20692128    145    chr7    101141242    60    101M    gi|224020395|ref|NC_001664.2|    21417    0    GCAACAGAGCGAGACCCTATATTCATGAGTGTTGCAATGAGCCAAGTAGTGGAGGTTGGCTTTTGAAGGCAGAAAAGGACTGAGAAAAGCTAACACAGAGA    FEGCGGGGGCGEFCDEEEEGGGGGGGGGGGGGGGEGGGGGGFGGGEGGG

理解2:

当同一条reads比对到不同chr时(嵌合reads),会以hard clip的显示显示。比如上面的例子,R1分别比到了viral基因组和chr7上(前面69bp比到viral,后面35比到chr7),R2比到了chr7。

sam格式详细说明见:http://davetang.org/wiki/tiki-index.php?page=SAM

Difference between Hard Clip(H) and Soft Clip(S) in Samtools CIGAR string的更多相关文章

  1. (转)开源项目miaosha(下)

    石墨文档:https://shimo.im/docs/2XlwliBQAYsKCHbq/ (二期)20.开源秒杀项目miaosha解读(下) [课程20]jmeter.xmind81.5KB [课程2 ...

  2. H.264学习笔记之一(层次结构,NAL,SPS)

    一 H.264句法 1.1元素分层结构 H.264编码器输出的Bit流中,每个Bit都隶属于某个句法元素.句法元素被组织成有层次的结构,分别描述各个层次的信息. 图1 H.264分层结构由五层组成,分 ...

  3. C语言中.h和.c文件解析(很精彩)

    C语言中.h和.c文件解析(很精彩)   简单的说其实要理解C文件与头文件(即.h)有什么不同之处,首先需要弄明白编译器的工作过程,一般说来编译器会做以下几个过程: 1.预处理阶段 2.词法与语法分析 ...

  4. C++中头文件(.h)和源文件(.cpp)都应该写些什么

    头文件(.h): 写类的声明(包括类里面的成员和方法的声明).函数原型.#define常数等,但一般来说不写出具体的实现. 在写头文件时需要注意,在开头和结尾处必须按照如下样式加上预编译语句(如下): ...

  5. 最简单的基于librtmp的示例:发布H.264(H.264通过RTMP发布)

    ===================================================== 最简单的基于libRTMP的示例系列文章列表: 最简单的基于librtmp的示例:接收(RT ...

  6. HEVC(H.265)标准的编码器(x265,DivX265)试用

    基于HEVC(H.265)的的应用级别的编码器发展的速度很快.所说的应用级别,就是指速度比较快的,有实际应用价值的编码器.目前可以直接使用的有两个:x265,DivX265. DivX265 DivX ...

  7. 在源文件(.c)和头文件(.h)中声明和定义的区别——C语言

    最近在看多文件编程的时候遇到的一个问题,本来以为理解了声明和定义的区别(然而并没有····),也算是重新认识了一次声明和定义,下面上代码 情形一:在源文件(.c)中 相信大部分读者对声明和定义的理解是 ...

  8. 黄聪:FFmpeg视频转码技巧之-crf参数(H.264篇)

    昨天,有个朋友给我出了个难题:他手上有一个视频,1080P的,49秒,200多兆:要求在确保质量的情况下把文件压缩到10M以内. 这是什么概念呢?按照文件大小10M来计算,码率是:10 x 8 / 4 ...

  9. C++ 中头文件(.h)和源文件(.cc)的写法简述

    用C++编写比较大型的项目时,文件的分割管理确实确实是非常必要的 .下面就非常简洁明了地谈谈头文件(.h)和源文件(.cc)应该怎么写. 头文件(.h):写类的声明(包括类里面的成员和方法的声明).函 ...

随机推荐

  1. Entity Framework 第三篇 实体特性声明

    Entity Framework中对实体的特性声明有着严格的要求 1.实体必须要有主键特性,但是如果实体没有主键特性那怎么办? public int ExecuteSqlCommand(string ...

  2. 2016 Al-Baath University Training Camp Contest-1 I

    Description It is raining again! Youssef really forgot that there is a chance of rain in March, so h ...

  3. Codeforces Round #372 (Div. 2) A

    Description ZS the Coder is coding on a crazy computer. If you don't type in a word for a c consecut ...

  4. collections在java中的常见用法

    1. 工具类collections用于操作集合类,如List,Set,常用方法有: 1) 排序(Sort) 使用sort方法可以根据元素的自然顺序 对指定列表按升序进行排序.列表中的所有元素都必须实现 ...

  5. Mysql-学习笔记(==》权限管理 十 三)

    -- 用户与权限管理-- 查看当前服务器上的所有账号密码主机SELECT USER,PASSWORD,HOST FROM mysql.user; -- 设置账号密码SET PASSWORD=PASSW ...

  6. WinFom基本属性

    常用窗体属性: AutoSroll:如果窗体内容超出了窗体范围,自动出现滚动条.默认是false. AutoSize:调节窗口大小时,保证使窗体内的内容必须全部显示出来. Location:控件左上角 ...

  7. linux 开启wifi热点

    1,在网络连接管理中创建一个wifi连接,点击 Add,然后选Wi-Fi 2,设置wifi热点名字.wifi接连名字 3,设置 Mode 选 Ad-hoc,其它默认. 4,在 Wi-Fi Securi ...

  8. centos6.5 ssh安全优化,修改默认端口名,禁止root远程登录

    一.修改默认端口号 第一步: vi /etc/sysconfig/iptables 添加修改后的端口号的配置 -A INPUT -p tcp -m state --state NEW -m tcp - ...

  9. SqlSever基础 convert 将类型为字符的一列转成Int类型后进行排序

    镇场诗:---大梦谁觉,水月中建博客.百千磨难,才知世事无常.---今持佛语,技术无量愿学.愿尽所学,铸一良心博客.------------------------------------------ ...

  10. bzoj 3234: [Ahoi2013]立方体

    题目链接:http://www.lydsy.com:808/JudgeOnline/problem.php?id=3234 题意:求长方体交的表面积. 思路:flood-fill const int ...