Flags identifiers that look like decoy (reversed) database entries. Built-in
anchored default prefixes are always considered, unioned with an optional
configured pattern. An empty string or NULL pattern uses the
defaults only.
Usage
is_decoy(ids, pattern = NULL)
Arguments
- ids
character vector of (prefixed) identifiers
- pattern
optional additional decoy regex, unioned with the defaults
Value
logical vector, TRUE where an id looks like a decoy
Examples
is_decoy(c("REV_sp|P1|X", "sp|P2|X", "decoy_3", "normalProtein"))
#> [1] TRUE FALSE TRUE FALSE
is_decoy(c("shuffled_1", "P2"), pattern = "^shuffled_")
#> [1] TRUE FALSE