日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

31、SAM文件中flag含义解释工具--转载

發布時間:2023/12/13 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 31、SAM文件中flag含义解释工具--转载 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

轉載:http://www.cnblogs.com/nkwy2012/p/6362996.html

SAM是Sequence Alignment/Map 的縮寫。像bwa等軟件序列比對結果都會輸出這樣的文件。samtools網站上有專門的文檔介紹SAM文件。具體地址:http://samtools.sourceforge.net/SAM1.pdf

很多人困惑SAM文件中的第二列FLAG值是什么意思。根據文檔介紹我們可以計算,但是為了方便大家,下面給大家提供一個腳本工具,大家直接輸入flag值就可以知道它代表的含義了。

該腳本的使用方法如下截圖所示:

腳本工具的使用方法:

將下面的代碼保存在記事本里面,另存為一個html文件,如文件名:FlagExplain.html(拓展名一定要為.html)。雙擊既可以在瀏覽器里面打開了。

<html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>Explain SAM Flags</title>
<script type="text/javascript">
lstFlags = [["read paired", 0x1],
["read mapped in proper pair", 0x2],
["read unmapped", 0x4],
["mate unmapped", 0x8],
["read reverse strand", 0x10],
["mate reverse strand", 0x20],
["first in pair", 0x40],
["second in pair", 0x80],
["not primary alignment", 0x100],
["read fails platform/vendor quality checks", 0x200],
["read is PCR or optical duplicate", 0x400]];

function explainFlags() {
var flagValue = parseInt(document.getElementById('tb').value); //returns 0 or NaN if can't parse
var summary = "";
for(var i = 0; i < lstFlags.length; i++) {
var checkbox = document.getElementById('cb' + i)
if(lstFlags[i][1] & flagValue) {
summary += " &nbsp; &nbsp; " + lstFlags[i][0] + "<br>";
checkbox.checked = true;
} else {
checkbox.checked = false;
}
}

document.getElementById('summary').innerHTML = summary;
}

function checkboxClicked() {
//compute the new flag value
var newFlagValue = 0;
for(var i = 0; i < lstFlags.length; i++) {
var checkBox = document.getElementById('cb' + i);
if(checkBox.checked) {
newFlagValue |= lstFlags[i][1];
}
}
var textbox = document.getElementById('tb');
textbox.value = newFlagValue;
explainFlags();
}
</script>

<noscript>This page requires JavaScript. Please enable it in your browser settings.</noscript>
</head>
<body>

This utility explains SAM flags in plain English. <br>
<br>

<form οnsubmit="explainFlags(); return false;">
Flag: &nbsp;
<input id="tb" type="text" size="10"> &nbsp; &nbsp; &nbsp;
<input type="submit" value="Explain"><br>
<br>
Explanation:<br>
<script type="text/javascript">
for(var i = 0; i < lstFlags.length; i++) {
document.write("<input type=checkbox name=cb" + i + " id='cb" + i + "'οnclick='checkboxClicked();'> &nbsp; " +lstFlags[i][0] + "</input><br>");
}
</script><input type="checkbox" name="cb0" id="cb0"οnclick="checkboxClicked();"> &nbsp; read paired<br><input type="checkbox"name="cb1" id="cb1" οnclick="checkboxClicked();"> &nbsp; read mapped in proper pair<br><input type="checkbox" name="cb2" id="cb2"οnclick="checkboxClicked();"> &nbsp; read unmapped<br><input type="checkbox"name="cb3" id="cb3" οnclick="checkboxClicked();"> &nbsp; mate unmapped<br><input type="checkbox" name="cb4" id="cb4" οnclick="checkboxClicked();"> &nbsp; read reverse strand<br><input type="checkbox" name="cb5" id="cb5"οnclick="checkboxClicked();"> &nbsp; mate reverse strand<br><inputtype="checkbox" name="cb6" id="cb6" οnclick="checkboxClicked();"> &nbsp; first in pair<br><input type="checkbox" name="cb7" id="cb7"οnclick="checkboxClicked();"> &nbsp; second in pair<br><input type="checkbox"name="cb8" id="cb8" οnclick="checkboxClicked();"> &nbsp; not primary alignment<br><input type="checkbox" name="cb9" id="cb9"οnclick="checkboxClicked();"> &nbsp; read fails platform/vendor quality checks<br><input type="checkbox" name="cb10" id="cb10"οnclick="checkboxClicked();"> &nbsp; read is PCR or optical duplicate<br>
<br>
Summary:<br>
<div id="summary">
</div></form></body></html>

轉載于:https://www.cnblogs.com/renping/p/7435723.html

總結

以上是生活随笔為你收集整理的31、SAM文件中flag含义解释工具--转载的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。