Author: bugman Date: Tue May 27 17:21:53 2014 New Revision: 23478 URL: http://svn.gna.org/viewcvs/relax?rev=23478&view=rev Log: Fix for the lib.structure.geometric.generate_vector_residues() function. The atom numbers are no longer read from the internal structural object, as these are not reliable. If another geometric representation exists in the object, then the atom numbers could be None. Or loading structures from multiple PDB files can cause the numbering to be repeated or out of order. Modified: trunk/lib/structure/geometric.py Modified: trunk/lib/structure/geometric.py URL: http://svn.gna.org/viewcvs/relax/trunk/lib/structure/geometric.py?rev=23478&r1=23477&r2=23478&view=diff ============================================================================== --- trunk/lib/structure/geometric.py (original) +++ trunk/lib/structure/geometric.py Tue May 27 17:21:53 2014 @@ -200,9 +200,9 @@ """ # The atom numbers (and indices). - origin_num = mol.atom_num[-1]+1 - atom_num = mol.atom_num[-1]+2 - atom_neg_num = mol.atom_num[-1]+3 + origin_num = len(mol.atom_num)+1 + atom_num = len(mol.atom_num)+2 + atom_neg_num = len(mol.atom_num)+3 # The origin atom. mol.atom_add(pdb_record='HETATM', atom_num=origin_num, atom_name='R', res_name=res_name_vect, chain_id=chain_id, res_num=res_num, pos=origin, segment_id=None, element='C')