I am attempting to get gene regions and their immediate neighborhoods using Bioconductor GenomicRanges packages.
It is very easy for me to extend the regions around genes if I want to extend it the same distance upstream and downstream as in this example:
genes = genes(Homo.sapiens)
genes_5kb_flank = genes + 5000
And if I want to extend both upstream and downstream different amounts centered on the TSS I can use
promoters(genes, upstream = 5000, downstream= 1000)
But I am having trouble finding a function that is strand-aware and also chromosome length aware that allows me to extend the gene region a different amount upstream vs. downstream... For instance if I wanted a 5kb upstream flanking region and a 1kb downstream flanking region as is used for genomic region annotations on GREAT.
Anyone know of a drop in function for this? something like
promoters() but for the full gene region instead of only around the TSS?