mailr26360 - in /trunk: pipe_control/pcs.py pipe_control/rdc.py user_functions/pcs.py user_functions/rdc.py


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

Header


Content

Posted by edward on October 22, 2014 - 16:31:
Author: bugman
Date: Wed Oct 22 16:31:04 2014
New Revision: 26360

URL: http://svn.gna.org/viewcvs/relax?rev=26360&view=rev
Log:
Added printouts for the rdc.calc_q_factors and pcs_calc_q_factors user 
functions.

These are activated by the new verbosity user function argument which 
defaults to 1.  If the value
is greater than 0, then the backend will print out all the calculated Q 
factors.


Modified:
    trunk/pipe_control/pcs.py
    trunk/pipe_control/rdc.py
    trunk/user_functions/pcs.py
    trunk/user_functions/rdc.py

Modified: trunk/pipe_control/pcs.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/pcs.py?rev=26360&r1=26359&r2=26360&view=diff
==============================================================================
--- trunk/pipe_control/pcs.py   (original)
+++ trunk/pipe_control/pcs.py   Wed Oct 22 16:31:04 2014
@@ -545,12 +545,18 @@
     return True
 
 
-def q_factors(spin_id=None):
+def q_factors(spin_id=None, verbosity=0):
     """Calculate the Q factors for the PCS data.
 
     @keyword spin_id:   The spin ID string used to restrict the Q factor 
calculation to a subset of all spins.
     @type spin_id:      None or str
-    """
+    @keyword verbosity: A flag specifying the amount of information to 
print.  The higher the value, the greater the verbosity.
+    @type verbosity:    int
+    """
+
+    # Initial printout.
+    if verbosity:
+        print("\nPCS Q factors:")
 
     # Check the pipe setup.
     check_pipe_setup(sequence=True)
@@ -612,6 +618,10 @@
         if not pcs_bc_data:
             warn(RelaxWarning("No back-calculated PCS data can be found for 
the alignment ID '%s', skipping the PCS Q factor calculation for this 
alignment." % align_id))
             continue
+
+        # ID and PCS Q factor printout.
+        if verbosity:
+            print("    Alignment ID '%s':  %.3f" % (align_id, 
cdp.q_factors_pcs[align_id]))
 
     # The total Q factor.
     cdp.q_pcs = 0.0

Modified: trunk/pipe_control/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/rdc.py?rev=26360&r1=26359&r2=26360&view=diff
==============================================================================
--- trunk/pipe_control/rdc.py   (original)
+++ trunk/pipe_control/rdc.py   Wed Oct 22 16:31:04 2014
@@ -596,12 +596,18 @@
     return True
 
 
-def q_factors(spin_id=None):
+def q_factors(spin_id=None, verbosity=1):
     """Calculate the Q factors for the RDC data.
 
     @keyword spin_id:   The spin ID string used to restrict the Q factor 
calculation to a subset of all spins.
     @type spin_id:      None or str
-    """
+    @keyword verbosity: A flag specifying the amount of information to 
print.  The higher the value, the greater the verbosity.
+    @type verbosity:    int
+    """
+
+    # Initial printout.
+    if verbosity:
+        print("\nRDC Q factors (norm1, norm2):")
 
     # Check the pipe setup.
     check_pipe_setup(sequence=True)
@@ -713,6 +719,10 @@
 
         # The second Q factor definition.
         cdp.q_factors_rdc_norm2[align_id] = sqrt(sse / D2_sum)
+
+        # ID and RDC Q factor printout.
+        if verbosity:
+            print("    Alignment ID '%s':  %.3f, %.3f" % (align_id, 
cdp.q_factors_rdc[align_id], cdp.q_factors_rdc_norm2[align_id]))
 
     # The total Q factor.
     cdp.q_rdc = 0.0

Modified: trunk/user_functions/pcs.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/user_functions/pcs.py?rev=26360&r1=26359&r2=26360&view=diff
==============================================================================
--- trunk/user_functions/pcs.py (original)
+++ trunk/user_functions/pcs.py Wed Oct 22 16:31:04 2014
@@ -83,6 +83,13 @@
     desc = "The spin ID string for restricting to subset of all selected 
spins.",
     can_be_none = True
 )
+uf.add_keyarg(
+    name = "verbosity",
+    default = 1,
+    py_type = "int",
+    desc_short = "verbosity level",
+    desc = "The amount of information to print out.  Set to zero to silence 
the user function, or one to see all messages."
+)
 # Description.
 uf.desc.append(Desc_container())
 uf.desc[-1].add_paragraph("For this to work, the back-calculated PCS data 
must first be generated by the analysis specific code.  Otherwise a warning 
will be given.")

Modified: trunk/user_functions/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/user_functions/rdc.py?rev=26360&r1=26359&r2=26360&view=diff
==============================================================================
--- trunk/user_functions/rdc.py (original)
+++ trunk/user_functions/rdc.py Wed Oct 22 16:31:04 2014
@@ -83,6 +83,13 @@
     desc = "The spin ID string for restricting to subset of all selected 
spins.",
     can_be_none = True
 )
+uf.add_keyarg(
+    name = "verbosity",
+    default = 1,
+    py_type = "int",
+    desc_short = "verbosity level",
+    desc = "The amount of information to print out.  Set to zero to silence 
the user function, or one to see all messages."
+)
 # Description.
 uf.desc.append(Desc_container())
 uf.desc[-1].add_paragraph("For this to work, the back-calculated RDC data 
must first be generated by the analysis specific code.  Otherwise a warning 
will be given.")




Related Messages


Powered by MHonArc, Updated Wed Oct 22 16:40:03 2014