Skip to content

Instantly share code, notes, and snippets.

@hcorrada
Created December 18, 2014 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hcorrada/f930fa0092f1100f1d37 to your computer and use it in GitHub Desktop.
Save hcorrada/f930fa0092f1100f1d37 to your computer and use it in GitHub Desktop.
Loading a bed file using epivizr
library(epivizr)
library(rtracklayer)
# download example bed file
download.file("https://raw.githubusercontent.com/arq5x/bedtools/master/data/aluY.hg19.bed.gz", destfile="test.bed.gz", method="curl")
# start UI
mgr <- startEpiviz(workspace="mi9NojjqT1l")
# import bed file
gr <- import(BEDFile("test.bed.gz"))
# drop data from unplaced contigs
gr <- keepSeqlevels(gr, paste0("chr",c(1:22,"X","Y")))
# add track with bed file data
dev <- mgr$addDevice(gr, "example bed")
# finish up
mgr$stopServer()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment