mailr11288 - in /1.3: generic_fns/rdc.py prompt/rdc.py


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

Header


Content

Posted by edward on July 03, 2010 - 21:56:
Author: bugman
Date: Sat Jul  3 21:56:40 2010
New Revision: 11288

URL: http://svn.gna.org/viewcvs/relax?rev=11288&view=rev
Log:
The rdc.back_calc() user function without an ID arg will back-calculate RDCs 
for all alignments.


Modified:
    1.3/generic_fns/rdc.py
    1.3/prompt/rdc.py

Modified: 1.3/generic_fns/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/rdc.py?rev=11288&r1=11287&r2=11288&view=diff
==============================================================================
--- 1.3/generic_fns/rdc.py (original)
+++ 1.3/generic_fns/rdc.py Sat Jul  3 21:56:40 2010
@@ -49,8 +49,14 @@
     """
 
     # Arg check.
-    if align_id not in cdp.align_ids:
+    if align_id and align_id not in cdp.rdc_ids:
         raise RelaxError, "The alignment ID '%s' is not in the alignment ID 
list %s." % (align_id, cdp.align_ids)
+
+    # Convert the align IDs to an array, or take all IDs.
+    if align_id:
+        align_ids = [align_id]
+    else:
+        align_ids = cdp.rdc_ids
 
     # The weights.
     weights = ones(cdp.N, float64) / cdp.N
@@ -85,10 +91,13 @@
         for c in range(cdp.N):
             unit_vect[c] = vectors[c] / norm(vectors[c])
 
-        # Calculate the RDC.
+        # Initialise if necessary.
         if not hasattr(spin, 'rdc_bc'):
             spin.rdc_bc = {}
-        spin.rdc_bc[align_id] = ave_rdc_tensor(dj, unit_vect, cdp.N, 
cdp.align_tensors[get_tensor_index(align_id)].A, weights=weights)
+
+        # Calculate the RDCs.
+        for id in align_ids:
+            spin.rdc_bc[id] = ave_rdc_tensor(dj, unit_vect, cdp.N, 
cdp.align_tensors[get_tensor_index(id)].A, weights=weights)
 
 
 def corr_plot(format=None, file=None, dir=None, force=False):

Modified: 1.3/prompt/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/rdc.py?rev=11288&r1=11287&r2=11288&view=diff
==============================================================================
--- 1.3/prompt/rdc.py (original)
+++ 1.3/prompt/rdc.py Sat Jul  3 21:56:40 2010
@@ -50,7 +50,7 @@
             print(text)
 
         # The argument checks.
-        arg_check.is_str(align_id, 'alignment ID string')
+        arg_check.is_str(align_id, 'alignment ID string', can_be_none=True)
 
         # Execute the functional code.
         rdc.back_calc(align_id=align_id)




Related Messages


Powered by MHonArc, Updated Tue Jul 06 18:20:01 2010