plot_feature_overlap_signal_profiles: plot_feature_overlap_signal_profiles

View source: R/functions_plot.R

plot_feature_overlap_signal_profilesR Documentation

plot_feature_overlap_signal_profiles

Description

plot_feature_overlap_signal_profiles

Usage

plot_feature_overlap_signal_profiles(
  grouped_prof_dt,
  group_var = "overlap_group",
  rank_var = "rnk",
  fill_limits = NULL,
  signal_var = "y",
  color_var = "name",
  color_mapping = NULL,
  facet_var = "name_split",
  heatmap_free_y = TRUE
)

Arguments

grouped_prof_dt

Output of make_feature_overlap_signal_profiles

group_var

character. Must already be present in grouped_prof_dt. Use make_feature_overlap_signal_profiles to add properly. Default is "overlap_group".

rank_var

character. Must already be present in grouped_prof_dt. Use make_feature_overlap_signal_profiles to add properly. Default is "rnk".

fill_limits

Limits of heatmap fill scale.

signal_var

value to plot

Value

list of ggplot plots that use feature overlaps to plot signal

Examples

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)]
query_dt[, name_split := gsub("_", "\n", name)]

peak_files = dir(system.file("extdata", package = "seqqc"), pattern = "Peak$", full.names = TRUE)
names(peak_files) = sub("_CTCF_rand.+", "", basename(peak_files))
peak_grs = seqsetvis::easyLoad_narrowPeak(peak_files, )
overlaps_gr = seqsetvis::ssvOverlapIntervalSets(peak_grs)
query_gr = resize(overlaps_gr, 6e2, fix = "center")

group_prof_dt = make_feature_overlap_signal_profiles(query_dt, overlaps_gr)

plots = plot_feature_overlap_signal_profiles(group_prof_dt)
cowplot::plot_grid(plotlist = plots)

FrietzeLabUVM/ssvQC documentation built on March 25, 2024, 12:24 a.m.