mailr19402 - in /trunk: pipe_control/grace.py user_functions/grace.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on April 08, 2013 - 16:45:
Author: bugman
Date: Mon Apr  8 16:45:13 2013
New Revision: 19402

URL: http://svn.gna.org/viewcvs/relax?rev=19402&view=rev
Log:
The grace.write user function data type argument sequence values have changed.

Instead of 'spin', this can now be 'res_num' or 'spin_num' to specify that 
either the residue number
or spin number should be plotted on the desired axis.  The x_data_type now 
defaults to 'res_num'.


Modified:
    trunk/pipe_control/grace.py
    trunk/user_functions/grace.py

Modified: trunk/pipe_control/grace.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/grace.py?rev=19402&r1=19401&r2=19402&view=diff
==============================================================================
--- trunk/pipe_control/grace.py (original)
+++ trunk/pipe_control/grace.py Mon Apr  8 16:45:13 2013
@@ -60,7 +60,7 @@
     axis_labels = [None, None]
     for i in range(2):
         # Determine the sequence data type.
-        if data_type[i] == 'spin':
+        if data_type[i] == 'res_num':
             seq_type[i] = 'res'
 
         # Analysis specific methods for making labels.
@@ -74,12 +74,12 @@
             return_grace_string = 
specific_analyses.setup.get_specific_fn('return_grace_string', 
pipes.get_type())
 
             # Test if the axis data type is a minimisation statistic.
-            if data_type[i] and data_type[i] != 'spin' and 
pipe_control.minimise.return_data_name(data_type[i]):
+            if data_type[i] and data_type[i] != 'res_num' and 
pipe_control.minimise.return_data_name(data_type[i]):
                 return_units = pipe_control.minimise.return_units
                 return_grace_string = 
pipe_control.minimise.return_grace_string
 
         # Some axis default values for spin data.
-        if data_type[i] == 'spin':
+        if data_type[i] == 'res_num':
             # Residue only data.
             if seq_type[i] == 'res':
                 # Axis limits.
@@ -184,8 +184,8 @@
     data_dict = False
 
     # Specific x and y value returning functions.
-    x_return_value, x_return_conversion_factor, x_get_type = 
determine_functions(category=x_data_type)
-    y_return_value, y_return_conversion_factor, y_get_type = 
determine_functions(category=y_data_type)
+    x_return_value, x_return_conversion_factor, x_get_type = 
determine_functions(data_name=x_data_type)
+    y_return_value, y_return_conversion_factor, y_get_type = 
determine_functions(data_name=y_data_type)
 
     # Number of graph sets.
     if plot_data == 'sim':
@@ -215,7 +215,7 @@
                 continue
 
             # The X data (plotted as residue numbers).
-            if x_data_type == 'spin':
+            if x_data_type == 'res_num':
                 x_val = res_num
                 x_err = None
 
@@ -225,7 +225,7 @@
                 x_val, x_err = x_return_value(spin, x_data_type, sim=sim)
 
             # The Y data (plotted as residue numbers).
-            if y_data_type == 'spin':
+            if y_data_type == 'res_num':
                 y_val = res_num
                 y_err = None
 
@@ -320,12 +320,12 @@
                 point = data[0][index][-1]
 
                 # Conversion factors.
-                if x_data_type != 'spin':
+                if x_data_type != 'res_num':
                     x_val[j] = x_val[j] / 
x_return_conversion_factor(x_data_type)
-                if x_err[j] and x_data_type != 'spin':
+                if x_err[j] and x_data_type != 'res_num':
                     x_err[j] = x_err[j] / 
x_return_conversion_factor(x_data_type)
                 y_val[j] = y_val[j] / y_return_conversion_factor(y_data_type)
-                if y_err[j] and y_data_type != 'spin':
+                if y_err[j] and y_data_type != 'res_num':
                     y_err[j] = y_err[j] / 
y_return_conversion_factor(y_data_type)
 
                 # Append the data.
@@ -437,7 +437,7 @@
     system(grace_exe + " " + file_path + " &")
 
 
