Author: bugman Date: Wed Sep 4 18:05:59 2013 New Revision: 20810 URL: http://svn.gna.org/viewcvs/relax?rev=20810&view=rev Log: Created the pipe_control.mol_res_spin.check_mol_res_spin_data() function. This will check for the existence of molecule, residue and spin data and raise a RelaxError if none exists. Modified: trunk/pipe_control/mol_res_spin.py Modified: trunk/pipe_control/mol_res_spin.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/mol_res_spin.py?rev=20810&r1=20809&r2=20810&view=diff ============================================================================== --- trunk/pipe_control/mol_res_spin.py (original) +++ trunk/pipe_control/mol_res_spin.py Wed Sep 4 18:05:59 2013 @@ -39,7 +39,7 @@ # relax module imports. from lib.check_types import is_unicode -from lib.errors import RelaxError, RelaxNoSpinError, RelaxMultiMolIDError, RelaxMultiResIDError, RelaxMultiSpinIDError, RelaxResSelectDisallowError, RelaxSpinSelectDisallowError +from lib.errors import RelaxError, RelaxNoSequenceError, RelaxNoSpinError, RelaxMultiMolIDError, RelaxMultiResIDError, RelaxMultiSpinIDError, RelaxResSelectDisallowError, RelaxSpinSelectDisallowError from lib.selection import Selection, parse_token, tokenise from lib.warnings import RelaxWarning from pipe_control import exp_info, pipes @@ -180,6 +180,17 @@ # Add the entity. star.entity.add(mol_name=mol.name, mol_type=mol_type, polymer_type=polymer_type, polymer_seq_code=polymer_seq_code, thiol_state=cdp.exp_info.thiol_state, res_nums=res_nums, res_names=res_names) + + +def check_mol_res_spin_data(): + """Check for the presence of molecule, residue, and spin data. + + @raises: RelaxNoSequenceError if no data is present. + """ + + # Check that the spectrum ID structure exists. + if not exists_mol_res_spin_data(): + raise RelaxNoSequenceError def copy_molecule(pipe_from=None, mol_from=None, pipe_to=None, mol_to=None):