Simply run Rsamtools::bgzip() and indexTabix() on your BED file and then
rtracklayer::import("my.bed.gz", which = roi_as_granges).




On Tue, Nov 19, 2013 at 10:49 AM, Giovanni Carosso <gacarosso@gmail.com>wrote:

> Hello,
>
> I have three CSV files of genomic intervals (chromosome start, stop, plus
> other information in different columns) each containing between 10k-20k
> lines.
>
> I am looking for a way to pull out from one file only the lines that have
> genomic overlap with both of the other two files. In other words, subset
> file A to include only the lines of file A whose interval overlaps
> intervals in Files B and C.
>
> I'm able to create GRanges and manipulate these to get the subsetted
> GRanges list, but I have not found a way to then use this GRanges as an
> index to pull out the proper lines from CSV file.
>
> Is there a simple way to subset my file in this way that I'm missing?
>
> Thanks,
> Giovanni
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

	[[alternative HTML version deleted]]

