mailr11168 - /1.3/specific_fns/n_state_model.py


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

Header


Content

Posted by edward on April 29, 2010 - 14:52:
Author: bugman
Date: Thu Apr 29 14:52:20 2010
New Revision: 11168

URL: http://svn.gna.org/viewcvs/relax?rev=11168&view=rev
Log:
Bug fix for the N-state model 'fixed' and 'population' models.

If too many tensors are initialised in comparison to PCS and RDC alignments, 
then the parameter
vector or parameter number was not being correctly assembled.  The 
cdp.align_ids is now being used
to validate all setups.


Modified:
    1.3/specific_fns/n_state_model.py

Modified: 1.3/specific_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/n_state_model.py?rev=11168&r1=11167&r2=11168&view=diff
==============================================================================
--- 1.3/specific_fns/n_state_model.py (original)
+++ 1.3/specific_fns/n_state_model.py Thu Apr 29 14:52:20 2010
@@ -88,6 +88,11 @@
         if 'rdc' in data_types or 'pcs' in data_types:
             # Loop over the alignments, adding the alignment tensor 
parameters to the parameter vector.
             for i in xrange(len(cdp.align_tensors)):
+                # No alignment ID, so skip the tensor as it will not be 
optimised.
+                if cdp.align_tensors[i].name not in cdp.align_ids:
+                    continue
+
+                # Add the parameters.
                 param_vector = param_vector + list(cdp.align_tensors[i].A_5D)
 
         # Monte Carlo simulation data structures.
@@ -156,7 +161,7 @@
         # Starting point of the populations.
         pop_start = 0
         if 'rdc' in data_types or 'pcs' in data_types:
-            pop_start = pop_start + 5*len(cdp.align_tensors)
+            pop_start = pop_start + 5*len(cdp.align_ids)
 
         # Loop over the populations, and set the scaling factor.
         if cdp.model in ['2-domain', 'population']:
@@ -453,6 +458,10 @@
         if 'rdc' in data_types or 'pcs' in data_types:
             # Loop over the alignments, adding the alignment tensor 
parameters to the tensor data container.
             for i in xrange(len(cdp.align_tensors)):
+                # No alignment ID, so skip the tensor as it will not be 
optimised.
+                if cdp.align_tensors[i].name not in cdp.align_ids:
+                    continue
+
                 cdp.align_tensors[i].Axx = param_vector[5*i]
                 cdp.align_tensors[i].Ayy = param_vector[5*i+1]
                 cdp.align_tensors[i].Axy = param_vector[5*i+2]
@@ -460,7 +469,7 @@
                 cdp.align_tensors[i].Ayz = param_vector[5*i+4]
 
             # Create a new parameter vector without the tensors.
-            param_vector = param_vector[5*len(cdp.align_tensors):]
+            param_vector = param_vector[5*len(cdp.align_ids):]
 
         # Monte Carlo simulation data structures.
         if sim_index != None:
@@ -572,7 +581,7 @@
         # Starting point of the populations.
         pop_start = 0
         if 'rdc' in data_types or 'pcs' in data_types:
-            pop_start = pop_start + 5*len(cdp.align_tensors)
+            pop_start = pop_start + 5*len(cdp.align_ids)
 
         # Initialisation (0..j..m).
         A = []
@@ -1144,7 +1153,14 @@
 
         # Alignment tensor params.
         if 'rdc' in data_types or 'pcs' in data_types:
-            num = num + 5*len(cdp.align_tensors)
+            # Loop over the alignments.
+            for i in xrange(len(cdp.align_tensors)):
+                # No alignment ID, so skip the tensor as it is not part of 
the parameter set.
+                if cdp.align_tensors[i].name not in cdp.align_ids:
+                    continue
+
+                # Add 5 tensor parameters.
+                num = num + 5
 
         # Populations.
         if cdp.model in ['2-domain', 'population']:
@@ -1699,7 +1715,7 @@
             cdp.warning = warning
 
         # Statistical analysis.
-        if 'rdc' in data_types or 'pcs' in data_types:
+        if ('rdc' in data_types or 'pcs' in data_types):
             # Get the final back calculated data (for the Q-factor and
             self._minimise_bc_data(model)
 




Related Messages


Powered by MHonArc, Updated Thu Apr 29 15:40:01 2010