View source: R/functions_write.R
write_bed_overlaps | R Documentation |
write_bed_overlaps
write_bed_overlaps(overlaps_gr, assign_dt, file = "regions_with_overlaps.txt")
overlaps_gr |
GRanges of regions used to make assign_dt with memb table in mcols. |
assign_dt |
data.table with "id" and "cluster_id" that maps region ids to clusters. In output from |
file |
File to write to |
invisibly returns data that is written to file
bw_files = dir(system.file("extdata", package = "seqqc"), pattern = "^M.+bw$", full.names = TRUE)
query_dt = make_dt(bw_files)
query_dt[, sample := sub("_FE_random100.A", "", name)]
peak_files = dir(system.file("extdata", package = "seqqc"), pattern = "Peak$", full.names = TRUE)
peak_grs = seqsetvis::easyLoad_narrowPeak(peak_files)
overlaps_gr = seqsetvis::ssvOverlapIntervalSets(peak_grs)
query_gr = resize(overlaps_gr, 6e2, fix = "center")
prof_dt = seqsetvis::ssvFetchBigwig(query_dt, query_gr, return_data.table = TRUE)
sig_res = plot_signals(prof_dt, query_gr)
assign_dt = sig_res$cluster_assignment
outdir = system.file("extdata", package = "seqqc")
write_bed_overlaps(overlaps_gr, assign_dt,
file = file.path(outdir, "regions_with_overlaps.txt"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.