Thanks. If possible please post R code.
3 answers
I think the easiest way is to upload the peak file (bed file) to UCSC genome browser, and manually check if there are any peaks near COX-1. other tools like PAVIS, annotateGenomicRanges, homer, bedtools, bedops and R packages ChIPpeakAnno and ChIPseeker can annotate the whole peak file.
It'd be simplest to just use the ChIPpeakAnno package in Bioconductor. Alternatively, just import everything as GRanges objects and use the nearest() function with a bit of scripting.
Interesting, thanks for pointing that out. I agree that it should take the strand of a peak (when known) into account and calculate distances accordingly. Has there been any movement on fixing this?
The author don't believe this is an issue as she replied in my blog post.
They don't fix this issue, you can refer to the supplemental file of http://bioinformatics.oxfordjournals.org/cgi/content/abstract/btv145.
This is also my motivation of developing ChIPseeker, https://github.com/GuangchuangYu/ChIPseeker
BEDOPS offers a tool for this called closest-features, which finds the nearest query element(s) to each of a set of reference elements. (In your use case, TF binding sites would be query elements, and your genes (say, TSSs) are your reference elements.)
It's very simple to use, and very fast, with a low memory profile. R and libraries often have a habit of loading everything into system memory, which can be a problem if you're working with large datasets.
To get your TFs ready, you can use the bedops set operation tool to filter your transcription factor set for TF binding sites that overlap ChIP-seq peaks or other regions. Take a look at the --element-of operation.
Then you might use closest-features to look for the nearest ChIP-seq-peak-overlapping-TF to each member of your set of, for example, gene transcription start sites (COX-1, etc.).
Log in to answer this question.