Ideogram.js is a JavaScript library for chromosome visualization. Ideogram supports drawing and animating genome-wide datasets. Its API consists of configuration options and methods. You can see examples of almost all these options and methods -- as well as their actual effect -- in the many live examples. Simply "View source" in any example page.
See the main README for installation instructions.
To start, you need to instantiate the Ideogram
class. Configuration options -- which organism's genome to display, in what orientation, with which annotation data, etc. -- are passed into the Ideogram
constructor as a JavaScript object.
For example:
var ideogram = new Ideogram({
organism: 'human',
annotations: [{
name: 'BRCA1',
chr: '17',
start: 43044294,
stop: 43125482
}]
});
- annotations
- annotationHeight
- annotationsColor
- annotationsLayout
- annotationsPath
- assembly
- barWidth
- brush
- chrHeight
- chrMargin
- chrWidth
- chromosomes
- container
- dataDir
- onBrushMove
- onDrawAnnots
- onLoad
- organism
- orientation
- ploidy
- resolution
- rotatable
- rows
- showBandLabels
- showChromosomeLabels
- showFullyBanded
- showNonNuclearChromosomes
Array. Optional. A list of annotation objects. Each annotation object has at least a chromosome name (chr), start coordinate (start), and stop coordinate (stop). Annotation objects can also have a name, color, shape, and track index. Example in Annotations, basic.
See also annotationsPath.
Number. Optional. The height of each annotation. Example in Annotations, tracks.
String. Optional. Default: "#F00" (i.e., red). The color of each annotation. Example in Multiple, primates.
String. Optional. Default: "tracks".
The layout of this ideogram's annotations. One of "tracks", "histogram", or "overlay".
Lay out annotations in tracks beside each chromosome. There can be more than one track, which is useful for displaying annotations by category (e.g. pathogenic, unknown significance, benign). Example in Annotations, tracks.
Lay out annotations in a histogram. This clusters annoatations by location, such that each cluster or bin is shown as a bar. The height of the bar represent the number of annotations in that genomic range. This option is useful for summarizing the distribution of many (1000+) features througout the genome. Example in Annotations, histogram.
Lay out annotations directly over chromosomes. This is the most space-efficient annotation layout option. Example in Annotations, overlay.
String. Optional. An absolute or relative URL to a JSON file containing annotation objects. Example in Annotations, overlay.
See also annotations.
String. Optional. Default: latest RefSeq assembly for specified organism. The genome assembly to display. Takes assembly name (e.g. "GRCh37"), RefSeq accession (e.g. "GCF_000306695.2"), or GenBank accession (e.g. "GCA_000005005.5").
Number. Optional. Default: 3. The pixel width of bars drawn when annotationsLayout: 'histogram'
. Example in Annotations, histogram.
Boolean. Optional. Default: false. Flag to set a brush (a.k.a. slider window) on a chromosome. Useful when ideogram consists of one chromosome and you want to be able to focus on a region within that chromosome. Example in Brush.
Number. Optional. Default: 400. The pixel height of the tallest chromosome in the ideogram. Examples in Layout, small and Annotations, basic.
Number. Optional. Default: 10. The pixel space of the margin between each chromosome. Example in Multiple, primates.
Number. Optional. Default: 10. The pixel width of each chromosome. Example in Annotations, tracks.
Array. Optional. Default: all chromosomes in assembly. A list of the names of chromosomes to display. Useful for depicting a subset of the chromosomes in the genome, e.g. a single chromosome. Example in Annotations, basic.
String. Optional. Default: "body". CSS selector of the HTML element that will contain the ideogram. Example in Layout, small.
String. Optional. Default: "../data/bands/native/". Absolute or relative URL of the directory containing data needed to draw banded chromosomes. Example in GeneExpressionAging/ideogram.
Function. Optional. Callback function to invoke when brush moves. Example in Brush.
Function. Optional. Callback function to invoke when annotations are drawn. This is useful for when loading and drawing large annotation datsets. Example in web-tests.js.
Function. Optional. Callback function to invoke when chromosomes are loaded, i.e. rendered on the page. Example in Annotations, external data.
String or number or array. Required. Organism(s) to show chromosomes for. Supply organism's name as a string (e.g. "human"
) or organism's NCBI Taxonomy ID (taxid, e.g. 9606
) to display chromosomes from a single organism, or an array of organisms' names or taxids to display chromosomes from multiple species. Example in Human.
String. Optional. Default: horizontal. The orientation of chromosomes on the page. Example in Mouse.
Number. Optional. Default: 1. The ploidy -- i.e., number of chromosomes -- to depict for each chromosome set. Useful for biologically accurate depicting of genomes that are diploid, triploid, etc. Example in Ploidy, basic.
Number. Optional. Default: highest resolution available for specified genome assembly. The resolution of cytogenetic bands to show for each chromosome. The quantity refers to approximate value in bands per haploid set (bphs). One of 450, 550, or 850. Example in Layout, small.
Boolean. Optional. Default: true. Whether chromosomes are rotatable upon clicking them. Example in Layout, small.
Number. Optional. Default: 1. Number of rows to arrange chromosomes into. Useful for putting ideogram into a small container, or when dealing with genomes that have many chromosomes. Example in Layout, small.
String. Optional. Default: male. The biological sex of the organism. Useful for omitting chromosome Y in female mammals. Currently only supported for organisms that use XY sex-determination. Examples in Layout, small.
Boolean. Optional. Default: false. Whether to show cytogenetic band labels, e.g. 1q21. Example in Annotations, basic.
Boolean. Optional. Defaut: true. Whether to show chromosome labels, e.g. 1, 2, 3, X, Y. Example in Annotations, basic.
Boolean. Optional. Default: true. Whether to show fully banded chromosomes for genomes that have sufficient data. Useful for showing simpler chromosomes of cytogenetically well-characterized organisms, e.g. human, beside chromosomes of less studied organisms, e.g. chimpanzee. Example in Multiple, primates.
Boolean. Optional. Default: false. Whether to show non-nuclear chromosomes, e.g. for mitochondrial (MT) and chloroplast (CP) DNA. Example in Eukaryotes: Sus scrofa.