filtering (deleting) the overlapped genomic ranges from two GRangelist using findOverlaps
0
0
Entering edit mode
6.5 years ago
rahel14350 ▴ 40

Dear all, I have two Grnage list (gr2=repeatmask.hg38 from UCSC; gr1=CpGs methylation regions from RRBS data). I want to filter out the CpGs that are in the genome repeated regions. I did it like this, do you think if it is correct?

hits <- findOverlaps(gr2, gr1)

head(hits)

Hits object with 6 hits and 0 metadata columns:

queryHits subjectHits

<integer>   <integer>

[1] 2 11832

[2] 2 11833

[3] 2 11834


queryLength: 5520017 / subjectLength: 58660550

idx <- unique(subjectHits(hits))

head(idx)

[1] 11832 11833 11834 11835 11840 11841

rownames(gr1) <- gr1$ids

gr1_unique <- gr1[! ids %in% idx,]

OR

unique_gr1 <- gr1[-match(idx,gr1$ids),]

Many thnkas in advance, Rahel

findOverlap GenomicRanges overlapped • 2.5k views
ADD COMMENT

Login before adding your answer.

Traffic: 1860 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6