frag_pele/PlopRotTemp_S_2017/template/templateBuilder.py
def fix_parents_rings(self, parents, atom_names):
        """
            For every ring in the structure assign as parent 
            of each atom the previous. To close the ring assign
            as parent of the initial atom the last.
        """
        str1 = next(structure.StructureReader(self.input_file))
        rings = str1.ring
        for ring in rings:
            ring_atoms = ring.getAtomList()
            initial_atom = ring_atoms[0]-1
            last_atom= ring_atoms[-1]-1

            start = True
            current_atom = initial_atom
            next_atom = ring_atoms[1] -1
            counter=1
            while (current_atom != initial_atom  or start is True):
                try:
                    parents[next_atom] = current_atom
                    counter+=1
                    current_atom=next_atom
                    next_atom=ring_atoms[counter]-1
                    start=False
                except IndexError:
                    parents[initial_atom] = last_atom
                    break
        return parents

            For every ring in the structure assign as parent 
            of each atom the previous. To close the ring assign
            as parent of the initial atom the last.
        
For every ring in the structure assign as parent
of each atom the previous. To close the ring assign
as parent of the initial atom the last.
For every ring in the structure assign as parent of each atom the previous . To close the ring assign as parent of the initial atom the last .
def fix_parents_rings(self, parents, atom_names):
        str1 = next(structure.StructureReader(self.input_file))
        rings = str1.ring
        for ring in rings:
            ring_atoms = ring.getAtomList()
            initial_atom = ring_atoms[0]-1
            last_atom= ring_atoms[-1]-1
            start = True
            current_atom = initial_atom
            next_atom = ring_atoms[1] -1
            counter=1
            while (current_atom != initial_atom  or start is True):
                try:
                    parents[next_atom] = current_atom
                    counter+=1
                    current_atom=next_atom
                    next_atom=ring_atoms[counter]-1
                    start=False
                except IndexError:
                    parents[initial_atom] = last_atom
                    break
        return parents
def fix_parents_rings ( self , parents , atom_names ) : str1 = next ( structure . StructureReader ( self . input_file ) ) rings = str1 . ring for ring in rings : ring_atoms = ring . getAtomList ( ) initial_atom = ring_atoms [ 0 ] - 1 last_atom = ring_atoms [ - 1 ] - 1 start = True current_atom = initial_atom next_atom = ring_atoms [ 1 ] - 1 counter = 1 while ( current_atom != initial_atom or start is True ) : try : parents [ next_atom ] = current_atom counter += 1 current_atom = next_atom next_atom = ring_atoms [ counter ] - 1 start = False except IndexError : parents [ initial_atom ] = last_atom break return parents
For every ring in the structure assign as parent
of each atom the previous.
For every ring in the structure assign as parent of each atom the previous .
"""
            For every ring in the structure assign as parent 
            of each atom the previous. To close the ring assign
            as parent of the initial atom the last.
        """
self
parents
atom_names