12 replies [Last post]
Susume's picture
User offline. Last seen 1 day 12 hours ago. Offline
Joined: 10/02/2011

Imagine what recipes you would like to write if you could ask all the bands on the protein which segments they are attached to!

I just had a crazy idea for storing in each band the segment numbers it connects to. We can store at least 9 digits after the decimal in the Strength property of the band. I propose using some of those digits to store the "from" and "to" segment numbers. Consider this Strength value: 1.001002001 The first two digits after the decimal can be anything and are used to actually control the strength of the band. The next 3 digits ("100") indicate the "from" segment number. The next 3 ("200") indicate the "to" segment number. The 9th digit is always 1 and guarantees that all the other 8 digits will be returned even if the "to" segment number includes trailing zeros (as in this case, we don't want the Strength rounded to 1.001002 just because segment 200 ends in zeros). (Not sure if this last digit is really important.) The digits used for storing segment numbers will add an insignificant amount to the intended strength of the band.

Here are some other sample "smart" Strength values:
1.500010631 - strength 1.50, from seg 1 to seg 63
0.500251501 - strength 0.50, from seg 25 to seg 150
9.990250351 - strength 9.99, from seg 25 to seg 35 (Note that when you want a strength 10 band you would have to use 9.99, because setting the strength greater than 10.0 throws an error.)
1.001210001 - strength 1.00, from seg 121 to space ("to" seg number is zero)

To make this work, we would need a library of functions to:
1. given two segment numbers, add a band and set its strength to include the band info, returning the band number
2. given a band number and a desired strength, set the band strength (rounding it to 2 decimal places) while preserving the band info
3. test whether a strength value returned by band.GetStrength is a valid "band info" value, and return both the strength and the band info
4. query all the bands on a protein and build a table of their "from" and "to" segments and band numbers
5. given a pair of seg numbers, return the band number connecting them, or a zero if there is no such band

Some of the above could be wrappers for existing band functions. There is also the possibility to replace some of the current band functions (see BitSpawn's library for turning filters on and off for a sample of how to do this). Eventually there would be a family of recipes that only make these "smart" bands and of recipes that use "smart" bands that other recipes have left behind. There could also be one simple recipe that you use to add a "smart" band when working by hand - select two segs and run the recipe; if exactly two segs are selected it adds a "smart" band there; else it gives you two sliders to choose which segs to add the band between. There would also have to be a recipe that lets you set the strength on an existing band when working by hand - select the two segs it connects, run the recipe, and enter the strength you want.

Does anyone think this would be useful? What script functionality would you like to see using "smart" bands? Suggestions for improving this framework?

bertro's picture
User offline. Last seen 5 hours 1 min ago. Offline
Joined: 05/02/2011
Groups: Beta Folders
What a great idea and quite

What a great idea and quite easy to implement! :)

bertro's picture
User offline. Last seen 5 hours 1 min ago. Offline
Joined: 05/02/2011
Groups: Beta Folders
We could go up easily to 13

We could go up easily to 13 decimals like this: 0.1234561234561

so the strength could go from 0.000000 to 9.999999 (here: 0.123456 with FromSeg: 123, toSeg: 456 and Guard: 1)

jeff101's picture
User offline. Last seen 1 day 17 min ago. Offline
Joined: 04/20/2012
Groups: Go Science
Other ideas:

Using 3 decimal places for a segment # allows segments 0 to 999. This should be sufficient for a few years, but maybe someday we will be doing Foldit puzzles with 1000-9999 segments and so will need 4 decimal places for each segment #.

Also, to make "smart" band strengths closer to their desired values, we could always list the lower #'d segment first.

With these ideas, a "smart" band with desired strength 1.00 from segment 121 to space would have the strength 1.00000001211 (or even 1.0000000001211 if we used 13 #'s after the decimal).

jeff101's picture
User offline. Last seen 1 day 17 min ago. Offline
Joined: 04/20/2012
Groups: Go Science
Is the guard digit (final digit) really needed?

I think LUA lets us format number outputs to list as many digits after the decimal point as we want, whether or not the number ends with a bunch of 0's after the decimal point. I think the guard digit is not needed because of this. So, with 13 digits after the decimal point, we could use the 1st 5 digits for the band strength, and the last 8 digits could be 4 digits for each segment # (0-9999). Thus, we could have band strengths from 0.00000 to 9.99999, and a band with strength 9.99999 between segments 1 and 8888 could be encoded like 9.9999900018888.

Susume's picture
User offline. Last seen 1 day 12 hours ago. Offline
Joined: 10/02/2011
guard digit probably not needed

I think you are right that the final (guard) digit is not needed. I was thinking originally of string formatting and not wanting to lose trailing zeros, but of course we can use modulo and math functions to get/set just the digits we want, and trailing zeros will not be a problem.

jeff101's picture
User offline. Last seen 1 day 17 min ago. Offline
Joined: 04/20/2012
Groups: Go Science
LUA Code Bits:

I think you could do like below in LUA if the band with the number bnum exists:

bstr=band.GetStrength(bnum)
bstr1=math.floor(bstr*1e5)/1e5 -- bstr1 is down to 5 digits after the decimal pt in bstr
bleft=bstr-bstr1 -- bleft is like bstr with first few digits reset to 0
seg1=math.floor(bleft*1e9) -- seg1 is digits 6-9 after the decimal pt in bstr
bleft=bleft-(seg1/1e9) -- bleft should now have its next 4 digits reset to 0
seg2=math.floor(bleft*1e13) -- seg2 is digits 10-13 after the decimal pt in bstr 
bleft=bleft-(seg2/1e13) -- ideally bleft is now all 0's
print('Strength '..bstr..' for band '..bnum..' gives bstr1='..bstr1..' seg1='..seg1..' seg2='..seg2..' and bleft='..bleft..'.')

Another way might be as follows:

bstr=band.GetStrength(bnum)
str=string.format("%15.13f",bstr) -- make str be 15 characters long: 1 before & 13 after the decimal pt
bstr1=string.sub(str,1,7)+0 -- convert characters 1-7 of str into the number bstr1
seg1=string.sub(str,8,11)+0 -- convert characters 8-11 of str into the number seg1
seg2=string.sub(str,12,15)+0 -- convert characters 12-15 of str into the number seg2
print('Strength '..bstr..' for band '..bnum..' gives bstr1='..bstr1..' seg1='..seg1..' and seg2='..seg2..'.')
jeff101's picture
User offline. Last seen 1 day 17 min ago. Offline
Joined: 04/20/2012
Groups: Go Science
Atom #'s, starting length rho, and theta,phi angles:

For every segment #, there is also an atom #. Each atom # could be 0 to 99. Perhaps we could give up some digits from the segment #'s and the band strength to make room for atom #'s. It could be like 9.9990030511106 for a band of strength 9.999 from segment 3's atom 5 to segment 111's atom 6.

For a band to space, would it be useful to consider the band's starting length rho and theta,phi angles? rho, theta, & phi are all defined in a coordinate system established by several segment #'s and atom #'s (see http://foldit.wikia.com/wiki/Foldit_Lua_Function_band.Add for details). Perhaps just setting one segment # and one atom # to 0 is enough for a band to space. Then it would be like 5.5550000022211 for a band of strength 5.555 from segment 222's atom 11 to space.

jeff101's picture
User offline. Last seen 1 day 17 min ago. Offline
Joined: 04/20/2012
Groups: Go Science
More numbers can be stored in a band's goal length:

band.SetGoalLength and band.GetGoalLength deal with a band's goal length.
One could use some of the goal length's digits after the decimal place to
store more information.

Joined: 09/24/2012
Groups: Go Science
Needed for Band In Space

I think most of what you want to achieve exists already in the "archive user bands" functions of various recipes (Ebola rebuild, Enhanced DRW, GAB etc).

I wrote a recipe able to "copy-paste bands". This is currently in evaluation in our group's recipes but I'll share it asap to public. It's here: http://fold.it/portal/recipe/100369

When copying a band, all related information can be retrieved and archives in LUA tables (and in delimited text to copy on clipboard), which fits many purposes you desire.

There are problems with such a recipe:

1) It's quite time consuming (in order to find the segments, the recipe has to scan all distances from the protein and compare them with the band length);

2) It's possible to identify bands to sidechains, but this is huge time consuming; (btw how to include bands to sidechains withing the system you propose?)

