AnnotationFilterList: Combining annotation filters

Description Usage Arguments Value Note See Also Examples

Description

The AnnotationFilterList allows to combine filter objects extending the AnnotationFilter class to construct more complex queries. Consecutive filter objects in the AnnotationFilterList can be combined by a logical and (&) or or (|). The AnnotationFilterList extends list, individual elements can thus be accessed with [[.

value() get a list with the AnnotationFilter objects. Use [[ to access individual filters.

logicOp() gets the logical operators separating successive AnnotationFilter.

not() gets the logical operators separating successive AnnotationFilter.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
AnnotationFilterList(..., logicOp = character(), logOp = character(),
  not = FALSE)

## S4 method for signature 'AnnotationFilterList'
value(object)

## S4 method for signature 'AnnotationFilterList'
logicOp(object)

## S4 method for signature 'AnnotationFilterList'
not(object)

## S4 method for signature 'AnnotationFilterList'
simplify(object)

## S4 method for signature 'AnnotationFilterList'
distributeNegation(object,
  prior_negation = FALSE)

## S4 method for signature 'AnnotationFilterList'
show(object)

Arguments

...

individual AnnotationFilter objects or a mixture of AnnotationFilter and AnnotationFilterList objects.

logicOp

character of length equal to the number of submitted AnnotationFilter objects - 1. Each value representing the logical operation to combine consecutive filters, i.e. the first element being the logical operation to combine the first and second AnnotationFilter, the second element being the logical operation to combine the second and third AnnotationFilter and so on. Allowed values are "&" and "|". The function assumes a logical and between all elements by default.

logOp

Deprecated; use logicOp=.

not

logical of length one. Indicates whether the grouping of AnnotationFilters are to be negated.

object

An object of class AnnotationFilterList.

prior_negation

whether the previous AnnotationFilterList object was negated (meant to not be utilized by user).

Value

AnnotationFilterList returns an AnnotationFilterList.

value() returns a list with AnnotationFilter objects.

logicOp() returns a character() vector of “&” or “|” symbols.

not() returns a character() vector of “&” or “|” symbols.

AnnotationFilterList object with DeMorgan's law applied to it such that it is equal to the original AnnotationFilterList object but all !'s are distributed out of the AnnotationFilterList object and to the nested AnnotationFilter objects.

Note

The AnnotationFilterList does not support containing empty elements, hence all elements of length == 0 are removed in the constructor function.

See Also

supportedFilters for available AnnotationFilter objects

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Create some AnnotationFilters
gf <- GenenameFilter(c("BCL2", "BCL2L11"))
tbtf <- TxBiotypeFilter("protein_coding", condition = "!=")

## Combine both to an AnnotationFilterList. By default elements are combined
## using a logical "and" operator. The filter list represents thus a query
## like: get all features where the gene name is either ("BCL2" or "BCL2L11")
## and the transcript biotype is not "protein_coding".
afl <- AnnotationFilterList(gf, tbtf)
afl

## Access individual filters.
afl[[1]]

## Create a filter in the form of: get all features where the gene name is
## either ("BCL2" or "BCL2L11") and the transcript biotype is not
## "protein_coding" or the seq_name is "Y". Hence, this will get all feature
## also found by the previous AnnotationFilterList and returns also all
## features on chromosome Y.
afl <- AnnotationFilterList(gf, tbtf, SeqNameFilter("Y"),
                            logicOp = c("&", "|"))
afl

dvantwisk/AnnotationFilter documentation built on May 8, 2019, 11:11 p.m.