Skip to content

Instantly share code, notes, and snippets.

@vincentchu
Created August 14, 2012 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vincentchu/3351734 to your computer and use it in GitHub Desktop.
Save vincentchu/3351734 to your computer and use it in GitHub Desktop.
import random
positions = [0, 1, 2, 3]
# Represents sequence ACTG
bases = {
0: "A",
1: "C",
2: "T",
3: "G"
}
# Represents energies at position n. Initialize it as empty dict
energies = {}
for pos in positions:
energies[pos] = random.random() # assign an energy to position pos; currently just random
print "position %4d - %s energy: %4.2f kcal/mol" % (pos, bases[pos], energies[pos])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment