temp notes for lecture 14?
Scanned notes: insert here
Everything is an object in python (even numbers) What's the difference between a class and a different compound data structure
everything in a class shares common properties and these properties define the class when you create an object of a certain class, that's called an instance each instance has its own internal data, but shares common methods for accessing that data
Most advanced class you're going to deal with: the vector class every class needs a certain function, called init beginning and trailing underscores means that you, the user, is never going to call this function explicitly.
Some functions in the Vector module, to define the class
def __init__(self, x=None, y=None, z=None): #see note 1,2 below
- if (x==None): # probably
- self.array = [0,0,0]
- self.array = [
- return self.array
Now the user can use this module:
x = Vector(1,1,2) # x is an instance of the class Vector
y = Vector(2,2,1)
x.x() #returns the value 1 (the x-coordinate of the vector named x)
y.x() #returns the value 2
- Name a parameter and give it a default value (in case the user doesn't pass anything in)
- We're only passing in 3 params, but it looks like the function wants 4.
self is the hidden parameter that ties it to the
Where we're going
- Start with a protein backbone
- Pick initial AA's (romaters)
- Build structure
- Calculate energy of that structure "E"
- Try a new set of AA's (rotamers)
- Calculate their energy
- Repeat 5-6 until ? (some stopping point to be defined)
- Report best AA's (rotamers)
non-trivial steps from above
3. we spent several classes trying to figure this out 4. we'll talk about it next time 5. how do we pick a good set of AA's ?