6 kyu

Find Transcription Factors

Description
Loading description...
Strings
Algorithms
  • Please sign in or sign up to leave a comment.
  • DallogFheir Avatar

    Great kata but the key order thing is annoying. Either include the expected order in the description or use Chai instead of Codewars' test framework.

  • dfhwze Avatar

    order of results not specified

    • antoniotrkdz Avatar

      Sorry, I am afraid I don't quite get your issue. Could you elaborate more?

    • dfhwze Avatar

      The comment below the result is sort by key like this:['ATF6', 'CREB', 'cMyc', 'Gata1', 'AhR']. This information should be in the description of the kata.

    • antoniotrkdz Avatar

      Being the result an object, I don't think the sorting order is important. Did it fail you if you try to sort the results differently? Have you tried?

    • aland97 Avatar

      Issue still exists.

      Probably Test.assertSimilar compare Object.keys array, JSON.stringify or something like that.

      Please use other compare function.

  • user7820265 Avatar

    the result is sort by key like this:['ATF6', 'CREB', 'cMyc', 'Gata1', 'AhR']

  • Steven Pavlovskii Avatar

    It seems pretty interesting Kata, but i Don't understand it. Why ("TGACGTGACGT"),{ ATF6: [ 1, 6 ] }), ("TGCGTGCGTG"),{ AhR: [ 1, 5 ] }) ? Who could explain please?

    • antoniotrkdz Avatar

      it happens because

      some transcription factors could have overlapping binding sites with others (or with themselves).

      So the ATF6: "TGACGT" binds the sequence "TGACGTGACGT" twice at index 1 and 6 with an overlapping T:

      TGACG|T|
           |T|GACGT
      TGACG|T|GACGT
      1     6
      

      the "TGCGTGCGTG" sequence relative to AhR: "TGCGTG" contains an overlapping TG:

      TGCG|TG|
          |TG|CGTG
      TGCG|TG|CGTG
      1    5
      

      Hope it is clear now, cheers!

  • St3f4n Avatar

    I seem to get everything right but the order of the result object properties prevents me from passing all the tests. Shouldn't I pass as long as the object has all the keys and its values regardless of the order of the properties?

    Expected: {"ATF6":[5],"cMyc":[1]}, instead got: {"cMyc":[1],"ATF6":[5]}

  • dgrcode Avatar

    It has been a nice kata to do! I have learnt new things about RegExp working with this one.

    Thanks! :)

  • HerrWert Avatar

    More Codewarriors should be trying this kata! It is a great way to practice with strings and objects. Thanks for creating it!