-def write(x_data_type='spin', y_data_type=None, spin_id=None, 
plot_data='value', file=None, dir=None, force=False, norm=True):
+def write(x_data_type='res_num', y_data_type=None, spin_id=None, 
plot_data='value', file=None, dir=None, force=False, norm=True):
     """Writing data to a file.
 
     @keyword x_data_type:   The category of the X-axis data.

Modified: trunk/user_functions/grace.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/user_functions/grace.py?rev=19402&r1=19401&r2=19402&view=diff
==============================================================================
--- trunk/user_functions/grace.py (original)
+++ trunk/user_functions/grace.py Mon Apr  8 16:45:13 2013
@@ -100,7 +100,7 @@
 uf.title_short = "Grace file creation."
 uf.add_keyarg(
     name = "x_data_type",
-    default = "spin",
+    default = "res_num",
     py_type = "str",
     desc_short = "x data type",
     desc = "The data type for the X-axis (no regular expression is 
allowed).",
@@ -119,7 +119,7 @@
     name = "spin_id",
     py_type = "str",
     desc_short = "spin ID string",
-    desc = "The spin identification string.",
+    desc = "The spin ID string.",
     can_be_none = True
 )
 uf.add_keyarg(
@@ -175,9 +175,12 @@
 )
 # Description.
 uf.desc.append(Desc_container())
-uf.desc[-1].add_paragraph("This is designed to be as flexible as possible so 
that any combination of data can be plotted.  The output is in the format of 
a Grace plot (also known as ACE/gr, Xmgr, and xmgrace) which only supports 
two dimensional plots.  Three types of information can be used to create 
various types of plot.  These include the x-axis and y-axis data types, the 
spin identification string, and the type of data plot.")
-uf.desc[-1].add_paragraph("The x-axis and y-axis data types should be plain 
strings, regular expression is not allowed.  If the x-axis data type is not 
given, the plot will default to having the spin sequence along the x-axis.  
The two axes of the Grace plot can be absolutely any of the data types listed 
in the tables below.  The only limitation, currently anyway, is that the data 
must belong to the same data pipe.")
-uf.desc[-1].add_paragraph("The spin identification string can be used to 
limit which spins are used in the plot.  The default is that all spins will 
be used, however, the ID string can be used to select a subset of all spins, 
or a single spin for plots of Monte Carlo simulations, etc.")
+uf.desc[-1].add_paragraph("This is designed to be as flexible as possible so 
that any combination of data can be plotted.  The output is in the format of 
a Grace plot (also known as ACE/gr, Xmgr, and xmgrace) which only supports 
two dimensional plots.  Three types of information can be used to create 
various types of plot.  These include the x-axis and y-axis data types, the 
spin ID string, and the type of data plot.")
+uf.desc[-1].add_paragraph("The x-axis and y-axis data types should be plain 
strings, regular expression is not allowed.  The two axes of the Grace plot 
can be any of the data types listed in the tables below.  The only limitation 
is that the data must belong to the same data pipe.")
+uf.desc[-1].add_paragraph("If the x-axis data type is not given, the plot 
will default to having the residue numbering along the x-axis.Two special 
data types for the axes are:")
+uf.desc[-1].add_item_list_element("'res_num'", "The axis will consist of the 
residue numbering.")
+uf.desc[-1].add_item_list_element("'spin_num'", "The axis will consist of 
the spin numbering.")
+uf.desc[-1].add_paragraph("The spin ID string can be used to limit which 
spins are used in the plot.  The default is that all spins will be used, 
however, the ID string can be used to select a subset of all spins, or a 
single spin for plots of Monte Carlo simulations, etc.")
 uf.desc[-1].add_paragraph("The property which is actually plotted can be 
controlled by the plot data setting.  This can be one of the following:")
 uf.desc[-1].add_item_list_element("'value'", "Plot values (with errors if 
they exist).")
 uf.desc[-1].add_item_list_element("'error'", "Plot errors.")
@@ -193,9 +196,9 @@
 # Prompt examples.
 uf.desc.append(Desc_container("Prompt examples"))
 uf.desc[-1].add_paragraph("To write the NOE values for all spins to the 
Grace file 'noe.agr', type one of:")
-uf.desc[-1].add_prompt("relax> grace.write('spin', 'noe', file='noe.agr')")
+uf.desc[-1].add_prompt("relax> grace.write('res_num', 'noe', 
file='noe.agr')")
 uf.desc[-1].add_prompt("relax> grace.write(y_data_type='noe', 
file='noe.agr')")
-uf.desc[-1].add_prompt("relax> grace.write(x_data_type='spin', 
y_data_type='noe', file='noe.agr')")
+uf.desc[-1].add_prompt("relax> grace.write(x_data_type='res_num', 
y_data_type='noe', file='noe.agr')")
 uf.desc[-1].add_prompt("relax> grace.write(y_data_type='noe', 
file='noe.agr', force=True)")
 uf.desc[-1].add_paragraph("To create a Grace file of 's2' vs. 'te' for all 
spins, type one of:")
 uf.desc[-1].add_prompt("relax> grace.write('s2', 'te', file='s2_te.agr')")




Related Messages


Powered by MHonArc, Updated Mon Apr 08 17:00:02 2013