@gmod/jbrowse
Version:
JBrowse - client-side genome browser
188 lines (183 loc) • 36.5 kB
HTML
<html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Alignments tracks · JBrowse</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="# Alignment Tracks (BAM and CRAM)"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="Alignments tracks · JBrowse"/><meta property="og:type" content="website"/><meta property="og:url" content="https://jbrowse.org/index.html"/><meta property="og:description" content="# Alignment Tracks (BAM and CRAM)"/><meta name="twitter:card" content="summary"/><link rel="shortcut icon" href="/img/favicon.ico"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/><link rel="alternate" type="application/atom+xml" href="https://jbrowse.org/blog/atom.xml" title="JBrowse Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://jbrowse.org/blog/feed.xml" title="JBrowse Blog RSS Feed"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/"><h2 class="headerTitle">JBrowse</h2></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class=""><a href="/blog" target="_self">Blog</a></li><li class="siteNavGroupActive"><a href="/docs/installation.html" target="_self">Documentation</a></li><li class=""><a href="/en/demos.html" target="_self">Demos</a></li><li class=""><a href="/en/developers.html" target="_self">Developers</a></li><li class=""><a href="/en/contact.html" target="_self">Contact</a></li><li class=""><a href="/en/references.html" target="_self">References</a></li><li class=""><a href="/en/help.html" target="_self">Help</a></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Configuring tracks</span></h2><div class="tocToggler" id="tocToggler"><i class="icon-toc"></i></div></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle">Tutorial</h3><ul><li class="navListItem"><a class="navItem" href="/docs/installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/tutorial.html">Indexed file formats tutorial</a></li><li class="navListItem"><a class="navItem" href="/docs/tutorial_classic.html">Classic quick-start guide</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Configuring tracks</h3><ul><li class="navListItem"><a class="navItem" href="/docs/reference_sequence.html">Reference sequence configuration</a></li><li class="navListItem"><a class="navItem" href="/docs/canvas_features.html">CanvasFeatures</a></li><li class="navListItem"><a class="navItem" href="/docs/html_features.html">HTMLFeatures</a></li><li class="navListItem navListItemActive"><a class="navItem" href="/docs/alignments.html">Alignments tracks</a></li><li class="navListItem"><a class="navItem" href="/docs/bigwig.html">Wiggle/BigWig Tracks</a></li><li class="navListItem"><a class="navItem" href="/docs/variants.html">VCF tracks</a></li><li class="navListItem"><a class="navItem" href="/docs/minimal.html">Minimal JBrowse configurations</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Advanced configuration</h3><ul><li class="navListItem"><a class="navItem" href="/docs/embedding.html">Embedding JBrowse</a></li><li class="navListItem"><a class="navItem" href="/docs/mouse_configs.html">Mouse clicks, menus, and popups</a></li><li class="navListItem"><a class="navItem" href="/docs/configuration_file_formats.html">Configuration File Formats</a></li><li class="navListItem"><a class="navItem" href="/docs/dataset_selector.html">Dataset Selector</a></li><li class="navListItem"><a class="navItem" href="/docs/track_selectors.html">Track Selectors</a></li><li class="navListItem"><a class="navItem" href="/docs/track_metadata.html">Track Metadata</a></li><li class="navListItem"><a class="navItem" href="/docs/global_options.html">Global configuration options</a></li><li class="navListItem"><a class="navItem" href="/docs/compression.html">Compressing JBrowse data</a></li><li class="navListItem"><a class="navItem" href="/docs/authentication.html">HTTP authentication for JBrowse</a></li><li class="navListItem"><a class="navItem" href="/docs/paired_reads.html">Paired read viewing</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Command line</h3><ul><li class="navListItem"><a class="navItem" href="/docs/flatfile-to-json.pl.html">flatfile-to-json.pl</a></li><li class="navListItem"><a class="navItem" href="/docs/remove-track.pl.html">remove-track.pl</a></li><li class="navListItem"><a class="navItem" href="/docs/ucsc-to-json.pl.html">ucsc-to-json.pl</a></li><li class="navListItem"><a class="navItem" href="/docs/generate-names.pl.html">generate-names.pl</a></li><li class="navListItem"><a class="navItem" href="/docs/prepare-refseqs.pl.html">prepare-refseqs.pl</a></li><li class="navListItem"><a class="navItem" href="/docs/biodb-to-json.pl.html">biodb-to-json.pl</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">JBrowse Desktop</h3><ul><li class="navListItem"><a class="navItem" href="/docs/jbrowse_desktop.html">JBrowse Desktop</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">FAQ</h3><ul><li class="navListItem"><a class="navItem" href="/docs/faq.html">JBrowse FAQ</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Other topics</h3><ul><li class="navListItem"><a class="navItem" href="/docs/url_strings.html">JBrowse URL parameters</a></li><li class="navListItem"><a class="navItem" href="/docs/image_tracks.html">Pre-rendered Image Tracks</a></li><li class="navListItem"><a class="navItem" href="/docs/feature_coverage.html">Feature Coverage Tracks</a></li><li class="navListItem"><a class="navItem" href="/docs/screenshots.html">Automating screenshots of JBrowse</a></li><li class="navListItem"><a class="navItem" href="/docs/events.html">JBrowse Subscribe/Publish events</a></li><li class="navListItem"><a class="navItem" href="/docs/perl_config.html">Sample configuration bash script</a></li><li class="navListItem"><a class="navItem" href="/docs/data_formats.html">JBrowse REST API and Data APIs</a></li><li class="navListItem"><a class="navItem" href="/docs/plugins.html">Installing and writing plugins</a></li><li class="navListItem"><a class="navItem" href="/docs/cors.html">Cross-origin resource sharing (CORS)</a></li><li class="navListItem"><a class="navItem" href="/docs/sparql.html">SPARQL configuration</a></li><li class="navListItem"><a class="navItem" href="/docs/data_export.html">Data export</a></li><li class="navListItem"><a class="navItem" href="/docs/usage_stats.html">Usage Statistics</a></li></ul></div></div></section></div><script>
document.addEventListener('DOMContentLoaded', function() {
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
createToggler('#tocToggler', 'body', 'tocActive');
const headings = document.querySelector('.toc-headings');
headings && headings.addEventListener('click', function(event) {
if (event.target.tagName === 'A') {
document.body.classList.remove('tocActive');
}
}, false);
function createToggler(togglerSelector, targetSelector, className) {
var toggler = document.querySelector(togglerSelector);
var target = document.querySelector(targetSelector);
toggler.onclick = function(event) {
event.preventDefault();
target.classList.toggle(className);
};
}
});
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><h1 class="postHeaderTitle">Alignments tracks</h1></header><article><div><span><h1><a class="anchor" aria-hidden="true" id="alignment-tracks-bam-and-cram"></a><a href="#alignment-tracks-bam-and-cram" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Alignment Tracks (BAM and CRAM)</h1>
<p>JBrowse has several track types that are designed for displaying alignment data, particularly from BAM and CRAM files. BAM and CRAM files used with JBrowse must be compressed and sorted by leftmost coordinate.</p>
<p>The JBrowse BAM parsing library makes extensive use of code from <a href="http://www.biodalliance.org/">BioDalliance</a>, while the CRAM support is based on the <code>@gmod/cram</code> npm module.</p>
<h2><a class="anchor" aria-hidden="true" id="alignments2"></a><a href="#alignments2" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Alignments2</h2>
<p>Introduced in JBrowse 1.8.0, <code>Alignments2</code> tracks are designed to display alignment data, such as from BAM files. This track type shows basepair-level mismatches, insertions, deletions, and skipped regions between aligned reads and the reference, and highlights paired reads in red if their mates are missing.</p>
<p>Base mismatches are displayed based on the contents of the feature's <code>MD</code> field (containing a BAM MD mismatch string), and/or <code>CIGAR</code> field. If your BAM file does not contain MD tags, one common way to generate them is with the <code>samtools calmd</code> command.</p>
<p><code>Alignments2</code> is a faster implementation of the older <code>Alignments</code> track type that draws alignments using the HTML5 canvas. In the interest of speed, <code>Alignments2</code> tracks do not display any text labels or descriptions alongside features, and do not draw arrowheads indicating strandedness, instead relying on color to denote the strand of alignments.</p>
<p><code>Alignments2</code> tracks support the same advanced clicking behavior as CanvasFeatures tracks, but does not support right-click menus.</p>
<p>The most basic Alignments2 track configuration in tracks.conf format is</p>
<p>[tracks.alignments]
urlTemplate=FM.01.new.sorted.chr11.bam
type=Alignments2</p>
<p>The above track template infers that the storeClass is a BAM store. Not all track and store types can do this inference but Alignments2 allows this</p>
<h2><a class="anchor" aria-hidden="true" id="paired-read-options"></a><a href="#paired-read-options" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Paired read options</h2>
<p>In JBrowse 1.16, paired read visualization was introduced</p>
<p>See <a href="paired_reads.html">paired read configuration also</a> for more information</p>
<h2><a class="anchor" aria-hidden="true" id="list-of-configuration-options"></a><a href="#list-of-configuration-options" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>List of configuration options</h2>
<h3><a class="anchor" aria-hidden="true" id="general-options"></a><a href="#general-options" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>General options</h3>
<table>
<thead>
<tr><th>Option</th><th>Value</th></tr>
</thead>
<tbody>
<tr><td><code>maxHeight</code></td><td>Available in JBrowse 1.9.0 and later. Maximum displayed height of the track in pixels. Defaults to 1000. Features that would cause the track to grow taller than the <code>maxHeight</code> are not shown. If a section of a track has features that are not drawn because of a <code>maxHeight</code> constraint, a notification is displayed at the bottom of that track section.</td></tr>
<tr><td><code>style→color</code></td><td>HTML-style color for drawn alignments. By default, this varies with the alignment's strandedness, and whether its mate pair is missing, using the <code>style→color_fwd_strand</code>, <code>style→color_rev_strand</code>, and <code>style→color_missing_mate</code> variables. To gain complete control over the displayed color, you could set this to be a function callback.</td></tr>
<tr><td><code>style→color_fwd_strand</code></td><td>HTML-style color for alignments on the forward strand. Default #EC8B8B, which is a light red.</td></tr>
<tr><td><code>style→color_rev_strand</code></td><td>HTML-style color for alignments on the reverse strand. Default #898FD8, which is a light blue.</td></tr>
<tr><td><code>style→color_missing_mate</code></td><td>HTML-style color for alignments with a missing mate. Default #D11919, which is a dark red.</td></tr>
<tr><td><code>style→height</code></td><td>Height in pixels of each alignment. Default 7.</td></tr>
<tr><td><code>style→marginBotton</code></td><td>Number of pixels of vertical spacing to put on the bottom of each alignment. Default 1.</td></tr>
<tr><td><code>style→showMismatches</code></td><td>If true, draw mismatches (SNPs, insertions, deletions, skips) on the alignent. Default true.</td></tr>
<tr><td><code>style→mismatchFont</code></td><td>CSS string describing the font to use for labeling mismatches. Default "bold 10px Courier New,monospace".</td></tr>
</tbody>
</table>
<h3><a class="anchor" aria-hidden="true" id="histograms-configuration"></a><a href="#histograms-configuration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Histograms configuration</h3>
<p>A pre-defined histogram e.g. from a bigwig can be defined on the Alignments2 track. Example</p>
<pre><code class="hljs">[tracks.bam]
<span class="hljs-attribute">urlTemplate</span>=alignments.bam
histograms.<span class="hljs-attribute">storeClass</span>=JBrowse/Store/SeqFeature/BigWig
histograms.<span class="hljs-attribute">urlTemplate</span>=coverage.bw
</code></pre>
<p>Config options</p>
<table>
<thead>
<tr><th>Option</th><th>Value</th></tr>
</thead>
<tbody>
<tr><td><code>histograms.storeClass</code></td><td>A store class for summary histograms used for the Alignments2 track. Usually JBrowse/Store/SeqFeature/BigWig. Can be used on any CanvasFeatures-type track but generally used in Alignments2 tracks</td></tr>
<tr><td><code>histograms.urlTemplate</code></td><td>Path to a histogram file (such as a BigWig) to be used for summary histograms used for the Alignments2 track. Can be used on any CanvasFeatures-type track but generally used in Alignments2 tracks</td></tr>
<tr><td><code>histograms.color</code></td><td>Color for the histograms e.g. "purple". Default is orange. Can be used on any CanvasFeatures-type track but generally used in Alignments2 tracks</td></tr>
<tr><td><code>histograms.binsPerBlock</code></td><td>"Granularity" of the bins in histogram. Default is 200 for Alignments2 tracks. Default is 25 on other CanvasFeatures type tracks.</td></tr>
</tbody>
</table>
<h3><a class="anchor" aria-hidden="true" id="filtering-options"></a><a href="#filtering-options" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Filtering options</h3>
<p>Alignments can be filtered by various BAM flags</p>
<table>
<thead>
<tr><th>Option</th><th>Value</th></tr>
</thead>
<tbody>
<tr><td><code>hideDuplicateReads</code></td><td>Hide duplicate reads to the same location. Default: true</td></tr>
<tr><td><code>hideQCFailingReads</code></td><td>Hide QC failing reads that did not pass some aligner quality. Default: true</td></tr>
<tr><td><code>hideSecondary</code></td><td>Hide secondary reads which mapped to multiple locations. Default: true</td></tr>
<tr><td><code>hideUnmapped</code></td><td>Hide unmapped reads. Default: true</td></tr>
<tr><td><code>hideMissingMatepairs</code></td><td>If a read is missing a mate pair or paired-end match, hide the read. Default: false</td></tr>
<tr><td><code>hideImproperPairs</code></td><td>If a read is missing a mate pair or paired-end match, hide the read. Default: false</td></tr>
<tr><td><code>hideForwardStrand</code></td><td>Hide all reads from the forward strand. Default: false</td></tr>
<tr><td><code>hideReverseStrand</code></td><td>Hide all reads from the reverse strand. Default: false</td></tr>
</tbody>
</table>
<p>Note: <code>hideImproperPairs</code> was introduced in 1.16.0 to disambiguate from hideMissingMatepairs. The "read mapped in proper pair" flag can have a mate but it is simply classified as a bad alignment by the aligner, JBrowse displays these as lightly colored</p>
<h3><a class="anchor" aria-hidden="true" id="coloring-options"></a><a href="#coloring-options" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Coloring options</h3>
<table>
<thead>
<tr><th>Option</th><th>Value</th></tr>
</thead>
<tbody>
<tr><td><code>useReverseTemplate</code></td><td>Use an algorithm for reversing the template of paired-end reads so that they appear on the same strand, RNA-seq specific. Default: false. Added in 1.11.6</td></tr>
<tr><td><code>useXS</code></td><td>Color reads when the XS tag indicates strandedness, RNA-seq specific. Default: false. Added in 1.11.6</td></tr>
<tr><td><code>useTS</code></td><td>Color reads when the TS tag indicates strandedness, RNA-seq specific. Default: false. Added in 1.16.0</td></tr>
<tr><td><code>colorByMAPQ</code></td><td>Color reads when the TS tag indicates strandedness, RNA-seq specific. Default: false. Added in 1.16.0</td></tr>
<tr><td><code>colorByOrientation</code></td><td>Colors reads according to paired end orientations. Default: false. Added in 1.16.0</td></tr>
<tr><td><code>colorBySize</code></td><td>Colors reads according to insert size. Default: false. Added in 1.16.0</td></tr>
<tr><td><code>colorByOrientationAndSize</code></td><td>Colors reads according to paired end orientations. Default: false. Added in 1.16.0</td></tr>
</tbody>
</table>
<p>Note: <code>colorBySize</code>, <code>colorByOrientationAndSize</code> invoke insert size stats estimation, and only makes sense with paired read tracks. Many of these options are 1.16.0 and newer. See <a href="paired_reads.html">paired reads</a> for more information.</p>
<h3><a class="anchor" aria-hidden="true" id="other-options"></a><a href="#other-options" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Other options</h3>
<table>
<thead>
<tr><th>Option</th><th>Value</th></tr>
</thead>
<tbody>
<tr><td><code>cacheMismatches</code></td><td>Cache mismatch calculations so that long reads are faster to browser. Default: false. Added in 1.12.3</td></tr>
<tr><td><code>renderAlignments</code></td><td>Add a text display of the BAM alignment on a single line in the View details popup. Default: false</td></tr>
<tr><td><code>renderPrettyAlignments</code></td><td>Add a text display of the BAM alignment using prettier "BLAST style" to the View details popup. Default: false</td></tr>
<tr><td><code>orientationType</code></td><td>Set the orientation pattern. Default is 'fr' according to illumina adapters that face each other. Other options are 'rf' and 'ff'. See <a href="https://software.broadinstitute.org/software/igv/interpreting_pair_orientations">https://software.broadinstitute.org/software/igv/interpreting_pair_orientations</a> for more info. Added in 1.16.0</td></tr>
</tbody>
</table>
<h1><a class="anchor" aria-hidden="true" id="alignments2-coloring-schemes"></a><a href="#alignments2-coloring-schemes" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Alignments2 coloring schemes</h1>
<p>Since JBrowse 1.11.3, there is a new coloring scheme for BAM files that allows for new coloring of paired end reads, such as a different coloring for unpaired reads and aberrant pairing split across chromosomes.</p>
<p>The coloring styles that can be configured for the Alignments2 track are as follows</p>
<table>
<thead>
<tr><th>Option</th></tr>
</thead>
<tbody>
<tr><td><code>style→color_fwd_strand</code></td><td>#EC8B8B (original red)</td></tr>
<tr><td><code>style→color_rev_strand</code></td><td>#8F8FD8 (original blue)</td></tr>
<tr><td><code>style→color_fwd_missing_mate</code></td><td>#D11919 (hard red)</td></tr>
<tr><td><code>style→color_rev_missing_mate</code></td><td>#1919D1 (hard blue)</td></tr>
<tr><td><code>style→color_fwd_strand_not_proper</code></td><td>#ECC8C8 (light red)</td></tr>
<tr><td><code>style→color_rev_strand_not_proper</code></td><td>#BEBED8 (light blue)</td></tr>
<tr><td><code>style→color_fwd_diff_chr</code></td><td>#000000 (black)</td></tr>
<tr><td><code>style→color_rev_diff_chr</code></td><td>#969696 (gray)</td></tr>
<tr><td><code>style→color_nostrand</code></td><td>#999999 (gray) Added in 1.11.6</td></tr>
</tbody>
</table>
<p>If this scheme is undesirable, the style->color variable can be overridden entirely as well, with a callback for example. Also see See <a href="paired_reads.html">paired reads</a> for additional flags relavant to paired end reads.</p>
<h2><a class="anchor" aria-hidden="true" id="snpcoverage"></a><a href="#snpcoverage" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>SNPCoverage</h2>
<p>Introduced in JBrowse 1.8.0, <code>SNPCoverage</code> tracks draw the coverage of alignment features along the genome, along with a graphical representation of base-mismatch (possible SNP) distribution, and tables showing frequencies for each mismatching base.</p>
<p>Like the other alignment tracks, base mismatches are displayed based on the contents of the feature's <code>MD</code> field (containing a BAM MD mismatch string).</p>
<p><strong>Note: Since the SNPCoverage track dynamically calculates coverage and putative SNPs directly from alignment data, it is not recommended for use with very dense feature data, such as deep-coverage BAM files.</strong> For these types of files, it's recommended to pre-generate a BigWig file of the coverage and a VCF file of putative SNPs, and display those instead.</p>
<p><img src="/docs/assets/config/JBrowse_SNP_Coverage.png" alt="800px|thumb|center|A SNPCoverage track with corresponding Alignments2 track."></p>
<h3><a class="anchor" aria-hidden="true" id="example-snpcoverage-configuration"></a><a href="#example-snpcoverage-configuration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Example SNPCoverage Configuration</h3>
<p>In your data/tracks.conf file:</p>
<pre><code class="hljs">[tracks.my-bam-coverage-track]
storeClass = JBrowse/Store/SeqFeature/BAM
urlTemplate = volvox-sorted.bam
type = JBrowse/View/Track/SNPCoverage
metadata.Description = SNP/Coverage view of volvox-sorted.bam, simulated resequencing alignments.
key = BAM - volvox-sorted SNPs/Coverage
</code></pre>
<p>Note that urlTemplate will refer to a file relative to the "data" directory that you are using.</p>
<h2><a class="anchor" aria-hidden="true" id="alignments"></a><a href="#alignments" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Alignments</h2>
<p>Introduced in JBrowse 1.7.0, <code>Alignments</code> tracks are an HTML-based track type for alignment display. They display everything that <code>Alignments2</code> do, and also can be configured with right-click menus and strand arrowheads.</p>
<p>They display everything that <code>Alignments2</code> tracks do, plus they support the same configuration options as feature tracks, including advanced clicking behavior, feature modification callbacks, and so forth. The price of this additional capability is that <code>Alignments</code> tracks are <strong>significantly slower</strong> when used with dense data such as deep BAM alignments.</p>
<p><code>Alignments2</code> is recommended over <code>Alignments</code> for most users.</p>
<p><img src="/docs/assets/config/JBrowse_alignment_and_coverage.png" alt="center|1124px|border|JBrowse displaying short-read alignments"></p>
<h2><a class="anchor" aria-hidden="true" id="bam-data-configuration-options"></a><a href="#bam-data-configuration-options" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>BAM Data Configuration Options</h2>
<table>
<thead>
<tr><th>Option</th><th>Value</th></tr>
</thead>
<tbody>
<tr><td><code>urlTemplate</code></td><td>URL for the BAM file to display.</td></tr>
<tr><td><code>baiUrlTemplate</code></td><td>URL for the corresponding BAM index (BAI) file. If not set, this is assumed to be the same URL as <code>urlTemplate</code> with <code>.bai</code> appended.</td></tr>
<tr><td><code>csiUrlTemplate</code></td><td>URL for the corresponding BAM index (CSI) file. Must be set manually in the case that it is being used.</td></tr>
<tr><td><code>chunkSizeLimit</code></td><td>Maximum size in bytes of BAM chunks that the browser will try to deal with. Default 5000000 (5 MiB). When this is exceeded, most tracks will display some kind of "Too much data" message. If you increase this, be careful. You could blow up your web browser.</td></tr>
</tbody>
</table>
<p><code>Note: you can also increase maxFeatureScreenDensity if you get the "Too much data to show; zoom in to see detail".</code></p>
<h2><a class="anchor" aria-hidden="true" id="example-bam-alignments2-track-configuration"></a><a href="#example-bam-alignments2-track-configuration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Example BAM Alignments2 track configuration</h2>
<pre><code class="hljs css languages- {.javascript}"> {
<span class="hljs-string">"storeClass"</span> : "<span class="hljs-type">JBrowse</span>/Store/SeqFeature/BAM<span class="hljs-string">",
"</span>urlTemplate<span class="hljs-string">" : "</span>../../raw/volvox/volvox-sorted.bam<span class="hljs-string">",
"</span>label<span class="hljs-string">" : "</span>volvox-sorted.bam<span class="hljs-string">",
"</span><span class="hljs-keyword">type</span><span class="hljs-string">" : "</span>JBrowse/View/Track/Alignments2<span class="hljs-string">"
},
</span></code></pre>
<h2><a class="anchor" aria-hidden="true" id="apache-configuration-note"></a><a href="#apache-configuration-note" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Apache Configuration Note</h2>
<p>If you are using the Apache web server, please be aware that the module <code>mime_magic</code> can cause BAM files to be served incorrectly. Usually, the error in the web developer console will be something like "Not a BAM file". Some packaged versions of Apache, particularly on Red Hat or CentOS-based systems, are configured with this module turned on by default. We recommend you deactivate this Apache module for the server or directory used to serve JBrowse files. If you do not want to deactivate this module for the entire server, try adding this line to your HTTPD config or .htaccess file:</p>
<p><code>AddType application/octet-stream .bam .bami .bai</code></p>
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/html_features.html">← HTMLFeatures</a><a class="docs-next button" href="/docs/bigwig.html">Wiggle/BigWig Tracks →</a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#alignments2">Alignments2</a></li><li><a href="#paired-read-options">Paired read options</a></li><li><a href="#list-of-configuration-options">List of configuration options</a><ul class="toc-headings"><li><a href="#general-options">General options</a></li><li><a href="#histograms-configuration">Histograms configuration</a></li><li><a href="#filtering-options">Filtering options</a></li><li><a href="#coloring-options">Coloring options</a></li><li><a href="#other-options">Other options</a></li></ul></li><li><a href="#snpcoverage">SNPCoverage</a><ul class="toc-headings"><li><a href="#example-snpcoverage-configuration">Example SNPCoverage Configuration</a></li></ul></li><li><a href="#alignments">Alignments</a></li><li><a href="#bam-data-configuration-options">BAM Data Configuration Options</a></li><li><a href="#example-bam-alignments2-track-configuration">Example BAM Alignments2 track configuration</a></li><li><a href="#apache-configuration-note">Apache Configuration Note</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><div><h5>Docs</h5><a href="/blog">Blog</a><a href="/docs/tutorial.html">Getting Started</a></div><div><h5>Community</h5><a href="https://gitter.im/GMOD/jbrowse">Project Chat</a><a href="https://twitter.com/JBrowseGossip" target="_blank" rel="noreferrer noopener">Twitter</a></div><div><h5>More</h5><a href="https://github.com/GMOD/jbrowse">GitHub</a><a class="github-button" href="https://github.com/GMOD/jbrowse" data-icon="octicon-star" data-count-href="/GMOD/jbrowse/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Star</a></div></section><section class="copyright">Copyright © 2019 Evolutionary Software Foundation</section></footer></div></body></html>