Package user_functions :: Module frame_order'
[hide private]
[frames] | no frames]

Source Code for Module user_functions.frame_order'

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2009-2012 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  """The frame_order user function definitions.""" 
 25   
 26  # Python module imports. 
 27  import wx 
 28   
 29  # relax module imports. 
 30  from specific_fns.setup import frame_order_obj 
 31  from graphics import WIZARD_IMAGE_PATH 
 32  from user_functions.data import Uf_info; uf_info = Uf_info() 
 33  from user_functions.objects import Desc_container 
 34   
 35   
 36  # The user function class. 
 37  uf_class = uf_info.add_class('frame_order') 
 38  uf_class.title = "Class containing the user functions of the Frame Order theories." 
 39  uf_class.menu_text = "&frame_order" 
 40  uf_class.gui_icon = "relax.frame_order" 
 41   
 42   
 43  # The frame_order.cone_pdb user function. 
 44  uf = uf_info.add_uf('frame_order.cone_pdb') 
 45  uf.title = "Create a PDB file representing the Frame Order cone models." 
 46  uf.title_short = "Cone model PDB creation." 
 47  uf.add_keyarg( 
 48      name = "size", 
 49      default = 30.0, 
 50      py_type = "num", 
 51      desc_short = "geometric object size", 
 52      desc = "The size of the geometric object in Angstroms." 
 53  ) 
 54  uf.add_keyarg( 
 55      name = "inc", 
 56      default = 40, 
 57      py_type = "int", 
 58      desc_short = "increment number", 
 59      desc = "The number of increments used to create the geometric object.", 
 60      wiz_element_type = "spin" 
 61  ) 
 62  uf.add_keyarg( 
 63      name = "file", 
 64      default = "cone.pdb", 
 65      py_type = "str", 
 66      arg_type = "file sel", 
 67      desc_short = "file name", 
 68      desc = "The name of the PDB file to create.", 
 69      wiz_filesel_wildcard = "PDB files (*.pdb)|*.pdb;*.PDB", 
 70      wiz_filesel_style = wx.FD_SAVE 
 71  ) 
 72  uf.add_keyarg( 
 73      name = "dir", 
 74      py_type = "str", 
 75      arg_type = "dir", 
 76      desc_short = "directory name", 
 77      desc = "The directory where the file is to be located.", 
 78      can_be_none = True 
 79  ) 
 80  uf.add_keyarg( 
 81      name = "force", 
 82      default = False, 
 83      py_type = "bool", 
 84      desc_short = "force flag", 
 85      desc = "A flag which, if set to True, will overwrite the any pre-existing file." 
 86  ) 
 87  # Description. 
 88  uf.desc.append(Desc_container()) 
 89  uf.desc[-1].add_paragraph("This function creates a PDB file containing an artificial geometric structure representing the Frame Order cone models.") 
 90  uf.desc[-1].add_paragraph("There are four different types of residue within the PDB.  The pivot point is represented as as a single carbon atom of the residue 'PIV'.  The cone consists of numerous H atoms of the residue 'CON'.  The cone axis vector is presented as the residue 'AXE' with one carbon atom positioned at the pivot and the other x Angstroms away on the cone axis (set by the geometric object size).  Finally, if Monte Carlo have been performed, there will be multiple 'MCC' residues representing the cone for each simulation, and multiple 'MCA' residues representing the multiple cone axes.") 
 91  uf.desc[-1].add_paragraph("To create the diffusion in a cone PDB representation, a uniform distribution of vectors on a sphere is generated using spherical coordinates with the polar angle defined by the cone axis.  By incrementing the polar angle using an arccos distribution, a radial array of vectors representing latitude are created while incrementing the azimuthal angle evenly creates the longitudinal vectors.  These are all placed into the PDB file as H atoms and are all connected using PDB CONECT records.  Each H atom is connected to its two neighbours on the both the longitude and latitude.  This creates a geometric PDB object with longitudinal and latitudinal lines representing the filled cone.") 
 92  uf.backend = frame_order_obj._cone_pdb 
 93  uf.menu_text = "&cone_pdb" 
 94  uf.gui_icon = "oxygen.actions.document-save" 
 95  uf.wizard_height_desc = 400 
 96  uf.wizard_size = (1000, 750) 
 97  uf.wizard_image = WIZARD_IMAGE_PATH + 'frame_order.png' 
 98   
 99   
