igv | R Documentation |
Controls IGV on localhost (or specified host, separate from where R session is running). Igv application must be running and listening to a specified port. Then if you configure this port via environment variables (IGV_HOST, IGV_PORT) in the current R session then you can apply the following usages
igv(fn) ## sends any given file(s) into igv (eg .bam, .wig, .bed) igv(loci = cool.loci) ## plots the windows specified as GRanges or IGV-parsable strings (eg gene name) igv(gr = cool.gr) ## sends granges object to igv session, Note: currently requires the ability to write to a public_html that is web viewable by computer running IGV igv(snapshot = fn) ## sends current screen to file igv(new = TRUE) ## refreshes current session igv(reset = TRUE) ## resets connections, sometimes useful if IGV not responding
If alternate file paths are present on server (where R is runinng) and computer running IGV, then can specify gsub.paths variable which is a list of length 2 vectors specifying how to convert file paths from arguments given to igv to ones that can be loaded locally.
igv(
paths = NULL,
gr = NULL,
loci = NULL,
snapshot = NULL,
track.view = NULL,
new = FALSE,
reset = FALSE,
wkspace = "PanLungWGS",
host = Sys.getenv("IGV_HOST"),
mac = !grepl("(^cga)|(node\\d+)", host),
rawpaths = FALSE,
sort.locus = NULL,
gsub.paths = list(),
port = Sys.getenv("IGV_PORT")
)
paths |
file paths to display on current igv session (=NULL) |
gr |
GRanges or GRAngesList of numeric genomic data or interval genomic annotations to send to IGV session, if gr has field $score then data will be dumped to .bw otherwise to .bed or .gff (=NULL) |
loci |
GRanges or IGV parsable string specifying what window(s) on genome to view (=NULL) |
snapshot |
file path to store snapshot in (has to be interpretable on file system where IGV is running) |
track.view |
command for setting the track display mode ("expand","squish" or "collapse") |
new |
logical flag whether to start new IGV session |
reset |
logical flag whether to reset connection between R and IGV (useful if IGV non responsive) |
host |
character specifying host where IGV is running |
mac |
logical flag specifying whether host is a local "mac" (ie then apply gsub.paths) otherwise keep paths the same |
gsub.paths |
list of length 2 vectors specifying gsub args to apply to filenames when mac = TRUE |
port |
integer specifying port where IGV is running |
Marcin Imielinski
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.