Author: bugman Date: Fri Dec 12 16:07:07 2008 New Revision: 8211 URL: http://svn.gna.org/viewcvs/relax?rev=8211&view=rev Log: Created a new arg 'combine_models' to the structure.load_spins() user function. This will allow spins to be extracted separately for each model in an ensemble or for only one set of spins for all structures. Modified: 1.3/generic_fns/structure/main.py 1.3/prompt/structure.py Modified: 1.3/generic_fns/structure/main.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure/main.py?rev=8211&r1=8210&r2=8211&view=diff ============================================================================== --- 1.3/generic_fns/structure/main.py (original) +++ 1.3/generic_fns/structure/main.py Fri Dec 12 16:07:07 2008 @@ -42,17 +42,20 @@ -def load_spins(spin_id=None, str_id=None, ave_pos=False): +def load_spins(spin_id=None, str_id=None, combine_models=True, ave_pos=False): """Load the spins from the structural object into the relax data store. - @keyword spin_id: The molecule, residue, and spin identifier string. - @type spin_id: str - @keyword str_id: The structure identifier. This can be the file name, model number, or - structure number. - @type str_id: int or str - @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_id: The molecule, residue, and spin identifier string. + @type spin_id: str + @keyword str_id: The structure identifier. This can be the file name, model number, + or structure number. + @type str_id: int or str + @keyword combine_models: A flag specifying if spins from only one structure of the ensemble + or from all should be loaded. + @type combine_models: bool + @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 """ # Test if the current data pipe exists. Modified: 1.3/prompt/structure.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/structure.py?rev=8211&r1=8210&r2=8211&view=diff ============================================================================== --- 1.3/prompt/structure.py (original) +++ 1.3/prompt/structure.py Fri Dec 12 16:07:07 2008 @@ -237,13 +237,15 @@ generic_fns.structure.geometric.create_vector_dist(length=length, symmetry=symmetry, file=file, dir=dir, force=force) - def load_spins(self, spin_id=None, ave_pos=True): + def load_spins(self, spin_id=None, combine_models=True, ave_pos=True): """Load spins from the structure into the relax data store. Keyword Arguments ~~~~~~~~~~~~~~~~~ spin_id: The spin identification string. + + combine_models: A flag which specifies if spins from separate models should be combined. ave_pos: A flag specifying if the position of the atom is to be averaged. @@ -257,6 +259,9 @@ spin systems within relax. If spin_id is left as None, then all molecules, residues, and atoms will be placed within the data store. + If the combine_models flag is True, then the spins from only a single structure from the + ensemble of models will be taken. If False, then spins will be loaded for each model. + If the ave_pos flag is True, the average position of all structures will be loaded into the spin container. If False, then the positions from all structures will be loaded. @@ -286,6 +291,7 @@ if self.__relax__.interpreter.intro: text = sys.ps3 + "structure.load_spins(" text = text + "spin_id=" + `spin_id` + text = text + ", combine_models=" + `combine_models` text = text + ", ave_pos=" + `ave_pos` + ")" print text @@ -293,12 +299,16 @@ if spin_id != None and type(spin_id) != str: raise RelaxNoneStrError, ('spin identifier', spin_id) + # The model combining flag. + if type(combine_models) != bool: + raise RelaxBoolError, ('model combining flag', combine_models) + # The average position flag. if type(ave_pos) != bool: raise RelaxBoolError, ('average position flag', ave_pos) # Execute the functional code. - generic_fns.structure.main.load_spins(spin_id=spin_id, ave_pos=ave_pos) + generic_fns.structure.main.load_spins(spin_id=spin_id, combine_models=combine_models, ave_pos=ave_pos) def read_pdb(self, file=None, dir=None, model=None, parser='scientific'):