Merge pull request #6533 from RosettaCommons/roccmoretti/server_unavailable
[Foldit] Add timeout for server communication
We're running into a situation where the Foldit server is nominally "up" (so you don't get a full out connection error), but is taking forever to respond. The curl library has a timeout option, so we can recognize we're not getting a response back in a reasonable amount of time, and then raise an error appropriately.
I double checked, and it looks like everything communicating with the server should be properly wrapped to catch the exception -- whether it behaves reasonably when the server connection goes away is another question.
I tested it with the local server, and things seem to work decently when the connection goes away. (It also works with the login on the main server -- we wait for 5 seconds and then report the appropriate connection error.)
Merge pull request #6532 from RosettaCommons/roccomoretti/queue_play_events
[Foldit] Convert play event logging to use a deferred queue
Previously, the play event logging uploaded to the server directly each time it was called. This PR changes it such that the data gets uploaded to the server at the same time the game scores and the cached solutions get uploaded, hopefully reducing lag due to server communication. (The deferred uploads happen in a separate thread.)
I've also changed things around such that the server mutex isn't held throughout the upload process, which should hopefully reduce client freezing due to mutex contention. (e.g. if the main thread wants to post a queued server upload while the periodic upload is happening.)
Merge pull request #6502 from RosettaCommons/roccomoretti/interactive_telemetry
[Foldit] Re-enable event logging
With the switch to the new server, the event logging framework was disabled. This makes it hard to get statistics for player behavior, limiting how much info we can pull out for onboarding analysis. It looks like the data storage facilities are functional server-side, we just need to update the client to actually use the new approach.
This PR updates the old logging facility to fit into the new framework. I've also cleaned up some of the old logging events which we probably don't need to keep track of (should be easy enough to re-enable), and I've also added logging of tool interactions -- every ~15min or so (or when they exit a puzzle) the count of each move type is uploaded, split by script vs. manual usage. Most actions should be already logged, but there's facilities for adding additional actions to monitor.
Note that this needs manual server-side intervention to work. There's a GameplayEvents table which needs to be populated with the contents of standalone::application::GameplayEvent, such that the numbers in the enum match up with the ID in the database table. This can/should be done manually, and can be done any time prior to this code being released. (But should be done before the code goes into devprev.)
Merge pull request #6521 from RosettaCommons/roccomoretti/tag_solutions
[Foldit] Upload snapshots of tagged solutions
Currently, every five minutes the Foldit client uploads the top scoring solution it saw in the last five minutes. This is broken out by puzzle id, but on certain puzzles it would be nice to be able to get finer-grained results. For example, on ligand design puzzles, it might be nice to have results for the top scoring structure per ligand identity, rather than for as the puzzle as a whole. (Such that you can get more diverse design approaches.) This is particularly true for the ligand puzzles which are more docking puzzle: we want results for all structures, not just the top scoring ones.
This PR adds an option to the puzzle_setup file. "post_solution_tag" -- this allows the puzzle creator to specify additional characteristics of the solution result to tag/separate them out. Currently the two options are "Smiles" (splitting the results by the chemical identity of the designable ligand) and "Sequence" (splitting the results by the [protein] sequence of the structure). The default behavior is set to "None", which results in the current one-per-puzzle behavior.
Additionally, I discovered that we're not pushing the results (including scores) to the server on client shutdown. It theoretically should be done in the Server destructor, but that's apparently not getting called, possibly due to details of how std::exit() works with destructors. I've also added facilities to GameApplication::handle_exit() to make sure that the pending solutions and scores are properly flushed on client closing.
Merge pull request #6525 from RosettaCommons/roccomoretti/auto_ss_load
[Foldit] Autogenerate secondary structures if puzzle inputs are missing them
I'm tired of having to load a new pdb in with secret keys, running DSSP, then saving it again in order to get decent default secondary structure display with the protein.
This PR makes it such that if the puzzle input PDB doesn't contain the secondary structure information block, it will automatically run DSSP on the structure and use that instead.
You should still be able to get a non-DSSP secondary structure annotation by manually providing the secondary structure block. But if you forget, you'll get the DSSP based one. (Which is probably what you want, if you didn't think to explicitly specify what it was.)
Merge pull request #6522 from RosettaCommons/roccomoretti/interactive_qtn
[Foldit] Add ability to suppress Quest to the Native popup.
If you include a guide structure in the puzzle, you automatically get a "This protein's structure is known. See if you can match it!" popup.
There's the possibility you may want to include a guide structure without having that popup. (e.g. to provide a reference backbone in case you don't want to move too far.)
This commit adds a puzzle_setup option "quest_to_native" which can be set false to turn off the popup. The default if the option isn't given is true, so existing puzzles should work as they have. Intro/Education/Dojo puzzles should also be unaffected.
Merge pull request #6524 from RosettaCommons/roccomoretti/tweak_ligand_anchor
[Foldit] Add anchor for Tweak Ligand tool
Players have been asking for a way to control which "side" of the ligand changes with the TweakLigand tool.
This PR adds a movable Pin (like the FoldTree pin) which allows them to specify an anchor atom. The anchor atom is held fixed, and everything else rotates from it. (Technically, the ligand is rotated, and then the position and orientation of the anchor atom is adjusted to match.)
This involved abstracting and generalizing the PinGeom from the FoldTreeComposite.
I also adjusted how the rotation amounts were processed, to allow for slightly smoother click-and-hold behavior.
Merge pull request #6523 from RosettaCommons/roccomoretti/interactive_ligand_panel_closure
[Foldit] Close ligand design panel when action isn't possible
The Ligand design panel saves its visiblilty state when switching puzzles. This is a problem when you switch between puzzles where the tool is or is not availible.
We had previously added code to turn off the panel for non-ligand design puzzles. However, we missed the case where the puzzle is a ligand design puzzle, but the ligand design panel tool is turned off (in the puzzle setup).
[Foldit] Add abilty to suppress Quest to the Native popup.
If you include a guide structure in the puzzle, you automatically get
a "This protein's structure is known. See if you can match it!" popup.
There's the possiblility you may want to include a guide structure
without having that popup. (e.g. to provide a reference backbone in case
you don't want to move too far.)
This commit adds a puzzle_setup option `"quest_to_native"` which can be
set false to turn off the popup. The default if the option isn't given
is true, so existing puzzles should work as they have.
Intro/Education/Dojo puzzles should also be unaffected.
Merge pull request #6526 from RosettaCommons/jtscott/interactive_wiggle_side_chains
[Foldit] Wiggle Sidechains
Release Notes: Wiggle Sidechains enabled for Small Molecule Design Puzzles.
This is a somewhat straight forward change, but I think it needs a bit of consideration to double check. In SelectionTool.cc when the conditional statement for wiggle side-chains is triggered, originally this would dispatch to ActionGlobalWiggle.cc which would in turn decide whether to use create_action_dualspace_global_wiggle() if the puzzle contains a designable ligand or create_action_cart_global_wiggle() if not. create_action_cart_global_wiggle() contains all the needed code to do sidechain minimization. This means that currently if puzzle contains a designable ligand, sidechain minimization would be skipped in lieu of dual space minimization.
With this change, unless the ligand is specifically selected, create_action_cart_global_wiggle() will be called when a player uses Wiggle Sidechains. The only issue I can foresee is that this would mean that globally sidechains and the ligand will undergo non dualspace minimization when using this action.
Merge pull request #6497 from RosettaCommons/interactive/petrides/fix_trim_variants_for_chain_breaks
[Foldit] Change How Trim Tool Handles Trimming at Chain Breaks
Merge pull request #6496 from RosettaCommons/interactive/petrides/fix_density_quicksave_loading
[Foldit] Fix Behavior of Density/Score for Quicksave Loading