Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: extracting open reading frame (ORF) from a FASTA file

by borisz (Canon)
on Jul 10, 2005 at 11:10 UTC ( #473750=note: print w/replies, xml ) Need Help??


in reply to extracting open reading frame (ORF) from a FASTA file

local $_ = $your_input_string; while ( /ATG/g ) { my $start = pos() - 3; if ( /T(?:AA|AG|GA)/g ) { my $stop = pos; print $start, " ", $stop, " ", $stop - $start, " ", substr ($_, $start, $stop - $start), $/; } }
Boris

Replies are listed 'Best First'.
Re^2: extracting open reading frame (ORF) from a FASTA file
by Nadiah (Novice) on Jul 12, 2005 at 07:28 UTC
    Hi Boris,

    about ur codes right.. may i know what this line means and why do we need to minus 3?
    my $start = pos() - 3;

    secondly, substr ($_, $start, $stop - $start), $/;

      -3 since the position is after ATG. $/ is just the newline for the print statement.
      Boris
Re^2: extracting open reading frame (ORF) from a FASTA file
by Nadiah (Novice) on Jul 12, 2005 at 08:01 UTC
    Hi Boris,

    Thanks for your help.. but I need further explainations on the codings.

    About the codes right.. may i know what this line means and why do we need to minus the pos() by 3?
    my $start = pos() - 3;
    Secondly, why is there a need for this substr statement? substr ($_, $start, $stop - $start), $/;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2022-01-20 17:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (57 votes). Check out past polls.

    Notices?