removeTracksByName,igvR-method | R Documentation |
Remove named tracks
## S4 method for signature 'igvR'
removeTracksByName(obj, trackNames)
obj |
An object of class igvR |
trackNames |
a character vector |
A character vector
getTrackNames
if(interactive()){
igv <- igvR()
setGenome(igv, "hg19")
showGenomicRegion(igv, "MEF2C")
# create three arbitrary tracks
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.1 <- DataFrameAnnotationTrack("track.1", tbl, color="red", displayMode="SQUISHED")
track.2 <- DataFrameAnnotationTrack("track.2", tbl, color="blue", displayMode="SQUISHED")
track.3 <- DataFrameAnnotationTrack("track.3", tbl, color="green", displayMode="SQUISHED")
displayTrack(igv, track.1)
displayTrack(igv, track.2)
displayTrack(igv, track.3)
removeTracksByName(igv, "track.2")
#----------------------------------------
# bulk removal of the remaining tracks,
# but leave the h19 reference track
#----------------------------------------
removeTracksByName(igv, getTrackNames(igv)[-1])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.