I have a vector sequence and would like to find the following nucleotide sequence in it.


This query sequence uses several degenerate symbols, defined as:

  • S = C or G (Strong)
  • Y = C or T (pYrimidine)
  • W = A or T (Weak)
  • R = A or G (puRine)

(See this page for a complete description of the IUPAC nucleotide codes.)

Is there a tool to align this sequence with the vector and find all the possible sites?

EDIT: I found this website but couldn't find any of the resources helpful. Maybe one of these will work but I found most of them too complicated. If you know which one will work and explain how to use it I will be grateful.

  • $\begingroup$ I could've sworn NCBI BLAST can do that? Have you tried it? $\endgroup$ – Armatus Apr 30 '13 at 22:12

If you're looking for an exact match, you don't really need a complex aligner. Perl regular expressions are pretty powerful at string transformations or conditional matching of substrings. For example, to find all matches of AASYWSRA in a nucleotide sequence $seq, you can do:

@matches = $seq =~ m/AA[CG][CT][AT][CG][AG]A/g;

The [] brackets are known as Perl character classes, which allow different characters in a position.


I've never utilized the feature, but I know Vmatch allows you to define your own alphabets and symbol mappings, which should allow you to handle the IUPAC ambiguous nucleotide symbols. The default alphabet/mapping may even include these symbols.


I have used MAST to search for particular motifs in a sequence.

From the MAST intro page, it looks like you'll have to reformat your motif a little, but it should suffice for your purposes:

Motifs are represented as position-dependent scoring matrices that describe the score of each possible letter at each position in the pattern.

Here is more info on formatting, which also indicates that the alphabet you use will be interpreted correctly.


protected by Chris Aug 17 '14 at 14:36

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.