I have a S4 list (peakAnnoList) which contains many Chip-Seq data in the Granges format.
I would like to subset/filter peakAnnoList based on one of its slot (
$width > 4000). Here is the code to generate peakAnnoList:
## loading packages library(ChIPseeker) library(TxDb.Hsapiens.UCSC.hg19.knownGene) txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene library(clusterProfiler) files <- getSampleFiles() peakAnnoList <- lapply(files, annotatePeak, TxDb=txdb, tssRegion=c(-3000, 3000), verbose=FALSE)
peakAnnoList is a list with 5 elements and each elements contains combination of "csAnno" and "GRanges" and some other objects. I would like to filter all 5 elements of
width > 4000. Here is the position of width (
peakAnnoList[]@anno@ranges@width). I can do that with only 1 elements of list by converting it to
data.frame, but I would like to have it for all the elements.