Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^5: Urgent help required. Need a code to translate a given nucleotide sequence into proteins using codon table.

by tmharish (Friar)
on Feb 14, 2013 at 14:18 UTC ( [id://1018733]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Urgent help required. Need a code to translate a given nucleotide sequence into proteins using codon table.
in thread Urgent help required. Need a code to translate a given nucleotide sequence into proteins using codon table.

suchetana
Basically I need to find the ORFs in the thread in three reading frames. and then translate.

I have no idea what ORFs or frames are. I dont know what this translate is ... and I dont really want to.

What I do know is Perl ... So if you gave a chunk of input and corresponding output you expect that will help.

suppose TATGCATGGCATATATATACGTACGTATGCATATATATGCTAA. I want to find the substring that has ATG......TAA while reading from the first T Then I want it to start reading from the second alphabet and find the substring having ATG...TAA and again then the same thing from T to get ATG....TAA.

I dont get that completely but here is ( a simplified version of ) something that can do it:

use strict; use warnings ; my $string = 'TATGCATGGCATATATATACGTACGTATGCATATATATGCTAA' ; my %found_strings ; for( my $start = 0; $start < length( $string ); $start++ ) { my $string_to_check = substr( $string, $start ) ; if( $string_to_check =~ /(ATG.*?TAA)/ ) { $found_strings{ $1 } = 1 ; } } my @found = keys %found_strings ; foreach my $found ( @found ) { print "$found\n"; } exit() ;

And the output

ATGCATATATATGCTAA ATGGCATATATATACGTACGTATGCATATATATGCTAA ATGCTAA ATGCATGGCATATATATACGTACGTATGCATATATATGCTAA

I have no idea what the rest of that means:

Also, I then need to store these three substrings in three different scalars/arrays. Then I need to translate them, like if the first three are ATG it should return say M, then it reads the next 3 characters of that substring and say it is CAT. Then it will return X say. Likewise. How do I go about? Please please help

Except of course the please please part that does not help at all ... So if you explain what you want that will help us give you something.

And finally - You have been told several times about use strict; so whats with not adding it?

  • Comment on Re^5: Urgent help required. Need a code to translate a given nucleotide sequence into proteins using codon table.
  • Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1018733]
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-25 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found