One-directional bands (like bumpers) for Contact Map puzzles

Case number:845813-996372
Topic:Game: Tools
Opened by:jeff101
Status:Open
Type:Suggestion
Opened on:Saturday, November 30, 2013 - 18:07
Last modified:Friday, December 7, 2018 - 11:59

When last I checked (with recipe http://fold.it/portal/recipe/46844 DoBandsObeyHookesLaw1), Foldit bands obeyed Hooke's Law for springs: F = -k x, where k is a spring constant, x is the distance the band has been stretched from its equilibrium value, and F is the force exerted by the band. The - sign is there to tell the direction of the force F (the force is always opposite to the direction the band is stretched or compressed from equilibrium, forcing the inter-atom distance back towards equilibrium). These bands behave like springs attached at both ends to the protein.

Would it be possible to add a new class of bands that act like springs attached at just one end to the protein? One kind would behave like bumpers on cars. If the band gets compressed below its equilibrium distance, the band behaves like normal and obeys Hooke's Law, forcing the distance back toward equilibrium. Nevertheless, if the band is stretched beyond its equilibrium distance, the band exerts no force on the protein.

Another kind of band would obey Hooke's Law when stretched beyond its equilibrium distance, but exerts no force when compressed below its equilbrium distance.

These new kinds of bands would help with Contact Map puzzles (see http://foldit.wikia.com/wiki/Contact_map for example). With two of these bands, one could set the minimum and maximum distances between two atoms on the protein. As long as the atoms stay between these minimum and maximum distances, the bands behave as if they are not present, but once the atoms move out of the desired minimum to maximum range, the atoms will feel Hooke's Law forces like from normal bands, forcing the distance between the atoms back into the desired minimum to maximum range.

(Sat, 11/30/2013 - 18:07  |  7 comments)


Joined: 09/21/2011
Groups: Void Crushers
jeff101's picture
User offline. Last seen 10 hours 1 min ago. Offline
Joined: 04/20/2012
Groups: Go Science

The type of band described above as:

"Another kind of band would obey Hooke's Law when stretched beyond its equilibrium distance, but exerts no force when compressed below its equilbrium distance."

could be built with a spring and two unstretchable strings. It could look like this:

atom1-----string-----/////spring/////-----string-----atom2

For short distances between atoms 1 and 2, the strings would be slack, the spring would be unstretched, and this would exert no force between atoms 1 and 2. For distances long enough to fully-extend the strings, the spring would start to stretch, and this would exert a force that attracts atoms 1 and 2 toward each other.

spmm's picture
User offline. Last seen 1 day 1 min ago. Offline
Joined: 08/05/2010
Groups: Void Crushers

Also this original post by Timo which collates the variety of requests for bands:
http://fold.it/portal/node/992891

jeff101's picture
User offline. Last seen 10 hours 1 min ago. Offline
Joined: 04/20/2012
Groups: Go Science

One-directional bands would be helpful in puzzles like
"1127: Revisiting Puzzle 87: Zinc Binding Protein"
(http://fold.it/portal/node/2001066)
that have multiple cysteines (here 4)
but are modeled as in a reduced environment,
where no disulfide bonds are expected to form.

In such puzzles, one could put bumper-like bands
between each possible pair of cysteine residues
so they will stay far enough apart
that they will not form any disulfide bonds.

brow42's picture
User offline. Last seen 1 week 6 days ago. Offline
Joined: 09/19/2011
Groups: None

Sorry I didn't mean to -1 you.

I think this is doable in rosetta. It may take some work on the part of jflat or maybe someone more into rosetta internals though. It will also have some of the same issues as threshold filters (but mitigated by being part of wiggle, where the filters are not).

Your very interesting script http://fold.it/portal/recipe/46844 showed that F=s^2 (x-x0), which implies the rosetta energy due to stretched band is E = (1/2) [s (x-xo)]^2 (*). Can this be changed to a one-sided function easily (essentially with E = 0 and dE/dx = 0 for x < x0)? It all depends on how rosetta works. jflat has said bands are implemented as a constraint, which is slightly different than an explicit energy term, though in this case they work out to be the same thing.

(*) A surprising consequence of this is that 1 band of str 2 is much stronger than 2 bands of str 1.

jeff101's picture
User offline. Last seen 10 hours 1 min ago. Offline
Joined: 04/20/2012
Groups: Go Science

You could try to up-vote the post below about
letting users change their votes on posts
http://fold.it/portal/node/992701

jeff101's picture
User offline. Last seen 10 hours 1 min ago. Offline
Joined: 04/20/2012
Groups: Go Science
While it would be better if one-way bands were a 
built-in Foldit feature, coders can approximate 
them as follows:

When you make a one-way band, decide what type it 
is and then add a string called btype to the Note 
for its band # bnum:

band.SetNote(bnum,(band.GetNote(bnum)..' '..btype))

For bands that keep their present lengths below 
their goal lengths, use for btype something like 
'max', 'maxlen', 'lopass', 'keeplo', or 'keepbelow'.

For bands that keep their present lengths above 
their goal lengths, use for btype something like 
'min', 'minlen', 'hipass', 'keephi', or 'keepabove'.

Other recipes can then decide what kind of band it
is using:

-- below finds bkind for band j 
-- by reading band.GetNote(j).
function getbkind(bnum) 
local bkind,bnote
bnote=band.GetNote(bnum) 
   -- above gets string bnote for band # bnum.
bkind=0 -- default: holds for normal, 2-way bands.
if string.find(bnote,"keepbelow")~=nil then
   -- bnote contains 'keepbelow'.
   if string.find(bnote,"keepabove")~=nil then 
      -- bnote has both 'keepbelow' & 'keepabove'.
      -- This shouldn't happen & shows an error. 
   else -- bnote contains 'keepbelow' only.
      bkind=1 -- a 1-way band that is 
      -- enabled when its length > goal length and
      -- disabled when its length <= goal length.
   end -- if string
elseif string.find(bnote,"keepabove")~=nil then 
   -- bnote contains 'keepabove' only.
   bkind=2 -- a 1-way band that is 
      -- enabled when its length < goal length and
      -- disabled when its length >= goal length.
end -- if string
return bkind
end -- getbkind()

If band.SetNote and band.GetNote don't exist yet, 
one can store bkind (a 0, 1, or 2) from above as one 
of the digits after the decimal point in the band's 
strength or goal length. Other recipes can then read 
bkind from the band's strength or goal length. For 
more details on storing information in & reading 
information from a band's strength or goal length, 
see https://fold.it/portal/node/2002640

Then, within a recipe made to enforce 1-way bands, 
put code like below near the start of the recipe:

-- below records the initial state of each band:
nbands=band.GetCount() -- initial # of bands.
oldbenabled={} -- will be a list of nbands booleans.
bgl={} -- will be a list of nbands band goal lengths.
bstr={} -- will be a list of nbands band strengths.
bnote={} -- will be a list of nbands band notes.
bkind={} -- will be a list of nbands integers 
   -- that equal 0, 1, or 2.
for j=1,nbands do
   oldbenabled[j]=band.IsEnabled(j) -- reads a boolean.
   bgl[j]=band.GetGoalLength(j) -- reads a real #.
   bstr[j]=band.GetStrength(j) -- reads a real #.
   bnote[j]=band.GetNote(j) -- reads a string.
   bkind[j]=getbkind(j,bnote[j],bgl[j],bstr[j]) 
      -- find bkind[j] (a 0, 1, or 2) by reading 
      -- bnote[j] or a special digit from bgl[j] 
      -- or bstr[j].
end -- for j

Then, periodically within the recipe, do as follows:

-- below enforces 1-way bands:
for j=1,nbands do
   if oldbenabled[j] then -- only do below for 
      -- bands that began the recipe as enabled.
      if bkind[j]==1 then -- a 1-way band 
         -- that keeps its length <= goal length.
         if band.GetLength(j) <= bgl[j] then
            band.Disable(j) -- band not needed.
         else -- length > goal length.
            band.Enable(j) -- band is needed.
         end -- if band
      elseif bkind[j]==2 then -- a 1-way band 
         -- that keeps its length >= goal length.
         if band.GetLength(j) >= bgl[j] then
            band.Disable(j) -- band not needed.
         else -- length < goal length.
            band.Enable(j) -- band is needed.
         end -- if band
      end -- if bkind
   end -- if oldbenabled
end -- for j

Finally, right before the recipe ends, do as below 
to enable or disable the bands like they were at the 
start of the recipe:

-- below restores each band to its initial state
for j=1,nbands do
   if oldbenabled[j] then -- band j began as enabled.
      band.Enable(j) -- re-enable band j.
   else -- band j began as disabled.
      band.Disable(j) -- re-disable band j.
   end -- if oldbenabled
end -- for j

Please note that I haven't tested any of this code.
You may need to change it to make it work correctly.
Sitemap

Developed by: UW Center for Game Science, UW Institute for Protein Design, Northeastern University, Vanderbilt University Meiler Lab, UC Davis
Supported by: DARPA, NSF, NIH, HHMI, Amazon, Microsoft, Adobe, RosettaCommons