Scripting Interface Feedback

So nice to see the script interface available within eterna :slight_smile:

a couple of simple lines of code example that could be pasted in at the click of a button might make sense.

so for example I see further up the page that if you have a puzzle solving script then you need to have a particular chunk at the start of your code
“So if you want your script be evaluated correctly, you have to make your script getting first parameter as secondary structure.”

but it’s not quite clear what that means
does it mean the variable that you get must be called secondary structure?
does it mean that it must be something that is populated by …(((…)))) type stuff ?

also I see a few bits like ‘ajaxmanager not defined’ in the results of clicking test on player structures that could probably do with some sort of feedback to the developers, but generally I wanted to cheer quietly when I saw this section this morning. I need to brush up on my coding now - and this is super motivation :slight_smile:

This is what I’m talking about, a Emscripten/Clang port of ALL Vienna to javascript for us.

Looks like a job for serious scripting by players for players :slight_smile:

There seems to be a bug in the RNA structure parsing when given a structure with a hook (dangling) but that starts with a stack rather than an unbonded base.

The script… will show this given an input of ‘((…)).((…)).’ (without the quotes) as the structure string.

child: hairpin,2,3,4
child: internal,7,15
parent: stack,0,1,5,6
parent: stack,0,1,5,6
child: stack,8,9,13,14
parent: internal,7,15
child: hairpin,10,11,12
parent: stack,8,9,13,14

Return value : ((…)).((…)).

Should be:

child: stack,0,1,5,6
child: stack,8,9,13,14

as 7,15 are part of a hook, not an internal loop

Yes starting with a stack–and having a dangle elsewhere seems to throw an error as you describe.

I think there might be use in writing a scripting tutorial that showed things like:

  1. how to load a puzzle by puzzle-id
    1a) its target shape
    1b) any constraints
    1c) extra stuff for switches?
  2. how to load a lab solution, by id
    2a) fetch the target shape
    2b) any constraints
    2c) fetch its sequence
    2d) fetch its overall score (if any)
    2e) fetch its per-bond scoring (if any)
  3. how to access all sequences for a lab (by lab id)
    3a) all submissions
    3b) solutions picked for sequencing
    3c) solutions sequenced and scored
  4. how to use any test harnesses for
    4a) puzzle solvers
    4b) strategy market

So should we, can we use something like this to track the ideas/solutions as they progress?

Trello Board:…

Hi Edward I’m glad to hear that you enjoy our script interface.

About your secondary structure question, the latter you said is correct. Your script should get first parameter as secondary structure “string”. And this string followed dot and parenthesis rule (as you said ‘…(((…)))’ string will be injected into your script).

And about ajaxmanager, actually this class is only used for developing sites infrastructure. But I found that many script users need this class so dev team will talk about this problem.

This has been added to our issue tracker with ticker number #146

You can check the issue at…

Thanks jandersonlee!

EteRNA team

This has been added to our issue tracker with ticker number #147

You can check the issue at…

Thanks for your suggestion!

EteRNA team


Any chance of getting a Canvas widget added to the script page? You can do some *neat* things in HTML5 with a JavaScript Canvas.

Maybe you can find your widget here:

Qt GUI Toolkit ported to javascript-via emscripten.…

Some puzzles have characters other than (.) in the secondary string (e.g. Synthetic RNA-Difficulty Level 4, which throws off the getPairmap() function, making them harder to solve. Is this a bug in getPairmap() or the puzzle data?

Possible bug in structure parsing by RNA. Script… creates a structure from a puzzle string and then walks it, but the map() function does not seem to visit all elements given the structure created from puzzleId=683941:

child: internal,4,5,6,7,8,9,41,42,43,44,45   
parent: stack,0,1,2,3,46,47,48,49   
child: stack,10,11,39,40   
parent: internal,4,5,6,7,8,9,41,42,43,44,45   
child: bulge,21   
parent: stack,10,11,39,40   
child: stack,12,13,14,18,19,20   
parent: bulge,21   
child: hairpin,15,16,17   
parent: stack,12,13,14,18,19,20   
Return value : ((((......(((((...))).((....)).........)).....))))   

Confirmed, gives erroneous output as you describe with both puzzle ID or dot-bracket structure as input.

Let me check that issue tracker :slight_smile: I just realized that some users want to talk ideas about script/programming in certain place…

This is good. I’m not sure how it fast but let me check gui widget also… :slight_smile:

Thanks for your report jandersonlee, parsing RNA issue already added our issue tracker. Let me check it also.

Is there some reason the script testing seems to have ceased? I have not seen any new results posted since late last week?