100  # The frame_order.domain_to_pdb user function. 
101  uf = uf_info.add_uf('frame_order.domain_to_pdb') 
102  uf.title = "Match the domains to PDB files." 
103  uf.title_short = "Domains to PDB matching." 
104  uf.add_keyarg( 
105      name = "domain", 
106      py_type = "str", 
107      desc_short = "domain", 
108      desc = "The domain to associate the PDB file to." 
109  ) 
110  uf.add_keyarg( 
111      name = "pdb", 
112      py_type = "str", 
113      desc_short = "PDB file", 
114      desc = "The PDB file to associate the domain to." 
115  ) 
116  # Description. 
117  uf.desc.append(Desc_container()) 
118  uf.desc[-1].add_paragraph("To display the frame order cone models within Pymol, the two domains need to be associated with PDB files.  Then the reference domain will be fixed in the PDB frame, and the moving domain will be rotated to its average position.") 
119  # Prompt examples. 
120  uf.desc.append(Desc_container("Prompt examples")) 
121  uf.desc[-1].add_paragraph("To set the 'N' domain to the PDB file 'bax_N_1J7O_1st.pdb', type one of:") 
122  uf.desc[-1].add_prompt("relax> frame_order.domain_to_pdb('N', 'bax_N_1J7O_1st.pdb')") 
123  uf.desc[-1].add_prompt("relax> frame_order.domain_to_pdb(domain='N', pdb='bax_N_1J7O_1st.pdb')") 
124  uf.backend = frame_order_obj._domain_to_pdb 
125  uf.menu_text = "&domain_to_pdb" 
126  uf.wizard_image = WIZARD_IMAGE_PATH + 'frame_order.png' 
127   
128   
129  # The frame_order.pivot user function. 
130  uf = uf_info.add_uf('frame_order.pivot') 
131  uf.title = "Set the pivot point for the two body motion in the structural coordinate system." 
132  uf.title_short = "Pivot point setting." 
133  uf.add_keyarg( 
134      name = "pivot", 
135      py_type = "num_list", 
136      dim = 3, 
137      desc_short = "pivot point", 
138      desc = "The pivot point for the motion (e.g. the position between the 2 domains in PDB coordinates)." 
139  ) 
140  # Description. 
141  uf.desc.append(Desc_container()) 
142  uf.desc[-1].add_paragraph("This will set the pivot point for the two domain system within the PDB coordinate system.  This is required for interpreting PCS data as well as for the generation of cone or other PDB representations of the domain motions.") 
143  # Prompt examples. 
144  uf.desc.append(Desc_container("Prompt examples")) 
145  uf.desc[-1].add_paragraph("To set the pivot point, type one of:") 
146  uf.desc[-1].add_prompt("relax> frame_order.pivot([12.067, 14.313, -3.2675])") 
147  uf.desc[-1].add_prompt("relax> frame_order.pivot(pivot=[12.067, 14.313, -3.2675])") 
148  uf.backend = frame_order_obj._pivot 
149  uf.menu_text = "&pivot" 
150  uf.wizard_image = WIZARD_IMAGE_PATH + 'frame_order.png' 
151   
152   
153  # The frame_order.ref_domain user function. 
154  uf = uf_info.add_uf('frame_order.ref_domain') 
155  uf.title = "Set the reference domain for the '2-domain' Frame Order theories." 
156  uf.title_short = "Reference domain setting." 
157  uf.add_keyarg( 
158      name = "ref", 
159      py_type = "str", 
160      desc_short = "reference frame", 
161      desc = "The domain which will act as the frame of reference.  This is only valid for the '2-domain' Frame Order theories." 
162  ) 
163  # Description. 
164  uf.desc.append(Desc_container()) 
165  uf.desc[-1].add_paragraph("Prior to optimisation of the '2-domain' Frame Order theories, which of the two domains will act as the frame of reference must be specified.  This is important for the attachment of cones to domains, etc.") 
166  # Prompt examples. 
167  uf.desc.append(Desc_container("Prompt examples")) 
168  uf.desc[-1].add_paragraph("To set up the isotropic cone frame order model with 'centre' domain being the frame of reference, type:") 
169  uf.desc[-1].add_prompt("relax> frame_order.ref_domain(ref='centre')") 
170  uf.backend = frame_order_obj._ref_domain 
171  uf.menu_text = "&ref_domain" 
172  uf.gui_icon = "oxygen.actions.edit-rename" 
173  uf.wizard_image = WIZARD_IMAGE_PATH + 'frame_order.png' 
174   
175   
176  # The frame_order.select_model user function. 
177  uf = uf_info.add_uf('frame_order.select_model') 
178  uf.title = "Select and set up the Frame Order model." 
179  uf.title_short = "Model choice." 
180  uf.add_keyarg( 
181      name = "model", 
182      py_type = "str", 
183      desc_short = "Frame Order model", 
184      desc = "The name of the preset Frame Order model.", 
185      wiz_element_type = "combo", 
186      wiz_combo_choices = [ 
187          "Free rotor model", 
188          "Rigid model", 
189          "Rotor model", 
190          "Free rotor line model", 
191          "Torsionless line model", 
192          "Line model", 
193          "Free rotor isotropic cone", 
194          "Torsionless isotropic cone", 
195          "Isotropic cone", 
196          "Free rotor pseudo-ellipse", 
197          "Torsionless pseudo-ellipse", 
198          "Pseudo-ellipse" 
199      ], 
200      wiz_combo_data = [ 
201          "free rotor", 
202          "rigid", 
203          "rotor", 
204          "line, free rotor", 
205          "line, torsionless", 
206          "line", 
207          "iso cone, free rotor", 
208          "iso cone, torsionless", 
209          "iso cone", 
210          "pseudo-ellipse, free rotor", 
211          "pseudo-ellipse, torsionless", 
212          "pseudo-ellipse" 
213      ], 
214      wiz_read_only = True, 
215  ) 
216  # Description. 
217  uf.desc.append(Desc_container()) 
218  uf.desc[-1].add_paragraph("Prior to optimisation, the Frame Order model should be selected.  These models consist of three parameter categories:") 
219  uf.desc[-1].add_list_element("The average domain position.  This includes the parameters ave_pos_alpha, ave_pos_beta, and ave_pos_gamma.  These Euler angles rotate the tensors from the arbitrary PDB frame of the moving domain to the average domain position.") 
220  uf.desc[-1].add_list_element("The frame order eigenframe.  This includes the parameters eigen_alpha, eigen_beta, and eigen_gamma.  These Euler angles define the major modes of motion.  The cone central axis is defined as the z-axis.  The pseudo-elliptic cone x and y-axes are defined as the x and y-axes of the eigenframe.") 
221  uf.desc[-1].add_list_element("The cone parameters.  These are defined as the tilt-torsion angles cone_theta_x, cone_theta_y, and cone_sigma_max.  The cone_theta_x and cone_theta_y parameters define the two cone opening angles of the pseudo-ellipse.  The amount of domain torsion is defined as the average domain position, plus and minus cone_sigma_max.  The isotropic cones are defined by setting cone_theta_x = cone_theta_y and converting the single parameter into a 2nd rank order parameter.") 
222  uf.desc[-1].add_paragraph("The list of available models are:") 
223  uf.desc[-1].add_item_list_element("'pseudo-ellipse'", "The pseudo-elliptic cone model.  This is the full model consisting of the parameters ave_pos_alpha, ave_pos_beta, ave_pos_gamma, eigen_alpha, eigen_beta, eigen_gamma, cone_theta_x, cone_theta_y, and cone_sigma_max.") 
224  uf.desc[-1].add_item_list_element("'pseudo-ellipse, torsionless'", "The pseudo-elliptic cone with the torsion angle cone_sigma_max set to zero.") 
225  uf.desc[-1].add_item_list_element("'pseudo-ellipse, free rotor'", "The pseudo-elliptic cone with no torsion angle restriction.") 
226  uf.desc[-1].add_item_list_element("'iso cone'", "The isotropic cone model.  The cone is defined by a single order parameter s1 which is related to the single cone opening angle cone_theta_x = cone_theta_y.  Due to rotational symmetry about the cone axis, the average position alpha Euler angle ave_pos_alpha is dropped from the model.  The symmetry also collapses the eigenframe to a single z-axis defined by the parameters axis_theta and axis_phi.") 
227  uf.desc[-1].add_item_list_element("'iso cone, torsionless'", "The isotropic cone model with the torsion angle cone_sigma_max set to zero.") 
228  uf.desc[-1].add_item_list_element("'iso cone, free rotor'", "The isotropic cone model with no torsion angle restriction.") 
229  uf.desc[-1].add_item_list_element("'line'", "The line cone model.  This is the pseudo-elliptic cone with one of the cone angles, cone_theta_y, assumed to be statistically negligible.  I.e. the cone angle is so small that it cannot be distinguished from noise.") 
230  uf.desc[-1].add_item_list_element("'line, torsionless'", "The line cone model with the torsion angle cone_sigma_max set to zero.") 
231  uf.desc[-1].add_item_list_element("'line, free rotor'", "The line cone model with no torsion angle restriction.") 
232  uf.desc[-1].add_item_list_element("'rotor'", "The only motion is a rotation about the cone axis restricted by the torsion angle cone_sigma_max.") 
233  uf.desc[-1].add_item_list_element("'rigid'", "No domain motions.") 
234  uf.desc[-1].add_item_list_element("'free rotor'", "The only motion is free rotation about the cone axis.") 
235  # Prompt examples. 
236  uf.desc.append(Desc_container("Prompt examples")) 
237  uf.desc[-1].add_paragraph("To select the isotropic cone model, type:") 
238  uf.desc[-1].add_prompt("relax> frame_order.select_model(model='iso cone')") 
239  uf.backend = frame_order_obj._select_model 
240  uf.menu_text = "&select_model" 
241  uf.gui_icon = "oxygen.actions.list-add" 
242  uf.wizard_height_desc = 560 
243  uf.wizard_size = (1000, 750) 
244  uf.wizard_apply_button = False 
245  uf.wizard_image = WIZARD_IMAGE_PATH + 'frame_order.png' 
246