gr.round: Round a set of GRanges to another set "rounds" a set of query...

gr.roundR Documentation

Round a set of GRanges to another set "rounds" a set of query ranges Q to a given interval set S using the following rule: 1) If q in Q is partially / fully within S then return intersection of q with S. 2) If q intersects multiple ranges in S and up = F then return the "first" range, otherwise the last range 3) If q in Q is fully outside of S (ie fully inside not S) then return the start-1 (if up = T) or end+1 (if up = F) of the matching range in not S

Description

Round a set of GRanges to another set "rounds" a set of query ranges Q to a given interval set S using the following rule: 1) If q in Q is partially / fully within S then return intersection of q with S. 2) If q intersects multiple ranges in S and up = F then return the "first" range, otherwise the last range 3) If q in Q is fully outside of S (ie fully inside not S) then return the start-1 (if up = T) or end+1 (if up = F) of the matching range in not S

Usage

gr.round(Q, S, up = TRUE, parallel = FALSE)

Arguments

Q

Query GRanges (strand is ignored)

S

Subject GRanges (strand is ignored)

up

[default TRUE] See description.

parallel

[default FALSE] If TRUE, assumes Q and S are same length and this analysis is only performed between the corresponding Q and S pairs.

Value

Rounded GRanges

Examples

## Not run: query   <- GRanges(1, IRanges(c(100,110),width=201), seqinfo=Seqinfo("1", 500))
subject <- GRanges(1, IRanges(c(160,170),width=201), seqinfo=Seqinfo("1", 500))
gr.round(query, subject)
## End(Not run)

mskilab/skitools documentation built on Aug. 31, 2023, 1:13 p.m.