Skip to content
Jim Robinson edited this page Aug 26, 2016 · 54 revisions

Track Types

Tracks in igv.js are categorized by type. Each type is designed to display a particular class of genomic data, such as read alignments or annotations. Current track types include:

Track Type Description Associated File Types
annotation For displaying non-quantitative genome annotations such as genes. This is the most generic track type. BED, GFF
wig For displaying quantitative genomic data, such as ChIP peaks and alignment coverage. WIG, bigWig, bedGraph
alignment For displaying read alignments. BAM
variant For displaying genome variants. VCF
seg For displaying segmented copy number data. SEG

Configuring Tracks

Tracks can be added during initial browser configuration, or via the browser API with the loadTrack function. In both cases a track is configured with a JSON-like object. For example, the following object creates a gene annotation track from an indexed BED file. The track will open initially in "expanded" mode.

{
      name: "Genes",
      type: "annotation",
      format: "bed",
      sourceType: "file",
      url: "//igv.broadinstitute.org/annotations/hg19/genes/gencode.v18.collapsed.bed",
      indexURL: "//igv.broadinstitute.org/annotations/hg19/genes/gencode.v18.collapsed.bed.idx",
      displayMode: "EXPANDED"
    }

####1) Options for all track types####

Property Description Default
type Track type No default. If not specified, type is inferred from file format
sourceType Type of data source. Valid values are "file", "gcs" for Google Cloud Storage, and "ga4gh" for the Global Alliance API "file"
format File format No default. If not specified format is inferred from file name extension
name Display name (label). Required
url URL to the track data resource, such as a file or webservice. Required
indexURL URL to a file index, such as a BAM .bai, Tabix .tbi, or Tribble .idx file.
indexed Flag used to indicate if a file is indexed or not. If indexURL is provided this flag is redundant, its main purpose is to indicate that a file is not indexed.
order Integer value specifying relative order of track position on the screen. To pin a track to the bottom use Number.MAX_VALUE. If no order is specified, tracks appear in order of their addition.
color CSS color value for track features, e.g. "#ff0000" or "rgb(100,0,100)"
height Initial height of track viewport in pixels 50
autoHeight If true, then track height is adjusted dynamically, within the bounds set by minHeight and maxHeight, to accomdodate features in view true
minHeight Minimum height of track in pixels 50
maxHeight Maximum height of track in pixels 500
visibilityWindow Maximum window size in base pairs for which indexed annotations or variants are displayed 1 MB for variants, 30 KB for alignments, whole chromosome for other track types

####2) Options for tracks of type = "annotation"####

Property Description Default
displayMode Annotation display mode, one of "COLLAPSED", "EXPANDED", "SQUISHED" "COLLAPSED"
expandedRowHeight Height of each row of features in "EXPANDED" mode 30
squishedRowHeight Height of each row of features in "SQUISHED" mode 15
nameField For GFF/GTF file formats. Name of column 9 property to be used for feature label "Name"
maxRows Maximum number of rows of features to display 500
searchable If true, feature names for this track can be searched for. Use this option with caution, it is memory intensive. This option should will not work with indexed tracks. false

####3) Options for tracks of type = "wig"####

Property Description Default
min Sets the minimum value for the data (y-axis) scale. Usually zero. 0
max Sets the maximum value for the data (y-axis) scale. No default. If value is missing or set to undefined, the track will autoscale
color Track color. "rgb(150,150,150)"

####4) Options for tracks of type = "alignment"####

Property Description Default
viewAsPairs If true, paired reads are drawn as a single alignment. false
pairsSupported If false, mate information in paired reads is ignored during downsampling and the 'View as Pairs' option is removed from the alignment track menu. true
deletionColor Color of line representing a deletion "black";
skippedColor Color of line representing a skipped region (e.g. splice junction) "rgb(150, 170, 170)";
insertionColor Color of marker for insertions "rgb(138, 94, 161)";
negStrandColor Color of alignment on negative strand. Applicable if colorBy = "strand" "rgba(150, 150, 230, 0.75)";
posStrandColor Color of alignment or position strand. Applicable if colorBy = "strand" "rgba(230, 150, 150, 0.75)";
colorBy Alignment color option: one of "none", "strand", "firstInPairStrand", or "tag". Specify tag with colorByTag "none"
colorByTag Specific tag to color alignment by.
bamColorTag Specifies a special tag that explicitly encodes an r,g,b color value. Default value is "YC". If "YC" does not encode an r,g,b color value set bamColorTag to null. Must also set "colorBy" to "tag" to enable this option. "YC"
samplingWindowSize Window (bucket) size for alignment downsampling in base pairs 100
samplingDepth Number of alignments to keep per bucket. WARNING: Setting this sampling depth to a high value will likely freeze the browser when viewing areas of deep coverage. 50.
maxRows Maximum number of rows of alignments to display. Note: due to a limit on canvas height the maximum value for this parameter is ~2300 at the default row height of 14. 1000
alignmentRowHeight Height in pixels of an alignment row when in expanded mode 14
filter Alignment filter object. See table 4b

####4a) Options for GA4GH alignment tracks (sourceType = "ga4gh")####

Property Description Default
url URL to the ga4gh endpoint (e.g. https://www.googleapis.com/genomics/v1beta2). Required
readGroupSetIds ID of the read group set represented by this track. (e.g. 'CMvnhpKTFhCjz9_25e_lCw'). Required

####4b) Alignment filter object

Property Description Default
vendorFailed filter alignments marked as failing vendor quality checks (bit 0x200) true
duplicates filter alignments marked as a duplicate (bit 0x400) true
secondary filter alignments marked secondary (bit 0x100) false
supplementary filter alignments marked as supplmentary (bit 0x800) false
mqThreshold filter alignments with mapping quality < supplied value (a number) 0

####5) Options for tracks of type = "variant"####

Property Description Default
displayMode Display option. COLLAPSED => show variants only, SQUISHED and EXPANDED => show calls. EXPANDED
homvarColor CSS color used to represent homozygous non-reference calls. "rgb(17,248,254)"
hetvarColor CSS color used to represent heterozygous calls. "rgb(34,12,253)"
homrefColor CSS color used to represent homozygous reference calls. "rgb(200, 200, 200)"

####5a) Options for GA4GH variant tracks (sourceType = "ga4gh")####

Property Description Default
url URL to the ga4gh endpoint (e.g. https://www.googleapis.com/genomics/v1beta2). Required
variantSetId ID of the variant set represented by this track. (e.g. '10473108253681171589'). Required
callSetIds Array of GACallSet IDs to include with track. Optional. If omitted, all call sets are included

Clone this wiki locally