Alignments track
TL;DR: point an AlignmentsTrack at a BAM or CRAM with the uri shorthand
and the index resolves automatically. Coloring, height, and filtering are slots
on the LinearAlignmentsDisplay, set via displayDefaults.
{
"type": "AlignmentsTrack",
"trackId": "my_alignments_track",
"name": "My Alignments",
"assemblyNames": ["hg19"],
"adapter": { "type": "BamAdapter", "uri": "https://yourhost/file.bam" },
"displayDefaults": { "colorBy": { "type": "pairOrientation" }, "height": 250 }
}
jbrowse add-track https://yourhost/file.bam \
--trackId my_alignments_track \
--name "My Alignments" \
--assemblyNames hg19 \
--displayDefaults '{"colorBy":{"type":"pairOrientation"},"height":250}'
In JBrowse Desktop, or in any running JBrowse Web session, open a view on this track’s assembly, then File → Open track..., choose Add track from pasted JSON, and paste:
{
"type": "AlignmentsTrack",
"trackId": "my_alignments_track",
"name": "My Alignments",
"assemblyNames": ["hg19"],
"adapter": { "type": "BamAdapter", "uri": "https://yourhost/file.bam" },
"displayDefaults": { "colorBy": { "type": "pairOrientation" }, "height": 250 }
}
- The
urishorthand resolves the index (.baifor a BAM,.craifor a CRAM); add"csi": truefor a CSI-indexed BAM (theurishorthand) - CRAM decodes against the reference, and both adapters take their
sequenceAdapterfrom the enclosing assembly, so the track names none (BamAdapter, CramAdapter) colorBy,height,featureHeight,filterByand the coverageautoscale/minScore/maxScoreareLinearAlignmentsDisplayslots. Reads draw gray with mismatches marked untilcolorBycolors them by strand, pair orientation, insert size or a tag; the cookbook has the coloring, grouping and flag-filter recipe
Applying display settings opens a track in a given state from a link or an embedded view.