drhicks has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I am writing a script to search for motifs in DNA sequence. A user of this program would input at the command line, their fasta file containing the DNA sequence string, and a particular motif to search for. I wish to use the substr() function to search for the particular motif. So far, this is easy enough to do when using A = A, T = T, C = C, and G = G. However, I would like to add the rest of the IUPAC code so that users may define motifs such as ATCNRC, where N = A, T, C, or G and R = A or G? The full IUPAC nucleic acid code is below.
Thanks for any help!A = '[A]'; C = '[C]'; G = '[G]'; T = '[T]'; R = '[AG]'; Y = '[CT]'; M = '[AC]'; K = '[GT]'; W = '[AT]'; S = '[GC]'; B = '[CGT]'; D = '[AGT]'; H = '[ACT]'; V = '[ACG]'; N = '[ACGT]';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Defining substring matches
by BrowserUk (Patriarch) on Sep 21, 2013 at 00:42 UTC | |
by jwkrahn (Abbot) on Sep 21, 2013 at 01:24 UTC | |
by Anonymous Monk on Sep 21, 2013 at 02:19 UTC | |
by BrowserUk (Patriarch) on Sep 21, 2013 at 02:38 UTC | |
by AnomalousMonk (Archbishop) on Sep 21, 2013 at 14:32 UTC | |
by BrowserUk (Patriarch) on Sep 21, 2013 at 15:22 UTC | |
by drhicks (Novice) on Sep 21, 2013 at 15:40 UTC |