Author: bugman Date: Tue Mar 5 10:42:14 2013 New Revision: 18627 URL: http://svn.gna.org/viewcvs/relax?rev=18627&view=rev Log: Refactored frame_order.ave_pos_translate into the frame_order.average_position user function. This is now used to set up all characteristics of the movement to the average domain position including which pivot position to use for the rotation and if translation should be used. Modified: branches/frame_order_testing/specific_fns/frame_order.py branches/frame_order_testing/user_functions/frame_order.py Modified: branches/frame_order_testing/specific_fns/frame_order.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/specific_fns/frame_order.py?rev=18627&r1=18626&r2=18627&view=diff ============================================================================== --- branches/frame_order_testing/specific_fns/frame_order.py (original) +++ branches/frame_order_testing/specific_fns/frame_order.py Tue Mar 5 10:42:14 2013 @@ -240,18 +240,25 @@ return scaling_matrix - def _ave_pos_translation(self, flag=True): - """Allow or disallow the translation of the average domain position. - - @keyword flag: If True, translation will be allowed. If False, then translation will not occur. - @type flag: bool + def _average_position(self, pivot='com', translation=True): + """Set up the mechanics of the average domain position. + + @keyword pivot: What to use as the motional pivot. This can be 'com' for the centre of mass of the moving domain, or 'motional' to link the pivot of the motion to the rotation of the average domain position. + @type pivot: str + @keyword translation: If True, translation to the average domain position will be allowed. If False, then translation will not occur. + @type translation: bool """ # Test if the current data pipe exists. pipes.test() - # Store the flag. - cdp.ave_pos_translation = flag + # Check the pivot value. + if pivot not in ['com', 'motional']: + raise RelaxError("The pivot for the rotation to the average domain position must be either 'com' or 'motional'.") + + # Store the data. + cdp.ave_pos_pivot = pivot + cdp.ave_pos_translation = translation def _base_data_types(self): Modified: branches/frame_order_testing/user_functions/frame_order.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/user_functions/frame_order.py?rev=18627&r1=18626&r2=18627&view=diff ============================================================================== --- branches/frame_order_testing/user_functions/frame_order.py (original) +++ branches/frame_order_testing/user_functions/frame_order.py Tue Mar 5 10:42:14 2013 @@ -41,6 +41,56 @@ uf_class.title = "Class containing the user functions of the Frame Order theories." uf_class.menu_text = "&frame_order" uf_class.gui_icon = "relax.frame_order" + + +# The frame_order.average_position user function. +uf = uf_info.add_uf('frame_order.average_position') +uf.title = "Define the mechanics of the average domain position." +uf.title_short = "Average domain position mechanics." +uf.add_keyarg( + name = "pivot", + default = "com", + py_type = "str", + desc_short = "average position pivot", + desc = "The type of pivot to use for the rotation to the average domain position. This can be one of 'com' or 'motional'.", + wiz_element_type = "combo", + wiz_combo_choices = [ + "Centre of Mass (CoM)", + "Motional pivot" + ], + wiz_combo_data = [ + "com", + "motional" + ], + wiz_read_only = True +) +uf.add_keyarg( + name = "translation", + default = False, + py_type = "bool", + desc_short = "translation flag", + desc = "A flag specifying if the average domain position should be allowed to translate during optimisation. If False, then translation can be disabled." +) +# Description. +uf.desc.append(Desc_container()) +uf.desc[-1].add_paragraph("Prior to optimisation, the mechanics of the average moving domain position must be specified. Having the domain shifted to the correct average position is essential for understanding the dynamics as this information is the major contributor to the RDC and PCS. The motional eigenframe (spherical or Euler angles) and ordering (via order parameters, cone angles or torsion angles) come second, and are therefore severely distorted by an incorrect average domain position.") +uf.desc[-1].add_paragraph("There are two pieces of information affecting this average position - a rotation and translation. For the rotation, a pivot point is required. Note that this pivot is not related to the pivot of the motions. However if you believe that your starting structure lies within the uniform distribution of positions of the domain motions, then the two pivots can be linked by setting the average position pivot to the motional pivot. The default however is to set the pivot to the centre of mass (CoM) of the moving domain.") +uf.desc[-1].add_paragraph("The second option allows the average domain position to translate during optimisation. By default, only a rotation of the initial structure of the domain is rotated to the average position. But if the rotation is not sufficient to shift the domain to the average position, then a translation will be required. This option will be ignored if no PDC data is present, as RDCs do not contain information about the translation of the domain.") +# Prompt examples. +uf.desc.append(Desc_container("Prompt examples")) +uf.desc[-1].add_paragraph("To use the centre of mass as the rotational pivot and to allow translation of the average domain position during optimisation, type one of:") +uf.desc[-1].add_prompt("relax> frame_order.translate('com', True)") +uf.desc[-1].add_prompt("relax> frame_order.translate(translation=True)") +uf.desc[-1].add_prompt("relax> frame_order.translate(pivot='com', translation=True)") +uf.desc[-1].add_paragraph("To use the motional pivot as the average domain rotational pivot while disallowing translation of, type one of:") +uf.desc[-1].add_prompt("relax> frame_order.translate('motional')") +uf.desc[-1].add_prompt("relax> frame_order.translate('motional', False)") +uf.desc[-1].add_prompt("relax> frame_order.translate(pivot='motional', translation=False)") +uf.backend = frame_order_obj._average_position +uf.menu_text = "&average_position" +uf.wizard_height_desc = 450 +uf.wizard_size = (1000, 750) +uf.wizard_image = WIZARD_IMAGE_PATH + 'frame_order.png' # The frame_order.cone_pdb user function. @@ -297,27 +347,3 @@ uf.wizard_size = (1000, 750) uf.wizard_apply_button = False uf.wizard_image = WIZARD_IMAGE_PATH + 'frame_order.png' - - -# The frame_order.ave_pos_translate user function. -uf = uf_info.add_uf('frame_order.ave_pos_translate') -uf.title = "Allow the average domain position to translate." -uf.title_short = "Average position translation." -uf.add_keyarg( - name = "flag", - default = True, - py_type = "bool", - desc_short = "translation flag", - desc = "A flag specifying if the average domain position should be allowed to translate during optimisation. If False, then translation can be disabled." -) -# Description. -uf.desc.append(Desc_container()) -uf.desc[-1].add_paragraph("This allows the average domain position to translate during optimisation. By default, only a rotation of the initial structure of the domain is rotated to the average position. This option will be ignored if no PDC data is present, as RDCs contain zero information about the translation of the domain.") -# Prompt examples. -uf.desc.append(Desc_container("Prompt examples")) -uf.desc[-1].add_paragraph("To allow translation of the average domain position during optimisation, type one of:") -uf.desc[-1].add_prompt("relax> frame_order.translate(True)") -uf.desc[-1].add_prompt("relax> frame_order.translate(flat=True)") -uf.backend = frame_order_obj._ave_pos_translation -uf.menu_text = "&translate" -uf.wizard_image = WIZARD_IMAGE_PATH + 'frame_order.png'