Info about Ribbon

Getting started

Ribbon is especially useful for viewing complex alignments, like long-read sequencing around large structural variants, alignments/variants that span more than one chromosome, or assembly/assembly alignments.

Start by loading a BAM file and picking a locus

Examples:

PacBio, Illumina, and genome/assembly examples shown in the Examples tab above.

Visualize your own alignment data:

Ribbon can be used for long reads, short reads, paired-end reads, and assembly/genome alignments. Instructions for each data format are available by clicking on "instructions" in each tab on the right.

Paper and code

Please cite our paper in Bioinformatics:

Ribbon: intuitive visualization for complex genomic variation: https://doi.org/10.1093/bioinformatics/btaa680

Also see the preprint on the bioRxiv:

The code is open-source at https://github.com/MariaNattestad/Ribbon

Local installation:

You can install Ribbon locally from Github by following the instructions here: https://github.com/MariaNattestad/Ribbon

Acknowledgements

Ribbon stands on the shoulders of giants:

  • Visualizations created using D3 from Mike Bostock
  • Panel and navigation bar created using styles from Bootstrap
  • Local bam files are read using Samtools compiled into WebAssembly.

Ribbon also uses two D3 plug-ins created by Maria Nattestad:

  • Variant table with advanced filtering and sorting created using D3-superTable
  • Live search for chromosome and read names created using D3-livesearch

Navigate to a position:

:

Ribbon Settings

Make sure the bam file exists and that it has a corresponding index (.bai or .csi) file with an identical filename except for the addition of the .bai or .csi suffix. If the bam file does not exist or cannot be read, a header will fail to appear but there will be no error message. If the header of the bam file does not show up within about 10 seconds, loading the bam file has probably failed and you should check to make sure it actually exists at the given address. (To test for this, put the url into your web browser. If it starts downloading the bam file, then also check whether adding .bai or .csi to the url downloads the index file. If one of these does not start a download, then the file does not exist.)

Note that the bam file does not get read into memory, but the index file does, so if the index file is huge, it will take a while the first time you fetch reads from the bam file.

Select bam and corresponding index (bai/csi)

To use a .delta file from aligning assemblies/genomes with MUMmer's nucmer, run MUMmer's

show-coords -lTH
on it to get coordinates to load here.

Instructions

The coordinates must be the same as MUMmer's show-coords -lTH. This means 11 tab-separated columns without a header:
  1. Ref start
  2. Ref end
  3. Query start
  4. Query end
  5. Ref alignment length
  6. Query alignment length
  7. Percent Identity
  8. Total reference length
  9. Total query length
  10. Reference name(chromosome)
  11. Query_name

Information about the data and settings

(No region selected)
(No bam file queried)


Settings for the reference

Filter reference chromosomes
Zoom to chromosome

all

Minimum number of alignments:

1

Maximum chromosome length:
Reference settings
Color scheme:
Collapse reference sequences within distance:
Draw black border on selected region

Settings for read alignments

Filter reads
Number of alignments:
Minimum read length:
Minimum mapping quality: 0
Read settings
Sort reads vertically:
Orient reads by:
Fetching from a bam file
Margin around a locus where reads will be pulled from a bam file: bp
Alignments that overlap this locus or within those number of basepairs of the locus will be loaded when a region is navigated to. Use this parameter carefully as importing too much data can crash your web browser due to memory overload. This takes effect when a new locus is navigated to.

Filter features by type

Indels
Show indels as:
Features
Show features as:
Variants
Show only the chosen variant when others are in view

Settings for the single-read (bottom) view

Selected read
Search reads:
Match reference from region view
Highlight selected read
Minimum indel size to split: inf
Alignment outlines on ribbon plot:
Colors on dotplot:

Filter alignments

Minimum mapping quality: 0
Minimum alignment length: inf

Upload a .vcf or .bed file

Bed instructions

Upload a bed file of variants or other features to look at.

Columns:

  1. chromosome (reference)
  2. start position (reference)
  3. end position (reference)
  4. name (optional)
  5. score (optional)
  6. strand (optional)
  7. type/category (optional)
All optional fields can be used for filtering or showing tooltips with information, but only the first 3 columns are required for basic functionality.

VCF instructions

Upload a vcf file of variants to look at.

Requirements: columns:

  1. chromosome (reference)
  2. position (reference)
  3. ID (optional)
The 8th column may contain optional information including STRAND (+/-), TYPE or SVTYPE, and END (the end position where the 2nd column is the start). All optional fields can be used for filtering or showing tooltips with information, but only the first 2 columns are required for basic functionality.

Upload a bed file with genes, repeats, or any other types of elements you want to annotate

Upload a .bedpe file

This is for those large variants that split reads into multiple alignments, e.g. translocations and other variants between positions more than around 1kb apart. These are shown as connections. The smaller variants can be loaded under the "Small variants" tab.

Showing only the first 1000 variants. Sort by clicking column names, and filter by typing into the text boxes for each column. For instance, type >20 or =chr2. Separate multiple filters in a single column using spaces. For bam files, click on a row in the table to fetch reads around that feature.

Automate Ribbon

Make Ribbon automatically go to each variant in a bedpe file and take pictures of the multi-read view and a selection of reads. Instructions: Load a bedpe file and a bam file first, set the settings below and in the right-side panel as you want them and click Run!

Prefix for image files
Number of reads to take pictures of (randomly selected)
Print variant coordinates onto multi-read view
Download a file with info and coordinates for each variant alongside the images
Only select reads with alignments that start or end near the bedpe variant
If a region is too large for the browser to load, automatically subsample
Distance: