SAM是Sequence Alignment/Map 的缩写。像bwa等软件序列比对结果都会输出这样的文件。samtools网站上有专门的文档介绍SAM文件。具体地址:http://samtools.sourceforge.net/SAM1.pdf
很多人困惑SAM文件中的第二列FLAG值是什么意思。根据文档介绍我们可以计算,但是为了方便大家,下面给大家提供一个脚本工具,大家直接输入flag值就可以知道它代表的含义了。
该脚本的使用方法如下截图所示:
脚本工具的使用方法:
将下面的代码保存在记事本里面,另存为一个html文件,如文件名:FlagExplain.html(拓展名一定要为.html)。双击既可以在浏览器里面打开了。
01 |
< html >< head >< meta http-equiv = "Content-Type" content = "text/html; charset=GBK" > |
02 |
< title >Explain SAM Flags</ title > |
03 |
< script type = "text/javascript" > |
04 |
lstFlags = [["read paired", 0x1], |
05 |
["read mapped in proper pair", 0x2], |
06 |
["read unmapped", 0x4], |
07 |
["mate unmapped", 0x8], |
08 |
["read reverse strand", 0x10], |
09 |
["mate reverse strand", 0x20], |
10 |
["first in pair", 0x40], |
11 |
["second in pair", 0x80], |
12 |
["not primary alignment", 0x100], |
13 |
["read fails platform/vendor quality checks", 0x200], |
14 |
["read is PCR or optical duplicate", 0x400]]; |
16 |
function explainFlags() { |
17 |
var flagValue = parseInt(document.getElementById('tb').value); //returns 0 or NaN if can't parse |
19 |
for(var i = 0; i < lstFlags.length ; i++) { |
20 |
var checkbox = document .getElementById('cb' + i) |
21 |
if(lstFlags[i][1] & flagValue) { |
22 |
summary += " " + lstFlags[i][0] + "<br>"; |
23 |
checkbox.checked = true; |
25 |
checkbox.checked = false; |
29 |
document.getElementById('summary').innerHTML = summary; |
32 |
function checkboxClicked() { |
33 |
//compute the new flag value |
35 |
for(var i = 0; i < lstFlags.length ; i++) { |
36 |
var checkBox = document .getElementById('cb' + i); |
37 |
if(checkBox.checked) { |
38 |
newFlagValue |= lstFlags[i][1]; |
41 |
var textbox = document .getElementById('tb'); |
42 |
textbox.value = newFlagValue ; |
47 |
< noscript >This page requires JavaScript. Please enable it in your browser settings.</ noscript > |
51 |
This utility explains SAM flags in plain English. < br > |
54 |
< form onsubmit = "explainFlags(); return false;" > |
56 |
< input id = "tb" type = "text" size = "10" > |
57 |
< input type = "submit" value = "Explain" >< br > |
60 |
< script type = "text/javascript" > |
61 |
for(var i = 0; i < lstFlags.length ; i++) { |
62 |
document.write("<input type = checkbox name = cb " + i + " id = 'cb" + i + "' onclick = 'checkboxClicked();' > " +lstFlags[i][0] + "</ input >< br >"); |
64 |
</ script >< input type = "checkbox" name = "cb0" id = "cb0" onclick = "checkboxClicked();" > read paired< br >< input type = "checkbox" name = "cb1" id = "cb1" onclick = "checkboxClicked();" > read mapped in proper pair< br >< input type = "checkbox" name = "cb2" id = "cb2" onclick = "checkboxClicked();" > read unmapped< br >< input type = "checkbox" name = "cb3" id = "cb3" onclick = "checkboxClicked();" > mate unmapped< br >< input type = "checkbox" name = "cb4" id = "cb4" onclick = "checkboxClicked();" > read reverse strand< br >< input type = "checkbox" name = "cb5" id = "cb5" onclick = "checkboxClicked();" > mate reverse strand< br >< input type = "checkbox" name = "cb6" id = "cb6" onclick = "checkboxClicked();" > first in pair< br >< input type = "checkbox" name = "cb7" id = "cb7" onclick = "checkboxClicked();" > second in pair< br >< input type = "checkbox" name = "cb8" id = "cb8" onclick = "checkboxClicked();" > not primary alignment< br >< input type = "checkbox" name = "cb9" id = "cb9" onclick = "checkboxClicked();" > read fails platform/vendor quality checks< br >< input type = "checkbox" name = "cb10" id = "cb10" onclick = "checkboxClicked();" > read is PCR or optical duplicate< br > |
68 |
</ div ></ form ></ body ></ html > |
参考:https://www.plob.org/article/1697.html
- 推荐一个SAM文件中flag含义解释工具--转载
SAM是Sequence Alignment/Map 的缩写.像bwa等软件序列比对结果都会输出这样的文件.samtools网站上有专门的文档介绍SAM文件.具体地址:http://samtools. ...
- 31、SAM文件中flag含义解释工具--转载
转载:http://www.cnblogs.com/nkwy2012/p/6362996.html SAM是Sequence Alignment/Map 的缩写.像bwa等软件序列比对结果都会输出这 ...
- 推荐一个可以直接在Visual Studio中看到complexity的插件CodeMaid
博客搬到了fresky.github.io - Dawei XU,请各位看官挪步.最新的一篇是:推荐一个可以直接在Visual Studio中看到complexity的插件CodeMaid.
- 推荐一个免费的生成词云(word cloud)的在线工具
"词云"这个概念由美国西北大学新闻学副教授.新媒体专业主任里奇·戈登(Rich Gordon)提出. "词云"就是对网络文本中出现频率较高的"关键词& ...
- bat脚本中%~dp0含义解释
在Windows脚本中,%i类似于shell脚本中的$i,%0表示脚本本身,%1表示脚本的第一个参数,以此类推到%9,在%和i之间可以有"修饰符"(完整列表可通过"for ...
- SAMTOOLS使用 SAM BAM文件处理
[怪毛匠子 整理] samtools学习及使用范例,以及官方文档详解 #第一步:把sam文件转换成bam文件,我们得到map.bam文件 system"samtools view -bS m ...
- bam文件测序深度统计-bamdst
最近接触的数据都是靶向测序,或者全外测序的数据.对数据的覆盖深度及靶向捕获效率的评估成为了数据质量监控中必不可少的一环. 以前都是用samtools depth 算出单碱基的深度后,用perl来进行深 ...
- SAM/BAM文件处理
当测序得到的fastq文件map到基因组之后,我们通常会得到一个sam或者bam为扩展名的文件.SAM的全称是sequence alignment/map format.而BAM就是SAM的二进制文件 ...
- 文件格式——Sam&bam文件
Sam&bam文件 SAM是一种序列比对格式标准, 由sanger制定,是以TAB为分割符的文本格式.主要应用于测序序列mapping到基因组上的结果表示,当然也可以表示任意的多重比对结果.当 ...
随机推荐
- sudoers权限管理
该/etc/sudoers文件的权限管理很完善,覆盖了linux中的各种命令,各种shell.编辑器等等,在此留作以后作为参考. # This file MUST be edited with the ...
- linux 对MTD分区nand flash的烧写和读取
使用mtd-utils工具实现对flash的升级分区的烧写yaffs2 yaffs2的格式是根据所使用的nandflash来制作的,不同的nandflash,得到的yaffs2是不一样的,具体可以参考 ...
- 《图解HTTP》读书笔记(二:各种协议与HTTP协议之间的关系)
涉及到DNS协议.TCP协议.IP协议,话不多说,上图:
- zblog如何更改数据库配置以及生效
zblog是一个博客的开源框架, 挺不错的,我们当前拿来作为新闻系统管理使用. 由于我们数据库需要统一使用RDS, 故对zblog数据库配置进行修改,修改文件如下: 1. 数据库文件地址: zb_us ...
- xtrabackup工具备份与恢复
1.xtrabackup简介 Xtrabackup是一个对InnoDB做数据备份的工具,支持在线热备份(备份时不影响数据读写),是商业备份工具InnoDB Hotbackup的一个很好的替代品.它能对 ...
- 自己写的一些公共js方法
/* 说明文件:这里用的都是es6的语法 导入导出,拿vue举个栗子,你只需要在用到的地方,按需要导入就行了,然后在mounted中直接可以拿来用 比如下面的手机****方法,在需要用到的地方impo ...
- spider随机请求头和ip
#创建爬虫 scrapy genspider randomIp_spider "taobao.com" #把需要请求的url放到一个混淆的url请求list中去,避免被监测到总是访 ...
- Android-Gradle(五)
Android studio不仅允许你为你的app和依赖库创建模块,同时也可为Android wear,Android TV,Google App Engine等创建模块,而这些单独的模块又可以在一个 ...
- 2017.11.27 变量进阶与LED矩阵
局部变量:函数内部声明的变量,只在函数内部有效. 全部变量:在函数外部声明的变量,全局都有效,直到程序执行完毕. 全局变量负作用: 1.降低函数的独立性 2.降低函数的通用性,不利于函数的重复调用. ...
- Instrumentation接口详解
Instrumentation接口位于jdk1.6包java.lang.instrument包下,Instrumentation指的是可以独立于应用程序之外的代理程序,可以用来监控和扩展JVM上运行的 ...