This function accepts a GRanges input of CpG islands that can be derived from UCSC table browser and rtracklayer::import(yourbed.bed). It resizes the intevals to create 4kb flanking regions around CpG islands. Open sea regions, as defined by Fortin by and Hansen (Genome Biology, 2015), are outside this flanking regions and obtained as their complement.