JBrowse plugin to support small RNA visualization
Based on the JBrowse tack type "Alignments2", the small RNA alignments track shows individual reads. The differences are:
- Reads are colored by size not strand
- Reads can be filtered by size and/or multimapping
- There is animal and plant specific coloring because plant's don't have piRNAs. Plant coloring is the default.
- Reads are organized on a y-axis by strand with positive-strand reads above the y-axis origin and negative-strand reads below it.
For JBrowse 1.11.6+ in the JBrowse/plugins folder, type:
git clone https://github.com/bhofmei/jbplugin-smallrna.git SmallRNAPlugin
or
downloaded the latest release version at releases.
Unzip the downloaded folder, place in JBrowse/plugins, and rename the folder SmallRNAPlugin
Add this to jbrowse.conf under [GENERAL]
:
[ plugins.SmallRNAPlugin ]
location = plugins/SmallRNAPlugin
If that doesn't work, add this to jbrowse_conf.json:
"plugins" : {
"SmallRNAPlugin" : { "location" : "plugins/SmallRNAPlugin" }
}
Sample data is included in the plugin to test that the plugin is working properly. With URL
as the URL path to the JBrowse instance, navigate a web browser to URL/index.html?data=plugins/SmallRNAPlugin/test/data
.
- Each read is colored based on length
- Blue: 21 nt
- Green: 22 nt
- Purple: 23 nt
- Orange: 24 nt
- Red: piRNAs (26-31 nt)
- Gray: all other sizes
- Colors were inspired by this color scheme
- Reads are positions positions based on strand
- Above y-axis origin: positive strand
- Below y-axis origin: negative strand
- Unfilled reads indicate read maps to multiple locations
- Filtering options
- Filter an individual track using the track drop-down menu
- Filter all visible smRNA tracks using the toolbar button
- Filter for size, strand, read quality, multimapping
The plant-specific smRNA color scheme is the default. However, if you want to use the animal-specific color scheme, it is very easy and flexible to change. This is compatible with the DNA Methylation plugin.
Using the animal coloring scheme is enforced hierarchically. Configurations specified at a higher level overpower lower-level specification. If not specified at a specific level, inherits the setting of the level below.
level | location | syntax |
---|---|---|
highest | individual track config | isAnimal=true |
tracks.conf |
[general] isAnimal=true |
|
jbrowse.conf |
[general] isAnimal=true |
|
lowest | default | isAnimal=false |
Note that toolbar buttons are defined by tracks.conf
and jbrowse.conf
.
Reads are read directly from a BAM file. Follow the instructions for the Alignments2 track to specify the file location.
Also, make sure the indexed BAM file (.bam.bai
) is in the same directory as the BAM file.
Optionally, you can also supply a BigWig file for coverage view when zoomed out. I recommend this. Otherwise the track says "Too much data to show; zoom in to see detail"
Track specifications are similar to the Alignments2 specifications. The label, type, and urlTemplate must be specified. Take note of type; this is the difference from Alignments2.
To change the plant or animal coloring scheme, for the specific track, include the isAnimal setting. Otherwise it assumes the setting based on the priority list above.
In trackList.json,
{
"key" : "Small RNA",
"label" : "smrna",
"storeClass" : "JBrowse/Store/SeqFeature/BAM",
"urlTemplate" : "path/to/smallrna.bam",
"type" : "SmallRNAPlugin/View/Track/smAlignments",
"isAnimal" : true
}
In tracks.conf,
[tracks.smrna]
key = Small RNA
storeClass = JBrowse/Store/SeqFeature/BAM
urlTemplate = path/to/smallrna.bam
type = SmallRNAPlugin/View/Track/smAlignments
isAnimal = true
Similar to other alignments, you can specify a BigWig file to use for the histogram view.
In trackList.json,
{
"key" : "Small RNA",
"label" : "smrna",
"storeClass" : "JBrowse/Store/SeqFeature/BAM",
"urlTemplate" : "path/to/smallrna.bam",
"type" : "SmallRNAPlugin/View/Track/smAlignments",
"isAnimal" : true,
"histograms" : {
"storeClass" : "JBrowse/Store/SeqFeature/BigWig",
"urlTemplate" : "path/to/smallrna.bw"
}
}
The track type smAlignments
is preferred for its speed, but HTMLFeature alignments track is available.
It is comparable to JBrowse's Alignments track.
This track type is beneficial when taking PDF/SVG screenshots so each read is an HTML element (compared to being painted on the canvas for smAlignments/Alignments2).
Track configurations are the same except the track type and it does not accept a BigWig file for histograms.
In tracks.conf,
[tracks.smrna-html]
key = Small RNA - HTML
storeClass = JBrowse/Store/SeqFeature/BAM
urlTemplate = path/to/smallrna.bam
type = SmallRNAPlugin/View/Track/smHTMLAlignments
In trackList.json,
{
"key" : "Small RNA - HTML",
"label" : "smrna-html",
"storeClass" : "JBrowse/Store/SeqFeature/BAM",
"urlTemplate" : "path/to/smallrna.bam",
"type" : "SmallRNAPlugin/View/Track/smHTMLAlignments",
"isAnimal" : true
}
By default, mutlimapped reads are lighter/less opaque. To disable this, use style.solidFill = true
in tracks.conf and "style":{ "solidFill" : true }
in trackList.json.
Traditionally, for small RNA analysis is important to know if a read maps uniquely or multiple times within the genome. In this plugin, multi-mapped reads are shown in the appropriate color for the length, but are more transparent.
Reads are determined to be multi mapped based on the SAM flag (read is supplementary) or the SAM attribute NH
. Even when multiple alignments for the same read are output in the BAM file, the mapping program may not set the flag or NH
attribute. For example, bowtie does not set these even when -k 2+
.
Mapping programs vary greatly in how they assign quality scores for reads, the MQ
or MAPQ
score.
From the SAM format specification,
MAPQ: MAPping Quality. It equals −10 log10 Pr{mapping position is wrong}, rounded to the nearest integer. A value 255 indicates that the mapping quality is not available.
To accommodate as many scoring schemes as possible, users can filter by minimum quality score.
Reads with value 255 are always shown.
The following features plan to be supported in the future.
- Testing for smHTMLAlignments