Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Print A Sequence with Start codon and different Stop Codon

by Anonymous Monk
on Oct 27, 2015 at 23:21 UTC ( [id://1146196]=note: print w/replies, xml ) Need Help??


in reply to Print A Sequence with Start codon and different Stop Codon

#!/usr/bin/perl # http://perlmonks.org/?node_id=1146191 use strict; use warnings; my $sequence = 'AATGGTTTCTCCCATCTCTCCATCGGCATAAAAATACAGAATGATCTAACGAA' +; $sequence =~ /(ATG.*?(?:TAG|TAA|TGA))(??{print "$1\n"})/;

which prints:

ATGGTTTCTCCCATCTCTCCATCGGCATAA ATGGTTTCTCCCATCTCTCCATCGGCATAAAAATACAGAATGA ATGGTTTCTCCCATCTCTCCATCGGCATAAAAATACAGAATGATCTAA ATGATCTAA

Replies are listed 'Best First'.
Re^2: Print A Sequence with Start codon and different Stop Codon
by PerlKc (Novice) on Oct 28, 2015 at 01:44 UTC

    Output is right on dot, but couldn't get it when I used the code you posted.

Re^2: Print A Sequence with Start codon and different Stop Codon
by PerlKc (Novice) on Oct 28, 2015 at 01:50 UTC

    THanks Bunch, It Works. YAYYYYYYYY! I have a quick question what does the ?? before the print command does?

      See "(??{ code })" in perldoc perlre

        should that be "(?{ code })" instead of "(??{ code })" ?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1146196]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-18 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found