Description Usage Arguments Value Examples
The igvR class provides an R interface to igv.js, a rich, interactive, full-featured, javascript browser-based genome browser. One constructs an igvR instance on a specified port (default 9000), the browser code is loaded, and a websocket connection openend. After specifying the reference genome, any number of genome tracks may be created, displayed, and navigated.
1 2 3 4 5 6 7 |
portRange |
The constructor looks for a free websocket port in this range. 15000:15100 by default |
host |
In practice, this is always "localhost" |
title |
Used for the web browser window, "igvR" by default |
browserFile |
The full path to the bundled html, js and libraries, and css which constitute the browser app |
quiet |
A logical variable controlling verbosity during execution |
An object of the igvR class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | if(interactive()){
igv <- igvR(title="igv demo")
setGenome(igv, "hg38")
showGenomicRegion(igv, "MEF2C")
#---------------------------------------------------------------
# an easy transparent way to create a bed track
#---------------------------------------------------------------
base.loc <- 88883100
tbl <- data.frame(chrom=rep("chr5", 3),
start=c(base.loc, base.loc+100, base.loc + 250),
end=c(base.loc + 50, base.loc+120, base.loc+290),
name=c("a", "b", "c"),
score=runif(3),
strand=rep("*", 3),
stringsAsFactors=FALSE)
track <- DataFrameAnnotationTrack("dataframeTest", tbl, color="red", displayMode="EXPANDED")
displayTrack(igv, track)
showGenomicRegion(igv, sprintf("chr5:%d-%d", base.loc-100, base.loc+350))
} # if interactive
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.