frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
def find_connected(atom, bonds, assign):
    """
    |
    **Description:** Find and assign the same "group (number)" to all the atoms connected to atom

    **Input:**
      atom: atom to look connections from
      bonds: list of all bonds
      assign: list of atoms with numbers assigned in order to cluster them

    
    e.g. -->[1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3]
    
    Atom 1 connected to 2 and 3 so they are in the same group specified by the number 1, etc...

    """
    for i in range(len(bonds)):
        if (bonds[i][0] == atom and assign[bonds[i][1]] == 0 ):
            assign[bonds[i][1]] = assign[atom]
            find_connected(bonds[i][1], bonds, assign)
        if (bonds[i][1] == atom and assign[bonds[i][0]] == 0 ):
            assign[bonds[i][0]] = assign[atom]
            find_connected(bonds[i][0], bonds, assign)

    |
    **Description:** Find and assign the same "group (number)" to all the atoms connected to atom

    **Input:**
      atom: atom to look connections from
      bonds: list of all bonds
      assign: list of atoms with numbers assigned in order to cluster them

    
    e.g. -->[1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3]
    
    Atom 1 connected to 2 and 3 so they are in the same group specified by the number 1, etc...

    
|
Description:** Find and assign the same "group (number)" to all the atoms connected to atom

atom to look connections from
bonds: list of all bonds
assign: list of atoms with numbers assigned in order to cluster them



Atom 1 connected to 2 and 3 so they are in the same group specified by the number 1, etc
| Description : ** Find and assign the same " group ( number ) " to all the atoms connected to atom atom to look connections from bonds : list of all bonds assign : list of atoms with numbers assigned in order to cluster them Atom 1 connected to 2 and 3 so they are in the same group specified by the number 1 etc
def find_connected(atom, bonds, assign):
    for i in range(len(bonds)):
        if (bonds[i][0] == atom and assign[bonds[i][1]] == 0 ):
            assign[bonds[i][1]] = assign[atom]
            find_connected(bonds[i][1], bonds, assign)
        if (bonds[i][1] == atom and assign[bonds[i][0]] == 0 ):
            assign[bonds[i][0]] = assign[atom]
            find_connected(bonds[i][0], bonds, assign)
def find_connected ( atom , bonds , assign ) : for i in range ( len ( bonds ) ) : if ( bonds [ i ] [ 0 ] == atom and assign [ bonds [ i ] [ 1 ] ] == 0 ) : assign [ bonds [ i ] [ 1 ] ] = assign [ atom ] find_connected ( bonds [ i ] [ 1 ] , bonds , assign ) if ( bonds [ i ] [ 1 ] == atom and assign [ bonds [ i ] [ 0 ] ] == 0 ) : assign [ bonds [ i ] [ 0 ] ] = assign [ atom ] find_connected ( bonds [ i ] [ 0 ] , bonds , assign )
|
Description:** Find and assign the same "group (number)" to all the atoms connected to atom
| Description : ** Find and assign the same " group ( number ) " to all the atoms connected to atom
"""
    |
    **Description:** Find and assign the same "group (number)" to all the atoms connected to atom

    **Input:**
      atom: atom to look connections from
      bonds: list of all bonds
      assign: list of atoms with numbers assigned in order to cluster them

    
    e.g. -->[1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3]
    
    Atom 1 connected to 2 and 3 so they are in the same group specified by the number 1, etc...

    """
atom
bonds
assign