推荐一个SAM文件中flag含义解释工具--转载
2017-02-03 16:57
639 查看
SAM是Sequence Alignment/Map 的缩写。像bwa等软件序列比对结果都会输出这样的文件。samtools网站上有专门的文档介绍SAM文件。具体地址:http://samtools.sourceforge.net/SAM1.pdf
很多人困惑SAM文件中的第二列FLAG值是什么意思。根据文档介绍我们可以计算,但是为了方便大家,下面给大家提供一个脚本工具,大家直接输入flag值就可以知道它代表的含义了。
该脚本的使用方法如下截图所示:
脚本工具的使用方法:
将下面的代码保存在记事本里面,另存为一个html文件,如文件名:FlagExplain.html(拓展名一定要为.html)。双击既可以在浏览器里面打开了。
查看源代码
打印帮助
很多人困惑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]]; |
15 |
16 | function explainFlags() { |
17 | varflagValue =parseInt(document.getElementById('tb').value); //returns 0 or NaN if can't parse |
18 | varsummary =""; |
19 | for(vari =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; |
24 | } else { |
25 | checkbox.checked =false; |
26 | } |
27 | } |
28 |
29 | document.getElementById('summary').innerHTML =summary; |
30 | } |
31 |
32 | function checkboxClicked() { |
33 | //compute the new flag value |
34 | varnewFlagValue =0; |
35 | for(vari =0; i < lstFlags.length ; i++) { |
36 | var checkBox = document .getElementById('cb' + i); |
37 | if(checkBox.checked) { |
38 | newFlagValue |=lstFlags[i][1]; |
39 | } |
40 | } |
41 | var textbox = document .getElementById('tb'); |
42 | textbox.value = newFlagValue ; |
43 | explainFlags(); |
44 | } |
45 | </script> |
46 |
47 | < noscript >This page requires JavaScript. Please enable it in your browser settings.</ noscript > |
48 | </ head > |
49 | < body > |
50 |
51 | This utility explains SAM flags in plain English. < br > |
52 | < br > |
53 |
54 | < form onsubmit = "explainFlags(); return false;" > |
55 | Flag: |
56 | < input id = "tb" type = "text" size = "10" > |
57 | < input type = "submit" value = "Explain" >< br > |
58 | < br > |
59 | Explanation:< br > |
60 | < script type = "text/javascript" > |
61 | for(vari =0; i < lstFlags.length ; i++) { |
62 | document.write("<input type = checkbox name = cb " + i + " id = 'cb" + i + "' onclick = 'checkboxClicked();' > " +lstFlags[i][0] + "</ input >< br >"); |
63 | } |
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 > |
65 | < br > |
66 | Summary:< br > |
67 | < div id = "summary" > |
68 | </ div ></ form ></ body ></ html > |
相关文章推荐
- 转载:推荐一个前端开发工具---SuperApp
- 推荐:一个动态监视文件增长工具spylog
- 一个文件重复生成的小工具[附源码和可执行文件] 推荐
- 推荐一个大文件查找工具---WizTree
- 推荐一个yaml文件转json文件的在线工具
- 推荐一个LISP的开发工具-转载
- 为大家推荐一个DNN皮肤开发Dreamweaver扩展功能文件
- 【转载】如何把一个lib库文件加入到VC.NET项目中去
- 推荐一个小工具:ftree 可以列出ftp server的目录树
- 推荐一个Blog桌面工具-blogjet
- 推荐一个文件传输工具
- 有些疑惑,一个普通的aspx页面的文件,IIS怎么知道改用 asp.net1.1还是 2.0来解释呢?
- 推荐一个WINDOWS系统文件介绍的网站
- 推荐一个开源项目和一个免费工具
- 发布一个EMF图像文件查看分析工具
- 自己写了一个文件加密解密工具
- NAntGUI 刚刚写了一个生成 NAnt .build 编译文件的小工具(四)
- NAntGUI 刚刚写了一个生成 NAnt .build 编译文件的小工具(三)
- 发布一个自己写的文件重命名工具,支持正则表达式替换和自定义规则。
- 推荐一个站点管理工具SmarterStats