Package prompt :: Module frame_order
[hide private]
[frames] | no frames]

Source Code for Module prompt.frame_order

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2009-2010 Edward d'Auvergne                                   # 
  4  #                                                                             # 
  5  # This file is part of the program relax.                                     # 
  6  #                                                                             # 
  7  # relax is free software; you can redistribute it and/or modify               # 
  8  # it under the terms of the GNU General Public License as published by        # 
  9  # the Free Software Foundation; either version 2 of the License, or           # 
 10  # (at your option) any later version.                                         # 
 11  #                                                                             # 
 12  # relax is distributed in the hope that it will be useful,                    # 
 13  # but WITHOUT ANY WARRANTY; without even the implied warranty of              # 
 14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               # 
 15  # GNU General Public License for more details.                                # 
 16  #                                                                             # 
 17  # You should have received a copy of the GNU General Public License           # 
 18  # along with relax; if not, write to the Free Software                        # 
 19  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # 
 20  #                                                                             # 
 21  ############################################################################### 
 22   
 23  # Module docstring. 
 24  """Module containing the user function class of the Frame Order theories.""" 
 25  __docformat__ = 'plaintext' 
 26   
 27  # relax module imports. 
 28  from base_class import User_fn_class 
 29  import arg_check 
 30  from specific_fns.setup import frame_order_obj 
 31   
 32   
