6 kyu

RNA to Protein Sequence Translation

917 of 1,557torret
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • ahmet_popaj Avatar

    Maybe giving it some invalid input to ignore perhaps would make it a little bit more challenging.

  • user1430804 Avatar

    looks hard but very easy challenge !

  • user9644768 Avatar

    Ruby 3.0 should be enabled.

  • Blind4Basics Avatar
    • Need random tests
    • need tests with Stop codons (lots of solution wouldn't stop when they get one)
    • need to store the dict in the preloaded part (that's just boring to have to copy/paste the whole thing)
  • micgeronimo Avatar

    # Stop codon 'UAA':'Stop', 'UGA':'Stop', 'UAG':'Stop' This is preloaded in Acid dict and gives error in Python version, when set to empty strings - all tests pass

  • jpalmieri Avatar

    The random test cases dont' make sense to me, e.g:

    Testing for AUCUUAAGGACAAGCAUCUGUGUC
    ✘ It should work for random inputs too - Expected: "", instead got: "ILRTSICV"

    It is unclear as to why this case should return an empty string rather than be translated. I'm probably missing something.

  • adam-tokarski Avatar

    Thanks for that Kata. I liked it very much for it background - description, and reallife, as you say, test cases.

  • ByteCommander Avatar

    Would be nice if you could predefine and include the dictionary in the test environment, so that we don't have to copy it to the solution code.

  • fubnub Avatar

    Hi all, I wrote a solution which worked for the test cases given to me, but then I kept on receiving an error that said "MNone should equal M". I can't understand what this means, could anyone help me out? Thanks!

  • GiacomoSorbi Avatar

    Translated into Ruby and if you don't mind, I would add random test cases to other languages as well.

    Two small notes: you are imho very either very gifted or passionate in explaining concepts that are by no means a walk in the park, bravo!

    Still imho, having to copy&paste the dictionary/hash/object is a meaningless chore and takes room in the window for no value: I did my Ruby translation preloading a $codons hash (and warning the user they got it that way if they wished), thus I would do the same for other languages as well.

    Let me know about this and random test cases :)

  • keune Avatar

    I can't figure out how to access the predefined dictionary. Where is it?

  • oldccoder Avatar

    This is a good kata - I have a definite interest in chemistry, so I was looking forward to doing it even though I had to do so much work to create the dictionary in code. Not sure everyone willbe so enthusiastic, but it is enjoyable!

  • MMMAAANNN Avatar

    Please don't give up on this. It is a nice and unique kata. Issues are easy to correct, please take a couple of minutes to finish it.

  • oldccoder Avatar

    The dictionary is inaccurate, and the test cases are broken (in the JavaScript version anyway). I had to read through all the comments to figure out why I could not pass the tests. No 'F' codon was found, but in fact it was the Phenylalanine. Please correct these frustrating issues.

  • sdwh Avatar

    Instruction is wrong,UUU, UUC is for F instead of K.

  • OverZealous Avatar

    I don't have much to add to the issues that MMMAAANNN pointed out. This kata will be a lot more fun if you can do these things:

    • Provide a starting dictionary (most important)
    • Fix the errors on the example test cases (the single/double quote is under JavaScript as well)
    • Organize the tests by using describe and it
    • Provide more simple test cases
    • Add more specifics to the specification (for example, what edge cases might be encountered? Or if none, then make it clear that the input will always be valid)
  • MMMAAANNN Avatar

    [Python] Typo in Example test cases (third test): anemone!") must be anemone!') (single quote vs. double quote).

  • MMMAAANNN Avatar

    Are there any special cases possible, such as codons after stop-sequence or number of nucleodites not divisible by 3 (e.g. 100 nucleotides)?

    If not, it might be worthwhile to put it in description that input is always valid.

  • MMMAAANNN Avatar

    For these huge strings, standard message provided by Test.assert_equals is really hard to interpret. Consider making a test which will show which parts of the test string do not correspond to the control string.

  • MMMAAANNN Avatar

    I strongly recommend restructuring your test cases. Instead of describing the function of a protein as a third parameter in test.assert_equals() (which is supposed to be an error message!), put it in a Test.it("...") statement before each assert-equals statement. This, in my opinion, will look much nicer.

  • MMMAAANNN Avatar

    Consider providing this huge amino acid dictionary in a more usable way. Many people will skip this kata just because retyping or transforming all this is somewhat time-consuming and not fun.

  • MMMAAANNN Avatar

    You have a typo in provided aminoacid dictionary. In the tests, phenylalanine is F, while in the description it is K (as well as Lysine).

  • MMMAAANNN Avatar

    Consider correcting

    def protein('UGCGAUGAAUGGGCUCGCUCC') returns 'CDEWARS'

    to

    protein('UGCGAUGAAUGGGCUCGCUCC') returns 'CDEWARS'

    (remove def there).