Wanted: function to center protein on active monomer

Started by BootsMcGraw

BootsMcGraw Lv 1

When working on symmetry puzzles using the Blueprint tool, the active monomer will often suddenly disappear off screen just after adding another structure.

Hitting the "Q" or "home" keys brings the protein to the center of the viewing screen… in most cases.

Hitting one of those two keys in a symmetry puzzles instead brings the centroid of the entire three (or four) structures to the center of screen… leaving a blank screen. One has to hunt for quite some time to find the monomer one was working on, then engage in lengthy digital calisthenics to work it back to the center of the screen.

How about creating a function that centers the monomer with a single keystroke, as well? I could care less about centering the complex until I have finished creating the monomer.

LociOiling Lv 1

Here's a one-liner which seems to work:

ui.CenterViewport ( structure.GetCount () / 2 )

The idea is to center the view on a segment near the middle of the protein.

That seems to bring the main chain into view, but the symmetric chains may still be out of sight.

A next step would be to band the ends of the main chain to each of the symmetric chains, so you could at least see which direction to move things. (Stay tuned.)

georg137 Lv 1

A workaround: With symmetric chains, as a first step band the innermost loop of the main chain to a counterpart on a symmetric chain and disable the band while forming the monomer. Enable the band and wiggle briefly until it can be all be viewed onscreen using the Q shortcut key. Then start positioning the monomers.

BootsMcGraw Lv 1

Loci,

Since I am coding-challenged, would it be possible for you to create a script that does the above? Thank you.

LociOiling Lv 1

I did indeed make that recipe, called "Findit":

https://fold.it/portal/recipe/104352

Perhaps it got lost in the shuffle.

Meanwhile, another one kind of in that line called "clean 1.0" gets rids of bands and freezes, and applies auto-structures:

https://fold.it/portal/recipe/103719

That was handy when Foldit forgot about bands that accidentally got saved with a solution.

The bands issue is fixed, but I'm using it more lately, since the familiar hotkeys are messed up at the moment. Also, on ligand puzzles like the olivetolic acid series, select all plus auto structures won't work. You have to deselect the ligand, then you can auto structure. Seems sort of picky to me. Fortunately, "clean 1.0" isn't bothered by the ligand.