Let's say you've got a logical vector after filtering your windows on abundance. For example, if you have a SummarizedExperiment
object named data
:
ab <- aveLogCPM(asDGEList(data))
keep.ab <- ab > 0
Of course, you could use any of the other filtering strategies that are listed in chapter 3 of the user's guide, so long as you get a logical vector with length equal to the number of windows in data
.
Now, let's say you want to filter to keep windows in a bunch of regions as well.
keep.reg <- overlapsAny(rowRanges(data), regions)
You can then combine the two filter vectors with a simple AND operation (see Section 3.7 of the guide). This will retain only those windows that are high-abundance and lie within one of the specified regions:
keep <- keep.ab & keep.reg
filtered.data <- data[keep,]
Of course, this is more stringent than filtering on abundance alone. Make sure that you have enough windows for stable calculation of downstream statistics (at least several thousand, usually).
I'm not sure what you mean. Do you want to filter by the abundance of the windows in addition to their genomic location?
Yes... is it possible?