recomWindow: Extend an interval or SNP by distance in centimorgans...

Description Usage Arguments Author(s) See Also Examples

View source: R/humarray.R


It is straightforward to extend a genomic interval or position by a number of basepairs, or a percentage, but extending by recombination units of centimorgans is more involved, requiring annotation lookup. This function streamlines this process. This function makes use of recombination rate hapmap reference files to calculate recombination distances for genome locations, in centimorgans. For a given position (or vector), a window can be returned of a given extension on either side of the position, for instance, 1 centimorgan to the left, and to the right of a SNP, giving a 2 centimorgan range as a result. Warning - this function only uses build hg18/36, so please convert to build 36 coordinates before using this function.


recomWindow(ranges = NULL, chr = NA, start = NA, end = start,
  window = 0.1, bp.ext = 0, = NULL, info = TRUE)



optional GRanges or RangedData object describing positions for which we want to generate windows, removing the need to enter chr, start and end


character, an optional vector of chromosomes to combine with 'start' and 'end' to describe positions for which to generate recombination windows


integer, an vector of start points for chromosome ranges


integer, an vector of end points for chromosome ranges


numeric, number of centimorgans to extend the window either side of the range or location (can be a fraction)


numeric, optional number of base-pairs to extend the window by in addition to the centimorgan extension

recombination map object (list of 22 data.frames) generated using ''; if you are performing many of these operations, loading this object into your workspace and passing it on to this function will save loading it each time, and provide a speed advantage. Only use an object generated by, as otherwise the results will almost certainly be meaningless.


logical, whether to display the derived window size and number of hapmap SNPs within the window for each window derived


Chris Wallace and Nicholas Cooper

See Also, get.nearby.snp.lists, expand.nsnp


# not run, as initial download of the recombination map takes nearly a minute #
rd <- RangedData(ranges=IRanges(start=c(1.5,10.1)*10^7, end=c(1.55,10.1)*10^7),space=c(2,10))
rd # show original data
recomWindow(rd) # now extended by the interval
recomWindow(as(rd,"GRanges"),info=FALSE) # also works for GRanges

humarray documentation built on May 20, 2017, 2:15 a.m.

Search within the humarray package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.