findIntersections: findIntersections

Description Usage Arguments Details Value Note Examples

View source: R/utils.R

Description

Finds the intersections of a data line with a given threshold

Usage

1

Arguments

data

(GRanges with y mcol) A GRanges with the data points

thr

(numeric) The value at wich we want to calculate the intersections

Details

Given a GRanges with an mcol with name "y" representing the values. This function will return a GRanges with the points intersecting a specific value "thr".

Value

A GRanges representing the intersection points between the data line and the threshold. It will return an empty GRanges if the line does not intersect the threshold.

Note

Important: It will only return the intersection points where the line crosses the threshold but not if a data point lies exactly at the threshold.

Examples

1
2
3
4
5
6
d <- toGRanges(c("1:1-1", "1:5-5", "1:15-15"))
d$y <- c(-2, 3, 1)
 
findIntersections(d, 1.5)  
findIntersections(d, 0)  
findIntersections(d, 5)  

karyoploteR documentation built on Nov. 8, 2020, 5:52 p.m.