Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by thundergnat (Deacon)
on Feb 13, 2013 at 20:08 UTC ( #1018621=note: print w/ replies, xml ) Need Help??

Comment on Re^3: Urgent help required. Need a code to translate a given nucleotide sequence into proteins using codon table.
Re^4: Urgent help required. Need a code to translate a given nucleotide sequence into proteins using codon table.
by suchetana on Feb 13, 2013 at 20:10 UTC
    can i please get a corrected code? please? instead of wasting time in arguing, please could you get me the full code? i tried several others, to no avail
      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?

Re^4: Urgent help required. Need a code to translate a given nucleotide sequence into proteins using codon table.
by suchetana on Feb 13, 2013 at 20:27 UTC
    please could you stop arguing and help me with the full program? please?

      I will happily provide you with the full program. You can expect delivery once you pay me for my services.


      #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

      I believe we are stumbling over a cultural issue here.

      suchetana, PerlMonks is a website that has mostly Westerners as users. The culture here is to ask for help with something specific: "Here's my program that I want to do X, but it's doing Y. How do I fix it?" If this is the approach you use -- and you seem to be making efforts to fix your code yourself with help from the other users -- then very often people will pitch in to help you solve your problem (learning by doing), sometimes even writing a whole program to demonstrate something: but only when they've seen you doing your work of trying to make your own program work first.

      Many of us have been taken advantage of by unscrupulous people who want to have us do work for them without either helping or paying us back, so when someone says "This is my program and it doesn't work, can you fix it?", we very often say "no" even though technically we could do the programming because it breaks the implicit social contract: that people come to Perlmonks to learn how to solve their own problems.

      When we help fix very broken programs, it's because people bringing them make it clear how hard they're working to fix the program and take our advice. (We try to give advice first, because if you solve one problem, the next one gets easier - this is why math is taught by doing lots of problems).

      When you seem to ignore advice (e.g., "try adding 'use strict' to your program"), and say "please fix it", we get the impression that you are not doing the work to learn, but instead just want someone to do your work for free. When people ask you to clarify things and give examples of how the program is supposed to work, they are trying to get you back on the "helping yourself" track. If you don't respond to those questions by trying to do as the poster asks, this strengthens the impression that you're not trying to solve your own problem.

      So I'm recommending you try some of the hints that were made and let us know how they worked; if 'use strict' tells you that there are things to fix, try fixing them before coming back - and be ready to post in detail the things you tried when trying to fix problems. If we know you're trying to fix it, we're much more likely to pitch in and help you fix things.

      If I'm reading the signs right, you're trying to be respectful and not claim knowledge that you do not have in front of experts. We understand that, and we know you're not trying to pretend you're a big-time Perl programmer; what we're trying to do is help you learn what you need to know by making suggestions leading you to find the solution yourself (a modified version of the Socratic method).

      It's OK to not know this either - cultures are complex. This is my attempt to show you how this one works so you can participate in it effectively.

        pemungkah

        I agree with you on everything except:

        I believe we are stumbling over a cultural issue here.

        If by culture you mean "Culture of learning" then I agree, but, as seems to be the case from your post, if you are talking about western vs eastern(?) culture then I am not sure that is the case.

        I am in/from Bangalore, India and the fact that the OP has, as pointed out by you, repeatedly ignored suggestions to do something as trivial as use strict; after extended requests and an explanation on why -w is not the same as strict, is an annoyance to me.

        dasgar has gone so far as to rewrite the code in a readable format ( which was then updated in the OP ? ), people on both Stack overflow and PM have talked about how it should be return 'D'; and not return D;, Multiple people have provided formatting tips and all there has been in response is: please could you stop arguing and help me with the full program? please?

        I am not a Westerner and I share your views:

        So I'm recommending you try some of the hints that were made and let us know how they worked; if 'use strict' tells you that there are things to fix, try fixing them before coming back - and be ready to post in detail the things you tried when trying to fix problems. If we know you're trying to fix it, we're much more likely to pitch in and help you fix things.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-07-12 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (240 votes), past polls