Author: bugman
Date: Tue Jan 12 09:38:10 2016
New Revision: 28164
URL: http://svn.gna.org/viewcvs/relax?rev=28164=rev
Log:
Added the spin_num boolean argument to the structure.load_spins user function.
Setting this flag to False will cause the spin number information to be ignored
when creating the
spin containers. This allows for better support of homologous structures but
with different PDB
atom numbering. The default flag value is True, preserving the old behaviour.
Modified:
trunk/pipe_control/structure/main.py
trunk/user_functions/structure.py
Modified: trunk/pipe_control/structure/main.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/structure/main.py?rev=28164=28163=28164=diff
==
--- trunk/pipe_control/structure/main.py(original)
+++ trunk/pipe_control/structure/main.pyTue Jan 12 09:38:10 2016
@@ -1,6 +1,6 @@
###
# #
-# Copyright (C) 2003-2015 Edward d'Auvergne #
+# Copyright (C) 2003-2016 Edward d'Auvergne #
# #
# This file is part of the program relax (http://www.nmr-relax.com). #
# #
@@ -816,7 +816,7 @@
write_data(out=sys.stdout, headings=["Spin_ID", "Position"], data=data)
-def load_spins(spin_id=None, str_id=None, from_mols=None,
mol_name_target=None, ave_pos=False):
+def load_spins(spin_id=None, str_id=None, from_mols=None,
mol_name_target=None, ave_pos=False, spin_num=True):
"""Load the spins from the structural object into the relax data store.
@keyword spin_id: The molecule, residue, and spin identifier
string.
@@ -829,11 +829,13 @@
@type mol_name_target: str or None
@keyword ave_pos: A flag specifying if the average atom position
or the atom position from all loaded structures is loaded into the
SpinContainer.
@type ave_pos: bool
+@keyword spin_num: A flag specifying if the spin number should be
loaded.
+@type spin_num: bool
"""
# The multi-molecule case.
if from_mols != None:
-load_spins_multi_mol(spin_id=spin_id, str_id=str_id,
from_mols=from_mols, mol_name_target=mol_name_target, ave_pos=ave_pos)
+load_spins_multi_mol(spin_id=spin_id, str_id=str_id,
from_mols=from_mols, mol_name_target=mol_name_target, ave_pos=ave_pos,
spin_num=spin_num)
return
# Checks.
@@ -856,6 +858,10 @@
# Override the molecule name.
if mol_name_target:
mol_name = mol_name_target
+
+# No spin number.
+if not spin_num:
+atom_num = None
# Remove the '+' regular expression character from the mol, res, and
spin names!
if mol_name and search('\+', mol_name):
@@ -904,7 +910,7 @@
cdp.N = cdp.structure.num_models()
-def load_spins_multi_mol(spin_id=None, str_id=None, from_mols=None,
mol_name_target=None, ave_pos=False):
+def load_spins_multi_mol(spin_id=None, str_id=None, from_mols=None,
mol_name_target=None, ave_pos=False, spin_num=True):
"""Load the spins from the structural object into the relax data store.
@keyword spin_id: The molecule, residue, and spin identifier
string.
@@ -917,6 +923,8 @@
@type mol_name_target: str or None
@keyword ave_pos: A flag specifying if the average atom position
or the atom position from all loaded structures is loaded into the
SpinContainer.
@type ave_pos: bool
+@keyword spin_num: A flag specifying if the spin number should be
loaded.
+@type spin_num: bool
"""
# Checks.
@@ -966,6 +974,10 @@
res_name = res_name.replace('+', '')
if atom_name and search('\+', atom_name):
atom_name = atom_name.replace('+', '')
+
+# No spin number.
+if not spin_num:
+atom_num = None
# 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)
Modified: trunk/user_functions/structure.py
URL:
http://svn.gna.org/viewcvs/relax/trunk/user_functions/structure.py?rev=28164=28163=28164=diff
==
--- trunk/user_functions/structure.py (original)
+++ trunk/user_functions/structure.py Tue Jan 12 09:38:10 2016
@@ -1,6 +1,6 @@
###
# #