Package user_functions :: Module paramag
[hide private]
[frames] | no frames]

Source Code for Module user_functions.paramag

  1  ############################################################################### 
  2  #                                                                             # 
  3  # Copyright (C) 2003-2013 Edward d'Auvergne                                   # 
  4  #                                                                             # 
  5  # This file is part of the program relax (http://www.nmr-relax.com).          # 
  6  #                                                                             # 
  7  # This program 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 3 of the License, or           # 
 10  # (at your option) any later version.                                         # 
 11  #                                                                             # 
 12  # This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.       # 
 19  #                                                                             # 
 20  ############################################################################### 
 21   
 22  # Module docstring. 
 23  """The paramag user function definitions for paramagnetic related functions.""" 
 24   
 25  # relax module imports. 
 26  from graphics import WIZARD_IMAGE_PATH 
 27  from pipe_control import paramag, pipes 
 28  from user_functions.data import Uf_info; uf_info = Uf_info() 
 29  from user_functions.objects import Desc_container 
 30   
 31   
 32  # The user function class. 
 33  uf_class = uf_info.add_class('paramag') 
 34  uf_class.title = "Class for handling paramagnetic information." 
 35  uf_class.menu_text = "&paramag" 
 36  uf_class.gui_icon = "relax.align_tensor" 
 37   
 38   
 39  # The paramag.centre user function. 
 40  uf = uf_info.add_uf('paramag.centre') 
 41  uf.title = "Specify which atom is the paramagnetic centre." 
 42  uf.title_short = "Paramagnetic centre selection." 
 43  uf.add_keyarg( 
 44      name = "pos", 
 45      py_type = "num_list", 
 46      dim = 3, 
 47      desc_short = "atomic position", 
 48      desc = "The atomic position of the paramagnetic centre.", 
 49      list_titles = ['X coordinate', 'Y coordinate', 'Z coordinate'], 
 50      can_be_none = True 
 51  ) 
 52  uf.add_keyarg( 
 53      name = "atom_id", 
 54      py_type = "str", 
 55      desc_short = "atom ID string", 
 56      desc = "The atom ID string.", 
 57      can_be_none = True 
 58  ) 
 59  uf.add_keyarg( 
 60      name = "pipe", 
 61      py_type = "str", 
 62      desc_short = "data pipe", 
 63      desc = "The data pipe containing the structures to extract the centre from.", 
 64      wiz_element_type = 'combo', 
 65      wiz_combo_iter = pipes.pipe_names, 
 66      can_be_none = True 
 67  ) 
 68  uf.add_keyarg( 
 69      name = "verbosity", 
 70      default = 1, 
 71      py_type = "int", 
 72      desc_short = "verbosity level", 
 73      desc = "The amount of information to print out." 
 74  ) 
 75  uf.add_keyarg( 
 76      name = "fix", 
 77      default = True, 
 78      py_type = "bool", 
 79      desc_short = "fix flag", 
 80      desc = "A flag specifying if the paramagnetic centre should be fixed during optimisation." 
 81  ) 
 82  uf.add_keyarg( 
 83      name = "ave_pos", 
 84      default = True, 
 85      py_type = "bool", 
 86      desc_short = "average position flag", 
 87      desc = "A flag specifying if the position of the atom is to be averaged across all models." 
 88  ) 
 89  uf.add_keyarg( 
 90      name = "force", 
 91      default = False, 
 92      py_type = "bool", 
 93      desc_short = "force flag", 
 94      desc = "A flag which if True will cause the current paramagnetic centre to be overwritten." 
 95  ) 
 96  # Description. 
 97  uf.desc.append(Desc_container()) 
 98  uf.desc[-1].add_paragraph("This is required for specifying where the paramagnetic centre is located in the loaded structure file.  If no structure number is given, then the average atom position will be calculated if multiple structures are loaded.") 
 99  uf.desc[-1].add_paragraph("A different set of structures than those loaded into the current data pipe can also be used to determine the position, or its average.  This can be achieved by loading the alternative structures into another data pipe, and then specifying that pipe.") 
100  uf.desc[-1].add_paragraph("If the average position flag is set to True, the average position from all models will be used as the position of the paramagnetic centre.  If False, then the positions from all structures will be used.  If multiple positions are used, then a fast paramagnetic centre motion will be assumed so that PCSs for a single tensor will be calculated for each position, and the PCS values linearly averaged.") 
101  # Prompt examples. 
102  uf.desc.append(Desc_container("Prompt examples")) 
103  uf.desc[-1].add_paragraph("If the paramagnetic centre is the lanthanide Dysprosium which is labelled as Dy in a loaded PDB file, then type one of:") 
104  uf.desc[-1].add_prompt("relax> paramag.centre('Dy')") 
105  uf.desc[-1].add_prompt("relax> paramag.centre(atom_id='Dy')") 
106  uf.desc[-1].add_paragraph("If the carbon atom 'C1' of residue '4' in the PDB file is to be used as the paramagnetic centre, then type:") 
107  uf.desc[-1].add_prompt("relax> paramag.centre(':4@C1')") 
108  uf.desc[-1].add_paragraph("To state that the Dy3+ atomic position is [0.136, 12.543, 4.356], type one of:") 
109  uf.desc[-1].add_prompt("relax> paramag.centre([0.136, 12.543, 4.356])") 
110  uf.desc[-1].add_prompt("relax> paramag.centre(pos=[0.136, 12.543, 4.356])") 
111  uf.desc[-1].add_paragraph("To find an unknown paramagnetic centre, type:") 
112  uf.desc[-1].add_prompt("relax> paramag.centre(fix=False)") 
113  uf.backend = paramag.centre 
114  uf.menu_text = "&centre" 
115  uf.wizard_height_desc = 400 
116  uf.wizard_size = (1000, 750) 
117  uf.wizard_apply_button = False 
118  uf.wizard_image = WIZARD_IMAGE_PATH + 'align_tensor.png' 
119