Compress genome coordinates of a matrix of polygons

compressPolygonM(polyM, ref2c, minRatio = 5, verbose = FALSE, ...)

Arguments

polyM

data.frame including x,y coordinates of polygons, cov and gr to group each polygon.

ref2c

list output from make_ref2compressed().

minRatio

the minimum ratio of coordinate compression required before polygon resolution is downsampled.

verbose

logical indicating whether to print verbose output.

...

additional arguments are ignored.

Value

data.frame with the same colnames, with reduced rows for polygons where the coordinate compression defined in ref2c is above minRatio ratio. The compressed coverage roughly represents the max coverage value for each point.

Details

This function takes a two-column numeric matrix of polygons where the x coordinate is the genomic position, and y coordinate is the coverage. It uses ref2compressed$transform to convert coordinates to compressed coordinates, as output from make_ref2compressed().

For regions that have been compresssed, it then compresses the y-coordinate information to roughly one y value per integer in compressed coordinate space, using the runmax across the window of coverages compressed to this value.

See also

Other jam spatial functions: bgaPlotly3d(), dfWide2segments(), simplifyXY(), spline3d()