centerFixedSizeGRanges: Transforms set of GRanges to all have the same size.

View source: R/functions_signal_operations.R

centerFixedSizeGRangesR Documentation

Transforms set of GRanges to all have the same size.

Description

centerFixedSizeGRanges First calculates the central coordinate of each GRange in grs and extends in both direction by half of fixed_size

Usage

centerFixedSizeGRanges(grs, fixed_size = 2000)

Arguments

grs

Set of GRanges with incosistent and/or incorrect size

fixed_size

The final width of each GRange returned.

Value

Set of GRanges after resizing all input GRanges, either shortened or lengthened as required to match fixed_size

Examples

library(GenomicRanges)
grs = GRanges("chr1", IRanges(1:10+100, 1:10*3+100))
centered_grs = centerFixedSizeGRanges(grs, 10)
width(centered_grs)

jrboyd/seqsetvis documentation built on Oct. 15, 2024, 11:28 p.m.