# NOT RUN {
test_path <- system.file("tests", package = "rtracklayer")
bed_file <- file.path(test_path, "test.bed")
gr <- read_bed(bed_file)
bed_file_out <- file.path(tempdir(), "new.bed")
write_bed(gr, bed_file_out)
read_bed(bed_file_out)
#' bedgraph
bg_file <- file.path(test_path, "test.bedGraph")
gr <- read_bed_graph(bg_file)
bg_file_out <- file.path(tempdir(), "new.bg")
write_bed(gr, bg_file_out)
read_bed(bg_file_out)
# narrowpeaks
np_file <- system.file("extdata", "demo.narrowPeak.gz",package="rtracklayer")
gr <- read_narrowpeaks(np_file, genome_info = "hg19")
np_file_out <- file.path(tempdir(), "new.bg")
write_narrowpeaks(gr, np_file_out)
read_narrowpeaks(np_file_out)
# }
Run the code above in your browser using DataLab