33 -class Frame_order(User_fn_class):
34 """Class containing the user functions of the Frame Order theories.""" 35
36 - def cone_pdb(self, size=30.0, inc=40, file='cone.pdb', dir=None, force=False):
37 """Create a PDB file representing the Frame Order cone models. 38 39 Keyword Arguments 40 ~~~~~~~~~~~~~~~~~ 41 42 size: The size of the geometric object in Angstroms. 43 44 inc: The number of increments used to create the geometric object. 45 46 file: The name of the PDB file to create. 47 48 dir: The directory where the file is to be located. 49 50 force: A flag which, if set to True, will overwrite the any pre-existing file. 51 52 53 Description 54 ~~~~~~~~~~~ 55 56 This function creates a PDB file containing an artificial geometric structure representing 57 the Frame Order cone models. 58 59 There are four different types of residue within the PDB. The pivot point is represented as 60 as a single carbon atom of the residue 'PIV'. The cone consists of numerous H atoms of the 61 residue 'CON'. The cone axis vector is presented as the residue 'AXE' with one carbon atom 62 positioned at the pivot and the other x Angstroms away on the cone axis (set by the size 63 argument). Finally, if Monte Carlo have been performed, there will be multiple 'MCC' 64 residues representing the cone for each simulation, and multiple 'MCA' residues representing 65 the multiple cone axes. 66 67 To create the diffusion in a cone PDB representation, a uniform distribution of vectors on a 68 sphere is generated using spherical coordinates with the polar angle defined by the cone 69 axis. By incrementing the polar angle using an arccos distribution, a radial array of 70 vectors representing latitude are created while incrementing the azimuthal angle evenly 71 creates the longitudinal vectors. These are all placed into the PDB file as H atoms and are 72 all connected using PDB CONECT records. Each H atom is connected to its two neighbours on 73 the both the longitude and latitude. This creates a geometric PDB object with longitudinal 74 and latitudinal lines representing the filled cone. 75 """ 76 77 # Function intro text. 78 if self._exec_info.intro: 79 text = self._exec_info.ps3 + "frame_order.cone_pdb(" 80 text = text + "size=" + repr(size) 81 text = text + ", inc=" + repr(inc) 82 text = text + ", file=" + repr(file) 83 text = text + ", dir=" + repr(dir) 84 text = text + ", force=" + repr(force) + ")" 85 print(text) 86 87 # The argument checks. 88 arg_check.is_num(size, 'geometric object size') 89 arg_check.is_int(inc, 'increment number') 90 arg_check.is_str(file, 'file name') 91 arg_check.is_str(dir, 'directory name', can_be_none=True) 92 arg_check.is_bool(force, 'force flag') 93 94 # Execute the functional code. 95 frame_order_obj._cone_pdb(size=size, inc=inc, file=file, dir=dir, force=force)
96 97
98 - def domain_to_pdb(self, domain=None, pdb=None):
99 """Match the domains to PDB files. 100 101 Keyword Arguments 102 ~~~~~~~~~~~~~~~~~ 103 104 domain: The domain to associate the PDB file to. 105 106 pdb: The PDB file to associate the domain to. 107 108 109 Description 110 ~~~~~~~~~~~ 111 112 To display the frame order cone models within Pymol, the two domains need to be associated 113 with PDB files. Then the reference domain will be fixed in the PDB frame, and the moving 114 domain will be rotated to its average position. 115 116 117 Examples 118 ~~~~~~~~ 119 120 To set the 'N' domain to the PDB file 'bax_N_1J7O_1st.pdb', type one of: 121 122 relax> frame_order.domain_to_pdb('N', 'bax_N_1J7O_1st.pdb') 123 relax> frame_order.domain_to_pdb(domain='N', pdb='bax_N_1J7O_1st.pdb') 124 """ 125 126 # Function intro text. 127 if self._exec_info.intro: 128 text = self._exec_info.ps3 + "frame_order.domain_to_pdb(" 129 text = text + "domain=" + repr(domain) 130 text = text + ", pdb=" + repr(pdb) + ")" 131 print(text) 132 133 # The argument checks. 134 arg_check.is_str(domain, 'domain') 135 arg_check.is_str(pdb, 'PDB file') 136 137 # Execute the functional code. 138 frame_order_obj._domain_to_pdb(domain=domain, pdb=pdb)
139 140
141 - def pivot(self, pivot=None):
142 """Set the pivot point for the two body motion in the structural coordinate system. 143 144 Keyword Arguments 145 ~~~~~~~~~~~~~~~~~ 146 147 pivot: The pivot point for the motion (e.g. the position between the 2 domains in PDB 148 coordinates). 149 150 151 Examples 152 ~~~~~~~~ 153 154 To set the pivot point, type one of: 155 156 relax> frame_order.pivot([12.067, 14.313, -3.2675]) 157 relax> frame_order.pivot(pivot=[12.067, 14.313, -3.2675]) 158 """ 159 160 # Function intro text. 161 if self._exec_info.intro: 162 text = self._exec_info.ps3 + "frame_order.pivot(" 163 text = text + "pivot=" + repr(pivot) + ")" 164 print(text) 165 166 # The argument checks. 167 arg_check.is_num_list(pivot, 'pivot point', size=3) 168 169 # Execute the functional code. 170 frame_order_obj._pivot(pivot=pivot)
171 172
173 - def ref_domain(self, ref=None):
174 """Set the reference domain for the '2-domain' Frame Order theories. 175 176 Keyword Arguments 177 ~~~~~~~~~~~~~~~~~ 178 179 ref: The domain which will act as the frame of reference. This is only valid for the 180 '2-domain' Frame Order theories. 181 182 183 Description 184 ~~~~~~~~~~~ 185 186 Prior to optimisation of the '2-domain' Frame Order theories, which of the two domains will 187 act as the frame of reference must be specified. This is important for the attachment of 188 cones to domains, etc. 189 190 191 Examples 192 ~~~~~~~~ 193 194 To set up the isotropic cone frame order model with 'centre' domain being the frame of reference, type: 195 196 relax> frame_order.ref_domain(ref='centre') 197 """ 198 199 # Function intro text. 200 if self._exec_info.intro: 201 text = self._exec_info.ps3 + "frame_order.ref_domain(" 202 text = text + "ref=" + repr(ref) + ")" 203 print(text) 204 205 # The argument checks. 206 arg_check.is_str(ref, 'reference frame') 207 208 # Execute the functional code. 209 frame_order_obj._ref_domain(ref=ref)
210 211
212 - def select_model(self, model=None):
213 """Select and set up the Frame Order model. 214 215 Keyword Arguments 216 ~~~~~~~~~~~~~~~~~ 217 218 model: The name of the preset Frame Order model. 219 220 221 Description 222 ~~~~~~~~~~~ 223 224 Prior to optimisation, the Frame Order model should be selected. These models consist of 225 three parameter categories: 226 227 - The average domain position. This includes the parameters ave_pos_alpha, 228 ave_pos_beta, and ave_pos_gamma. These Euler angles rotate the tensors from the 229 arbitrary PDB frame of the moving domain to the average domain position. 230 231 - The frame order eigenframe. This includes the parameters eigen_alpha, eigen_beta, and 232 eigen_gamma. These Euler angles define the major modes of motion. The cone central 233 axis is defined as the z-axis. The pseudo-elliptic cone x and y-axes are defined as the 234 x and y-axes of the eigenframe. 235 236 - The cone parameters. These are defined as the tilt-torsion angles cone_theta_x, 237 cone_theta_y, and cone_sigma_max. The cone_theta_x and cone_theta_y parameters define 238 the two cone opening angles of the pseudo-ellipse. The amount of domain torsion is 239 defined as the average domain position, plus and minus cone_sigma_max. The isotropic 240 cones are defined by setting cone_theta_x = cone_theta_y and converting the single 241 parameter into a 2nd rank order parameter. 242 243 The list of available models are: 244 245 'pseudo-ellipse' - The pseudo-elliptic cone model. This is the full model consisting of 246 the parameters ave_pos_alpha, ave_pos_beta, ave_pos_gamma, eigen_alpha, eigen_beta, 247 eigen_gamma, cone_theta_x, cone_theta_y, and cone_sigma_max. 248 249 'pseudo-ellipse, torsionless' - The pseudo-elliptic cone with the torsion angle 250 cone_sigma_max set to zero. 251 252 'pseudo-ellipse, free rotor' - The pseudo-elliptic cone with no torsion angle 253 restriction. 254 255 'iso cone' - The isotropic cone model. The cone is defined by a single order parameter 256 s1 which is related to the single cone opening angle cone_theta_x = cone_theta_y. Due 257 to rotational symmetry about the cone axis, the average position alpha Euler angle 258 ave_pos_alpha is dropped from the model. The symmetry also collapses the eigenframe to 259 a single z-axis defined by the parameters axis_theta and axis_phi. 260 261 'iso cone, torsionless' - The isotropic cone model with the torsion angle cone_sigma_max 262 set to zero. 263 264 'iso cone, free rotor' - The isotropic cone model with no torsion angle restriction. 265 266 'line' - The line cone model. This is the pseudo-elliptic cone with one of the cone 267 angles, cone_theta_y, assumed to be statistically negligible. I.e. the cone angle is 268 so small that it cannot be distinguished from noise. 269 270 'line, torsionless' - The line cone model with the torsion angle cone_sigma_max set to 271 zero. 272 273 'line, free rotor' - The line cone model with no torsion angle restriction. 274 275 'rotor' - The only motion is a rotation about the cone axis restricted by the torsion 276 angle cone_sigma_max. 277 278 'rigid' - No domain motions. 279 280 'free rotor' - The only motion is free rotation about the cone axis. 281 282 283 Examples 284 ~~~~~~~~ 285 286 To select the isotropic cone model, type: 287 288 relax> frame_order.select_model(model='iso cone') 289 """ 290 291 # Function intro text. 292 if self._exec_info.intro: 293 text = self._exec_info.ps3 + "frame_order.select_model(" 294 text = text + "model=" + repr(model) + ")" 295 print(text) 296 297 # The argument checks. 298 arg_check.is_str(model, 'Frame Order model') 299 300 # Execute the functional code. 301 frame_order_obj._select_model(model=model)
302