nih-gov/www.ncbi.nlm.nih.gov/projects/msaviewer/demo/demo_mapping.html

37 lines
1.6 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>NCBI Multiple Alignment Viewer 1.25.3</title>
<script type="text/javascript" src="../js/multialign.js"></script>
<script>
var printResults = function(str) {
document.getElementById('positions').innerHTML = str;
};
MultiAlignViewOnReady(function() {
var app = MultiAlignView.App.findAppByDivId("msaviewer_1");
app.on({'selection_changed': function(last) {
var pos = {};
var msg = 'Alignment position ' + (last.area.pos+1) + ' is mapped to ' + last.area.d;
printResults('Querying...');
app.mapCoords([last.area.pos], 'alignment', last.area.id, function(respos) {
var mapped = respos[0];
if (mapped.length == 1) {
msg += ' position ' + (mapped[0]+1);
} else {
msg += ' gap from ' + (mapped[1]+1) + ' to ' + (mapped[2]+1);
}
printResults(msg);
});
}});
});
</script>
</head>
<body>
<strong>Click on an alignment row to translate a chosen Alignment position into Sequence one</strong>
<div id="msaviewer_1" class="MultiAlignViewerApp" data-autoload>
<a href="?url=https://www.ncbi.nlm.nih.gov/projects/msaviewer/data/YP.13.muscle.asn&amp;appname=ncbi_msav_demo"></a>
</div>
<p/><h2>
<div id="positions" style="text-align:center"></div></h2>
</body>
</html>