Adds one logical “does this sequence match this regex?” column per pattern, using DuckDB’s regexp_matches() via the dd escape hatch.

annotate_tbl_regex(
  tbl_data,
  query_col,
  patterns,
  filter_out = FALSE,
  name_type = c("index", "pattern")
)

Arguments

tbl_data

A duckplyr table (e.g. idata$receptors).

query_col

Character(1). Name of the sequence column to search.

patterns

Character vector of regular expressions.

filter_out

Logical(1). If TRUE, filter out sequences which don't match the pattern.

name_type

One of "pattern" or "index": - "pattern": column names match_regex_<sanitized_pattern> - "index": column names `match_regex_

Value

The input table with new logical match columns added.