PerlKc has asked for the wisdom of the Perl Monks concerning the following question:
Hi Perl Monks, I need to print the sequence starting with ATG and ending with TGA,TAA,TAG. My code prints the two sets of sequence ending with TAA only, I am having trouble printing sequence ending with TGA as well, as there is TGA codon in the original sequence.
#!/usr/bin/perl #FindCoding.pl use warnings; use strict; use diagnostics; my $sequence = 'AATGGTTTCTCCCATCTCTCCATCGGCATAAAAATACAGAATGATCTAACGAA' +; while ($sequence =~ /(ATG.*?(?:TAG|TAA|TGA))/g){ print "$1\n"; }
The output is: ATGGTTTCTCCCATCTCTCCATCGGCATAA and ATGATCTAA However I am looking for sequence ending with TGA codon as well.
|
|---|