frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
def assign_ligand_groups(tors, all_bonds, n_atoms):
    """
    |
    **Description:** Cluster atoms in groups depending whether or not they are connected

    **Input:**
      - tors: all torsions of the ligand
      - all_bonds: all ligand bonds
      - n_atoms: number of atoms of the ligand

    **Output:**
      - assign= List of Cluster of atoms depending whether or not they are connected
    
    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...
    """

    bonds = remove_tors(all_bonds, tors)  # fixed bonds
    n_assign = 0
    c_group = 0
    assign = [0 for x in range(n_atoms)]
    for i in range(n_atoms):
        assign[i] = 0
    done = 0
    while (done == 0):
        done = 1
        # Find the first unassigned atom and assign to a new group
        for i in range(n_atoms):
            if ( assign[i] == 0):
                c_group = c_group + 1;
                done = 0
                assign[i] = c_group
                # Find all the atoms that connect to it
                find_connected(i, bonds, assign)
                break
    return assign

    |
    **Description:** Cluster atoms in groups depending whether or not they are connected

    **Input:**
      - tors: all torsions of the ligand
      - all_bonds: all ligand bonds
      - n_atoms: number of atoms of the ligand

    **Output:**
      - assign= List of Cluster of atoms depending whether or not they are connected
    
    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:** Cluster atoms in groups depending whether or not they are connected

all torsions of the ligand
all_bonds: all ligand bonds
n_atoms: number of atoms of the ligand

assign= List of Cluster of atoms depending whether or not they are connected



Atom 1 connected to 2 and 3 so they are in the same group specified by the number 1, etc
| Description : ** Cluster atoms in groups depending whether or not they are connected all torsions of the ligand all_bonds : all ligand bonds n_atoms : number of atoms of the ligand assign = List of Cluster of atoms depending whether or not they are connected Atom 1 connected to 2 and 3 so they are in the same group specified by the number 1 etc
def assign_ligand_groups(tors, all_bonds, n_atoms):
    bonds = remove_tors(all_bonds, tors)  
    n_assign = 0
    c_group = 0
    assign = [0 for x in range(n_atoms)]
    for i in range(n_atoms):
        assign[i] = 0
    done = 0
    while (done == 0):
        done = 1
        for i in range(n_atoms):
            if ( assign[i] == 0):
                c_group = c_group + 1;
                done = 0
                assign[i] = c_group
                find_connected(i, bonds, assign)
                break
    return assign
def assign_ligand_groups ( tors , all_bonds , n_atoms ) : bonds = remove_tors ( all_bonds , tors ) n_assign = 0 c_group = 0 assign = [ 0 for x in range ( n_atoms ) ] for i in range ( n_atoms ) : assign [ i ] = 0 done = 0 while ( done == 0 ) : done = 1 for i in range ( n_atoms ) : if ( assign [ i ] == 0 ) : c_group = c_group + 1 ; done = 0 assign [ i ] = c_group find_connected ( i , bonds , assign ) break return assign
|
Description:** Cluster atoms in groups depending whether or not they are connected
| Description : ** Cluster atoms in groups depending whether or not they are connected
"""
    |
    **Description:** Cluster atoms in groups depending whether or not they are connected

    **Input:**
      - tors: all torsions of the ligand
      - all_bonds: all ligand bonds
      - n_atoms: number of atoms of the ligand

    **Output:**
      - assign= List of Cluster of atoms depending whether or not they are connected
    
    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...
    """ # fixed bonds # Find the first unassigned atom and assign to a new group # Find all the atoms that connect to it
tors
all_bonds
n_atoms