Author: bugman Date: Wed Oct 22 09:47:22 2014 New Revision: 26334 URL: http://svn.gna.org/viewcvs/relax?rev=26334&view=rev Log: Modified the atomic position handling in pipe_control.structure.main.load_spins_multi_mol(). The multiple molecule merging functionality of the structure.load_spins user function now handles missing atomic positions differently. The aim is that the length of the spin container position variable is fixed for all spins to the number of structures, as the N-state model analysis assumes this equal length for all spins. When data is missing, the atomic position for that structure is now set to None. This will require other modifications in relax to support this new design. Modified: trunk/pipe_control/structure/main.py Modified: trunk/pipe_control/structure/main.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/structure/main.py?rev=26334&r1=26333&r2=26334&view=diff ============================================================================== --- trunk/pipe_control/structure/main.py (original) +++ trunk/pipe_control/structure/main.py Wed Oct 22 09:47:22 2014 @@ -831,6 +831,9 @@ # Loop over all target molecules. for mol_name in from_mols: + # Add the molecule name as a key for the positions structure, and initialise as a dictionary for the spin IDs. + positions[mol_name] = {} + # Create a new spin ID with the molecule name. new_id = '#' + mol_name if spin_id != None: @@ -848,10 +851,11 @@ # Generate a spin ID for the current atom. id = generate_spin_id_unique(mol_name=mol_name_target, res_num=res_num, res_name=res_name, spin_name=atom_name) + # Store the position info in all cases. + positions[mol_name][id] = pos + # Not a new ID. if id in ids: - # Store the position info. - positions[id].append(pos) continue # Store the ID, residue, spin, element and position info. @@ -859,7 +863,6 @@ res_nums[id] = res_num res_names[id] = res_name spin_names[id] = atom_name - positions[id] = [pos] elements[id] = element # Catch no data. @@ -881,7 +884,12 @@ spin_cont = create_spin(mol_name=mol_name_target, res_num=res_nums[id], res_name=res_names[id], spin_name=spin_names[id]) # Position vector. - spin_cont.pos = positions[id] + spin_cont.pos = [] + for mol_name in from_mols: + if id in positions[mol_name]: + spin_cont.pos.append(positions[mol_name][id]) + else: + spin_cont.pos.append(None) # Add the element. spin_cont.element = elements[id]