Henry Hung-Yung Wang wrote:
> 
> I have just written some codes, but they are not doing what I wanted them
> to do. Here are the codes:
> 
> @motif= ('ACGTACGT', 'AAAATTTT', 'CCGGCCGG', 'GGCCGGCC');
> 
> print "Please enter sequences to be examined:\n\n";
> $dna=<STDIN>; chomp $dna;
> 
> @dna=split (//, $dna);
> foreach $bp (0..$#dna-8){
> $eightmer=join ('', @dna[$bp, $bp+1, $bp+2, $bp+3, $bp+4, $bp+5, $bp+6, $bp+7]);

Replace the previous three lines with:

for  ( my $i = 0; $eightmer = substr $dna, $i, 8; $i += 8 ) {


>          if ($eightmer=~ $motif[0]){
>         print "This sequence, $eightmer, is palindromic\n\n";
> } else {
>         print "There is no other palindromic sequences\n\n";
>         exit;
>         }
> }
> 
> I am trying to take the input and make them into sequences of 8 letters.
> Then I want to match the sequences with the 'motif' defined in the codes.
> However, when I run the program, the only motif that was recognized was
> 'AAAATTTT'. What am I doing wrong here? Thanks for the help.

Can you show us some examples of input?  Can you describe how you define
palindromic in this instance.


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to