Possible new booster api functions for multi-state puzzles

  • state_full_pairing_probabilities_async(index=0)

    for engines that support it, computes the pairing probabilities/dot plot for the state specified by index with the current sequence and oglios, plus any other reagents in concentrations as specified by the designated state.

    Parameters:

    • index: an integer representing the state to get the pairing probabilities for

    Returns: the pairing probabilities as a sparse coordinate matrix (an array of the form [i1, j1, val1, i2, j2, val2, …], omitting matrix entries where the value is zero). The 0-based indices should correspond to the bases as returned by get_full_sequence(index).

  • state_full_subopt_async(index=0, kcalDelta=4.0)

    for engines that support it, folds a sequence (plus any oglios, aptamer w/bonuses, etc) and retrieves information about possible suboptimal structures

    Parameters:

    • index: an integer representing the state to be folded

    • kcalDelta: a number, in kcals per mol, specifying how far from the MFE suboptimal structures should be included

    Returns: an object with the properties suboptStructures (an array of dot-bracket strings of suboptimal structures), suboptEnergyError (an array of numbers corresponding to the suboptimal structures indicating their energy error), and suboptFreeEnergy (an array of numbers corresponding to the suboptimal structures indicating their free energy). If oglios are present they should be in the same order as returned by get_full_sequence(index) and/or get_full_structure(index).

These new functions would help in the generation of dot plots and/or arc plots for multi-state puzzles and labs. The puzzles already encode all of the oglios and concentration, aptamers and bonuses, and other information into the states and the existing API does not make it easy (or in some cases, possible) to properly feed all of this back to the API folding functions; however, the game needs to be able to fold with these oglios/concentrations/aptamers/bonuses, so presumably the ability to do so may already be there, just not exported. The current pairing_probablilities() function seemingly only works for a sequence without oglios, restricting the ability to compute dot plots for multi-state puzzles.

[Edit: I had proposed these a getters, but since the lab tool doesn’t normally need to compute these, I expect they should be async functions instead. Also, I understand that computing pairing probabilities with oglios and aptamer bonuses may be not be easy, but if suboptimal folding can be done (with oglios and aptamers) then a pairing probabilities can be estimated given a known bonus energy and aptamer constraint; it’s how the old arcplot service used to do it.]

1 Like