Author: bugman Date: Mon Jan 26 15:31:05 2009 New Revision: 8648 URL: http://svn.gna.org/viewcvs/relax?rev=8648&view=rev Log: Added checks to make sure spin containers corresponding to the Xplor atom strings exist. Modified: branches/ave_noe/generic_fns/xplor.py Modified: branches/ave_noe/generic_fns/xplor.py URL: http://svn.gna.org/viewcvs/relax/branches/ave_noe/generic_fns/xplor.py?rev=8648&r1=8647&r2=8648&view=diff ============================================================================== --- branches/ave_noe/generic_fns/xplor.py (original) +++ branches/ave_noe/generic_fns/xplor.py Mon Jan 26 15:31:05 2009 @@ -28,6 +28,7 @@ from string import split # relax module imports. +from generic_fns.mol_res_spin import return_spin from relax_errors import RelaxError @@ -119,7 +120,10 @@ atom = atom + lines[line_index][char_index] # Convert the atom data to a relax atom id. - data[-1][0] = __convert_to_id(atom) + relax_id = __convert_to_id(atom) + data[-1][0] = relax_id + if not return_spin(relax_id): + raise RelaxError, "The spin container corresponding to '%s' (or '%s' in Xplor format) cannot be found." % (relax_id, atom) # Extract the second atom string. atom = '' @@ -148,7 +152,10 @@ atom = atom + lines[line_index][char_index] # Convert the atom data to a relax atom id. - data[-1][1] = __convert_to_id(atom) + relax_id = __convert_to_id(atom) + data[-1][1] = relax_id + if not return_spin(relax_id): + raise RelaxError, "The spin container corresponding to '%s' (or '%s' in Xplor format) cannot be found." % (relax_id, atom) # The rest of the data (NOE restraint info). info = split(lines[line_index][char_index+1:])