Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hello dear PerlMonks, I'm trying to match a certain pattern in a DNA sequence and retrieve the position of the match. This wouldn't create a problem, but I don't know how to use the pos() function on an array. I also don't know how to use $- with an unknown amount of matches. This is what I have so far:
@TATA = ($seq =~ m/TATA[A|T][A|T][A|T|G]/i) $number_of_TATA = @TATA; if ($number_of_TATA > 0){ print "The positions of the TATA box are:"; foreach (@TATA){ $TATA_position=pos($TATA)-7; print $TATA_position."\n"; }
I'd greatly appreciate the help! thanks a lot!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: positions of multiple matches
by AnomalousMonk (Archbishop) on Nov 05, 2011 at 15:31 UTC | |
|
Re: positions of multiple matches
by mrstlee (Beadle) on Nov 05, 2011 at 19:11 UTC | |
|
Re: positions of multiple matches
by Anonymous Monk on Nov 05, 2011 at 15:42 UTC |