Back to Recipes Homepage
recipe picture
Recipe: random banding SCRIPT
Created by themarquis 46 1458
Your rating: None Average: 4.2 (18 votes)
Used 1272 times with an average impact of 24555 points.


Name: random banding SCRIPT
ID: 1891
Created on: Wed, 10/21/2009 - 07:47
Updated on: Wed, 10/21/2009 - 14:47

at present, we can't access the standard libraries , so it's difficult to obtain any kind of good random number generator. For fun, I'm generating a "random" number using a mod function based on the score of a segment. I call this a pseudo(pseudo) random number.

Best For


Joined: 04/13/2009
Groups: Contenders
A bit of further info: in

A bit of further info: in mathematics and computer science, we say that it's never possible to generate a "truly" random number. So even the best random numbers that a computer can create are simply "pseudorandoms".

In this script, I'm using a simple technique (mod function based on segment score) to generate a number that is somewhat random (much less so than good "pseudorandoms" that programs usually create). I call this a pseudo(pseudo) random number.

Here, I've used the pseudo(pseudo) to pick a segment somewhere within the protein. We can then add a band between that pseudo(pseudo) random segment and the current segment (wherever we are in the loop). The main purpose for this script would be to run it and then wiggle, remove bands, and wiggle/shake out. But I'm sure you can find other uses for it.

You'll notice if you run it a couple of times that given the same initial conditions, it will always band the same segments. That's because our seed (segment score) isn't changing. However, if the score changes in the protein, you will get a different set of bands. You can also get different pseudo(pseudos) by going in and mess with the mod function (you will see score * 100000 or something like that -- go ahead and change that large number to something different and see what happens.)

There are many other ways we can come up with pseudorandom numbers, and I'm sure someone will find a way to do it that works better than my "quick and dirty" method! There are a lot of other possible mods for using pseudo(pseudos) for other protein manipulation tasks. Can we randomize band strength, wiggle/shake length, behavior, and other gameplay techniques? I'm sure some of you will experiment and create all sorts of fun scripts.

Joined: 09/18/2009
Groups: SETI.Germany

...nice idea!
I rembember some old-school games, where they simply did take the program code for generating reproductible "random" numbers, or they took the actual line or column position of the cathode ray on the monitor, which resulted random numbers, because of the asynchron accessing time.

Joined: 09/18/2009
Groups: SETI.Germany
my idea....

An offset position of Pi´s digits after the decimal separator.

Joined: 04/13/2009
Groups: Contenders
Cool -- pi would be be a much

Cool -- pi would be be a much better random number generator than my ad hoc method. We're really limited without the library functions for Lua, though! I don't know if that's something they will eventually add or if there's a workaround or what. I'm pretty sure we can't use any math library functions, can't load files, and are basically limited to simple operators, arithmetic and logical expressions, the foldit command set, and any data we can dig out of the protein itself.

Soooo ... given those limitations, I'm sure there's still a creative way of developing a better random number generator. I'm not really a math person, so I just tried to clumsily dig out some value after the decimal in a score, assuming that when you get a few places out from the decimal, the digits should start getting fairly well distributed. But maybe you have a better idea!

The best would be some sort of analog data ... like your example of the cathode ray position (interesting!). There are some library functions that mke it easy to pull pseudorandoms out of the current time or the time before a user clicks a button or something, but we can't use those :( I guess we need to think outside the box here!

Joined: 09/18/2009
Groups: SETI.Germany

Your current script could be used together with my latest version of wiggle by ones.
Now it uses the recent best option and makes "backups" before wiggling.

Want to try?
Add to Cookbook!
To download recipes to your cookbook, you need to have the game client running.

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, Boehringer Ingelheim, RosettaCommons