Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

iupac2regex

Ambiguity symbol conversion


Description

Converting DNA ambiguity symbols to regular expressions, and vice versa.

Usage

iupac2regex(sequence)
regex2iupac(sequence)

Arguments

sequence

Character vector containing DNA sequences.

Details

The DNA alphabet may contain ambiguity symbols, e.g. a W means either A or T. When using a regular expression search, these letters must be replaced by the proper regular expression, e.g. W is replaced by [AT] in the string. The iupac2regex makes this translation, while regex2iupac converts the other way again (replace [AT] with W).

Value

A string where the ambiguity symbol has been replaced by a regular expression (iupac2regex) or a regular expression has been replaced by an ambiguity symbol (regex2iupac).

Author(s)

Lars Snipen.

Examples

iupac2regex("ACWGT")
regex2iupac("AC[AG]GT")

microseq

Basic Biological Sequence Handling

v2.1.4
GPL-2
Authors
Lars Snipen, Kristian Hovde Liland
Initial release
2021-01-25

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.