3) It's impossible to identify (copy, archive etc) Bands In Space

I think your proposal is certainly useful for dealing with Bands In Space

jeff101's picture
User offline. Last seen 1 day 17 min ago. Offline
Joined: 04/20/2012
Groups: Go Science
How to include bands to sidechains?

In general for each amino acid, atoms 0-4 are the heavy atoms of the backbone while atoms 5 and up are the heavy atoms of the sidechain. See http://foldit.wikia.com/wiki/Foldit_Lua_Function_band.Add for some details.

Using the atom #'s as in http://fold.it/portal/node/2002640#comment-32942 above would let one treat bands to/from sidechains.

Susume's picture
User offline. Last seen 1 day 12 hours ago. Offline
Joined: 10/02/2011
great suggestions!

These are some great suggestions! I like the idea of including atom numbers in the stored information. Maybe a format of a.aaabbbcccddee, where a is band strength, b and c are residue numbers (lower # first), and d and e are atom numbers (in same order as the residue numbers). That still limits us to 999 residues, though.

Information about bands to space (length, angles, residues used for coordinate planes) becomes obsolete as soon as the protein is wiggled, so I think just storing the fact that it is a band to space will be sufficient for those.

Susume's picture
User offline. Last seen 1 day 12 hours ago. Offline
Joined: 10/02/2011
example of use for contact puzzles

An example of how this could be used: Band All Contacts Adaptive could create smart bands that store segment numbers. One could then write a recipe that would detect when a contact is lost, find the band for those two segments, and strengthen that band (or enable it if it is disabled). This is something I do by hand on contact puzzles when going from low to high CI or from auto to medium wiggle - wiggle, see which contacts turn red, undo the wiggle, enable or strengthen the bands on those contacts, repeat many times until all contacts are stable at the new CI or wiggle power. It is tedious and repetitive, but mostly deterministic - perfect for automating with a script.

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