expand.nsnp: Expand genomic locations to the ranges covering the 'n' closest SNPs
Description
Sometimes for chip data we want to create windows around some locus, and
fixed distance [see flank()], recombination distance [see recomWindow()] or a number of SNPs
might be used. This function allows expansion of regions according to a set number of SNPs.
The result gives two regions for each row of a GRanges or RangedData object describing
the start and end of the left flanking 'nsnp' region, and right flanking 'nsnp' region
respectively.
a GRanges or RangedData object describing the locations for
which we want to find regions encompassing 'nsnps' closest SNPs.
snp.info
An object of type: ChipInfo, RangedData or GRanges, describing the set of SNPs
you are using (e.g, chip annotation). If left as null the ChipInfo object from chip.support()
with default options() will be used
nsnp
Number of nearest SNPs to return for each location
add.chr
logical, whether to add a chromosome column for the output object
Value
Two regions for each row of a the 'ranged' object describing
the start and end of the left flanking 'nsnp' region, and right flanking 'nsnp' region
respectively. If 'ranged' has rownames these should stay in the same order in the resulting
object. Chromosome will be the final column if you set add.chr=TRUE.