Entering edit mode
Hi all,
I am searching a solution for the following problem:
I have two GRanges objects, one with exon coordinates e.g.
chr1 400 600 gene1 exon1
chr1 800 900 gene1 exon2
chr7 100 200 gene2 exon1
chr7 300 500 gene2 exon2
and one with the corresponding coding sequences coordinates.
chr1 500 850
chr1 500 850
chr7 300 500
chr7 300 500
Coding regions were repeated accordingly, so that both GRanges have
the
same length.
I want to restrict the exon GRanges object to the coding regions.
pintersect looks promising but has problems if the two ranges don't
overlap at all, which can happen if an exon falls completely within
one
of the UTRs (line 3 above). I tried to filter out these exons
beforehand, but there is no parallel version of countOverlaps and I
don't want to overlap the entries of the first GRanges with any of the
second as there maybe different genes/transcripts at the same
location.
There must be a better solution than a for loop ;-)
Regards,
Christian