Author: bugman Date: Tue Oct 17 06:41:14 2006 New Revision: 2645 URL: http://svn.gna.org/viewcvs/relax?rev=2645&view=rev Log: Fixes for a number of bugs caused by the changes for task #3838. Task #3838 is located at https://gna.org/task/?3838 and more information is given at https://mail.gna.org/public/relax-users/2006-10/msg00002.html (Message-id: <7f080ed10610032153o4571935bq138d2739f55ca3bd@xxxxxxxxxxxxxx>). Part of the problem, the failure of two of the tests of the test suite was reported by Alex Hansen (viochemist _at_ gmail _dot_ com) in the post located at https://mail.gna.org/public/relax-devel/2006-10/msg00095.html (Message-id: <481156b20610130720u39a93e30k6d4603efd8730c96@xxxxxxxxxxxxxx>). Another failure was reported by Alex at https://mail.gna.org/public/relax-devel/2006-10/msg00096.html (Message-id: <481156b20610130728jb6aa76ag3d9487a20397391b@xxxxxxxxxxxxxx). The first fix, which was a missing run argument, is described at https://mail.gna.org/public/relax-devel/2006-10/msg00099.html (Message-id: <7f080ed10610130741j146721c8w512ba61bac3644c7@xxxxxxxxxxxxxx>). The second problem was that the residue number and residue name was being referred to as 'num' and 'name' when they should have been 'res_num' and 'res_name'. The third problem was an index for selecting the residue. Rather than using the real index 'i', the index 'j' was being used. Modified: 1.3/generic_fns/pdb.py Modified: 1.3/generic_fns/pdb.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/pdb.py?rev=2645&r1=2644&r2=2645&view=diff ============================================================================== --- 1.3/generic_fns/pdb.py (original) +++ 1.3/generic_fns/pdb.py Tue Oct 17 06:41:14 2006 @@ -190,7 +190,7 @@ self.relax.data.res[run][res].xh_vect = xh_vect - def vectors(self, heteronuc=None, proton=None, res_num=None, res_name=None): + def vectors(self, run=None, heteronuc=None, proton=None, res_num=None, res_name=None): """Function for calculating/extracting the XH unit vector from the loaded structure.""" # Arguments. @@ -206,18 +206,18 @@ raise RelaxNoSequenceError, run # Test if the residue number is a valid regular expression. - if type(num) == str: + if type(res_num) == str: try: - compile(num) + compile(res_num) except: - raise RelaxRegExpError, ('residue number', num) + raise RelaxRegExpError, ('residue number', res_num) # Test if the residue name is a valid regular expression. - if name: + if res_name: try: - compile(name) + compile(res_name) except: - raise RelaxRegExpError, ('residue name', name) + raise RelaxRegExpError, ('residue name', res_name) # Test that the nuclei have been correctly set. if self.heteronuc == self.proton: @@ -262,16 +262,16 @@ continue # Skip the residue if there is no match to 'num'. - if type(num) == int: - if not data.num == num: + if type(res_num) == int: + if not data.num == res_num: continue - elif type(num) == str: - if not match(num, `data.num`): + elif type(res_num) == str: + if not match(res_num, `data.num`): continue # Skip the residue if there is no match to 'name'. - if name != None: - if not match(name, data.name): + if res_name != None: + if not match(res_name, data.name): continue # Find the corresponding residue in the PDB. @@ -326,24 +326,24 @@ # Average the vectors and convert xh_vect from an array of vectors to a vector. for i in xrange(len(self.relax.data.res[self.run])): - # Remap the data structure 'self.relax.data.res[self.run][j]'. - data = self.relax.data.res[self.run][j] + # Remap the data structure 'self.relax.data.res[self.run][i]'. + data = self.relax.data.res[self.run][i] # Skip unselected residues. if not data.select: continue # Skip the residue if there is no match to 'num'. - if type(num) == int: - if not data.num == num: + if type(res_num) == int: + if not data.num == res_num: continue - elif type(num) == str: - if not match(num, `data.num`): + elif type(res_num) == str: + if not match(res_num, `data.num`): continue # Skip the residue if there is no match to 'name'. - if name != None: - if not match(name, data.name): + if res_name != None: + if not match(res_name, data.name): continue # No vectors.