Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Structure.py
Go to the documentation of this file.
1 #!/usr/bin/python
2 
3 # (c) Copyright Rosetta Commons Member Institutions.
4 # (c) This file is part of the Rosetta software suite and is made available under license.
5 # (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
6 # (c) For more information, see http://www.rosettacommons.org. Questions about this can be
7 # (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
8 
9 ## @file /GUIs/pyrosetta_toolkit/modules/Structure.py
10 ## @brief Class for structural representations of specific protein types. Antibody and CDR work, feel free to add. CDR Stuff Will be in C++ Rosetta soon.
11 ## @author Jared Adolf-Bryfogle (jadolfbr@gmail.com)
12 
13 #Python Imports
14 import os
15 import sys
16 
18  """
19  Simple class for accessing Modified_AHO antibody numbering information outside of Rosetta. Use protocols/antibody/AntibodyInfo if importing Rosetta.
20  """
21  def __init__(self):
22  #3 Different ways to access the CDR Loops. Should be one. Not convoluted.
23  self.L1 = CDR("L1"); self.L2 = CDR("L2"); self.L3=CDR("L3");
24  self.H1 = CDR("H1"); self.H2 = CDR("H2"); self.H3=CDR("H3");
25  self.CDRS = [self.L1, self.L2, self.L3, self.H1, self.H2, self.H3]; #Switch to a dictionary with CDR name and cdr as item????
26 
27 
28  self.CDR = {"L1":self.L1, "L2":self.L2, "L3":self.L3, "H1":self.H1, "H2":self.H2, "H3":self.H3}
29 
30  def get_CDRs(self):
31  return self.CDRS
32 
33  def get_CDR(self, cdr_name):
34  return self.CDR[cdr_name]
35 
36  def get_PDB_name(self, Path):
37  root, pdb = os.path.split(Path)
38  pdb = pdb.split('.')[0]
39  self.pdb = pdb
40  return self.pdb
41 
42 
43 class FRAMEWORK:
44  def __init__(self):
45  pass
46 
47 
48 class CDR:
49  def __init__(self, name):
50  self.regions = {
51  "L1":['L', 24, 42],
52  "L2":['L', 57, 72],
53  "L3":['L', 107, 138],
54  "H1":['H', 24, 42],
55  "H2":['H', 57, 69],
56  "H3":['H', 107, 138]}
57 
58  self.name = name
59  self.region = self.regions[self.name]
60  self.chain = self.region[0]
61  self.Nter = self.region[1]
62  self.Cter = self.region[2]
63  self.residues = dict()
64 
65  def __str__(self):
66  return str(self.regions[self.name])
67 
68  def get_pdb_chain(self):
69  return self.regions[self.name][0]
70 
71  def get_pdb_start(self):
72  return self.regions[self.name][1]
73 
74  def get_pdb_end(self):
75  return self.regions[self.name][2]
76 
77  def set_gene(self, gene):
78  self.gene = gene
79 
80  def add_residue(self, name, num):
81  self.residues[num]=Residue(name, num)
82 
83 class Residue:
84  def __init__(self, name, num):
85  self.name = name
86  self.num = num
87  self.createAtoms()
88  self.createBonds()
89  def createAtoms(self):
90  pass
91  def createBonds(self):
92  pass
93 
94  #Should have Atoms, weight, it's own energy, the rotamer prob, etc.
95  def caclulateDihedral(self, atom1, atom2, atom3):
96  pass
97 ############################################################FUTURE1#############################################################
98 class PDB:
99  """
100  The PDB should have seperate molecules for each chain.
101  """
102  def __init__(self, filename):
103  self.loadPDB()
104  def loadPDB(self):
105  #Sets a few different properties.
106  #Can look up residue data, atom data, etc. =
107  pass
108 
109 
110 
111 #############################################################FUTURE2#############################################################
112 class molecule:
113  def __init__(self, name, atomsormolecule):
114  pass
115  #Were going to take all atoms one by one and create a molecule.
116  #We can take two or more molecules and put them together to create a larger molecule.
117  #Examples of a molecule:
118  #H and L chain are each molecules.
119  #Any ligands are molecules.
120  #Molecules can covelently bond to other molecules.
121  #Bonding can be a rule based on chemistry in the far flung future.
122 
123 
124 class protein:
125  def __init__(self):
126  pass
127 class protein_info:
128  """
129  The protein has protein molecules. The PDB has a protein. Need to write this carefully.
130  """
131 
132  def __init__(self, sequence):
133  #Were going to take the sequence. Find the sequence's family.
134  pass
135 
136  def giveStructure(self, pose):
137  #Here, we give the sequence a structure. We compare it to known structure and find it's family. We parse it's components into domains using Pfam.
138  #We get even more information on those domains.
139  pass
140 
141  def getInfo(self):
142  #Here, we parse Uniprot. We get all the information we possibly can.
143  #We want to KNOW the species. It's job. It's fold. It's required ligand. Everything we can find on it.
144  #Parsable. Knowable.
145  pass
146 
147  def getPartners(self):
148  #Here, we parse ProtCid. We return all known partners. We try to determine whether the protein is a monomer or dimer, or something else.
149  pass
150 
151  def breakIntoDomains(self):
152  #Here, we break the structure into all domains. This is useful if we want to do things to the domains. OR start engineering them.
153  pass
154  def attachDomains(self, domain1, domain2):
155  #Here we attach the two domains. We will require more information about the design, but this will be added on later.
156  pass
157 
158 
159 
160 #If I ever need it:
161 
162 class Atom:
163  def __init__(self, name):
164  pass
165  def __add__(self, atom):
166  """
167  If we add two atoms together. We create - A molecule, and a bond.
168  This would be cool if we could get it to work.
169  """
170  return Bond(self, atom)
171  #self.vdw
172  #self.electrons
173  #self.energy
174  #self.
175  pass
176  def __iadd__(self):
177  return Bond(self, Atom(self.name))
178 
179 
180 class Bond:
181  def __init__(self, atom1, atom2):
182  pass
183 
184 
185 
186 
187 #Just for Fucks sake:
188 class nucleus:
189  pass
190 class electron:
191  pass
192 
193 
list protein
Definition: PDBInfo.py:42