centerGRangesAtMax: Centers query GRanges at maximum signal in prof_dt.

View source: R/functions_signal_operations.R

centerGRangesAtMaxR Documentation

Centers query GRanges at maximum signal in prof_dt.

Description

Centers query GRanges at maximum signal in prof_dt.

Usage

centerGRangesAtMax(
  prof_dt,
  qgr,
  x_ = "x",
  y_ = "y",
  by_ = "id",
  width = 1,
  view_size = NULL
)

Arguments

prof_dt

a GRanges or data.table as returned by ssvFetch*.

qgr

the GRanges used to query ssvFetch* as the qgr argument.

x_

positional variable. Should almost always be the default, "x".

y_

the signal value variable. Likely the default value of "y" but could be "y_norm" if append_ynorm was applied to data.

by_

region identifier variable. Should almost always be the default, "id".

width

Desired width of final regions. Default is 1.

view_size

the size in x_ to consider for finding the max of y_. if length(view_size) == 1, range will be c(-view_size, view_size). if length(view_size) > 1, range will be range(view_size). default value of NULL uses complete range of x.

Value

a GRanges with same mcols as qgr that has been centered based on signal in prof_dt and with regions of specified width.

Examples

data(CTCF_in_10a_overlaps_gr)
data(CTCF_in_10a_profiles_gr)
data(CTCF_in_10a_profiles_dt)
centerGRangesAtMax(CTCF_in_10a_profiles_dt, CTCF_in_10a_overlaps_gr)
centerGRangesAtMax(CTCF_in_10a_profiles_gr, CTCF_in_10a_overlaps_gr)

centerGRangesAtMax(CTCF_in_10a_profiles_gr, CTCF_in_10a_overlaps_gr, view_size = 50)


jrboyd/seqsetvis documentation built on Dec. 10, 2024, 11:23 a.m.