Hello all,
The following perl script looks for the pattern in each line (fasta file). the problem that when they found a pattern (an occurrence) in a sequence, it goes directly to the next line without continuing to check if there are other pattern (an occurrence) in the same line .Please, can someone help me fix this script so that when it finds a pattern in a line going to the next letter and not to the next line. Essentially he can find many patterns in the same line.
please help me
thanks
The following perl script looks for the pattern in each line (fasta file). the problem that when they found a pattern (an occurrence) in a sequence, it goes directly to the next line without continuing to check if there are other pattern (an occurrence) in the same line .Please, can someone help me fix this script so that when it finds a pattern in a line going to the next letter and not to the next line. Essentially he can find many patterns in the same line.
Code:
#!/usr/bin/perl use strict; use warnings; use Bio::SeqIO; my $file = 'file.txt'; my $in = Bio::SeqIO->new(-file => $file, '-format' => 'fasta'); while (my $seq = $in->next_seq()) { if ($seq->seq =~ m/(ATCGA)/) { print "ATCGA commence à la position $-[1]\n"; print "se termine juste avant la position $+[1]\n"; } }
thanks
Comment