frag_pele/PlopRotTemp_S_2017/PlopRotTemp.py
def FindCore_GetCoreAtom(tors, bonds, natoms, user_core_atom, back_tors, use_mult_lib,debug=False):
    """
    |
    **Description**: 
    Search for the core atom wich maximes
    the number of sidechains.

    **Input:**
      - tors: Atoms with torsions
      - bonds: connectivity
      - natoms: number of atoms of the ligand
      - user_core_atom: predefined user core atom
      - back_tors: user backbone atoms with torsion
      - use_mult_lib: User decision to use or not multiples libraries.

    **Ouput:**
      - core_atom: atom which will be the center of the core
      - assign: List of atoms with numbers assigned in order to cluster them
      - rank:  list of numbers for each atom which will show 
               which atoms are closer to the atom we are making the rank from.
      - group: List that classifies the atoms in groups depending on connectivity
      to later on make different multiple libraries.
    """

    # Split into sections not seperated by rotatable bonds
    assign = assign_ligand_groups(tors, bonds, natoms)
    if debug:
        print(' -- ligand groups assigned.')
    if (user_core_atom > 0):
        print(' -- r')
        core_atom = user_core_atom - 1
    else:
        # print ' -- here3'
        min_rank = 10000
        core_atom = -1
        for atom_num in range(natoms):
            # print bonds, assign, atom_num
            rank = assign_rank(bonds, assign, atom_num)
            if debug:
                print(' -- rank assigned')
            [start_atom, num_core] = get_start_atom(tors + back_tors, rank)
            if (max_value(rank) < min_rank and start_atom >= 0):
                core_atom = atom_num
                min_rank = max_value(rank)
                # mass = find_mass_names(atom_names)
            #    group = find_largest_ligand_group(assign,mass) 
            #    out_names = convert_num_to_name(group,atom_names)
    if debug:
        print(' -- else finished')
    rank = assign_rank(bonds, assign, core_atom)
    if debug:
        print(' -- ranks assigned')
    if (use_mult_lib):
        group = assign_group(bonds, rank)
    else:
        group = []
        for i in range(natoms):
            group.append(0)
    return core_atom, assign, rank, group

    |
    **Description**: 
    Search for the core atom wich maximes
    the number of sidechains.

    **Input:**
      - tors: Atoms with torsions
      - bonds: connectivity
      - natoms: number of atoms of the ligand
      - user_core_atom: predefined user core atom
      - back_tors: user backbone atoms with torsion
      - use_mult_lib: User decision to use or not multiples libraries.

    **Ouput:**
      - core_atom: atom which will be the center of the core
      - assign: List of atoms with numbers assigned in order to cluster them
      - rank:  list of numbers for each atom which will show 
               which atoms are closer to the atom we are making the rank from.
      - group: List that classifies the atoms in groups depending on connectivity
      to later on make different multiple libraries.
    
|
Description**:
Search for the core atom wich maximes
the number of sidechains.



atom which will be the center of the core
assign: List of atoms with numbers assigned in order to cluster them
rank:  list of numbers for each atom which will show
which atoms are closer to the atom we are making the rank from.
group: List that classifies the atoms in groups depending on connectivity
to later on make different multiple libraries.
| Description ** : Search for the core atom wich maximes the number of sidechains . atom which will be the center of the core assign : List of atoms with numbers assigned in order to cluster them rank : list of numbers for each atom which will show which atoms are closer to the atom we are making the rank from . group : List that classifies the atoms in groups depending on connectivity to later on make different multiple libraries .
def FindCore_GetCoreAtom(tors, bonds, natoms, user_core_atom, back_tors, use_mult_lib,debug=False):
    assign = assign_ligand_groups(tors, bonds, natoms)
    if debug:
        print(' -- ligand groups assigned.')
    if (user_core_atom > 0):
        print(' -- r')
        core_atom = user_core_atom - 1
    else:
        min_rank = 10000
        core_atom = -1
        for atom_num in range(natoms):
            rank = assign_rank(bonds, assign, atom_num)
            if debug:
                print(' -- rank assigned')
            [start_atom, num_core] = get_start_atom(tors + back_tors, rank)
            if (max_value(rank) < min_rank and start_atom >= 0):
                core_atom = atom_num
                min_rank = max_value(rank)
    if debug:
        print(' -- else finished')
    rank = assign_rank(bonds, assign, core_atom)
    if debug:
        print(' -- ranks assigned')
    if (use_mult_lib):
        group = assign_group(bonds, rank)
    else:
        group = []
        for i in range(natoms):
            group.append(0)
    return core_atom, assign, rank, group
def FindCore_GetCoreAtom ( tors , bonds , natoms , user_core_atom , back_tors , use_mult_lib , debug = False ) : assign = assign_ligand_groups ( tors , bonds , natoms ) if debug : print ( ' -- ligand groups assigned.' ) if ( user_core_atom > 0 ) : print ( ' -- r' ) core_atom = user_core_atom - 1 else : min_rank = 10000 core_atom = - 1 for atom_num in range ( natoms ) : rank = assign_rank ( bonds , assign , atom_num ) if debug : print ( ' -- rank assigned' ) [ start_atom , num_core ] = get_start_atom ( tors + back_tors , rank ) if ( max_value ( rank ) < min_rank and start_atom >= 0 ) : core_atom = atom_num min_rank = max_value ( rank ) if debug : print ( ' -- else finished' ) rank = assign_rank ( bonds , assign , core_atom ) if debug : print ( ' -- ranks assigned' ) if ( use_mult_lib ) : group = assign_group ( bonds , rank ) else : group = [ ] for i in range ( natoms ) : group . append ( 0 ) return core_atom , assign , rank , group
|
Description**:
Search for the core atom wich maximes
the number of sidechains.
| Description ** : Search for the core atom wich maximes the number of sidechains .
"""
    |
    **Description**: 
    Search for the core atom wich maximes
    the number of sidechains.

    **Input:**
      - tors: Atoms with torsions
      - bonds: connectivity
      - natoms: number of atoms of the ligand
      - user_core_atom: predefined user core atom
      - back_tors: user backbone atoms with torsion
      - use_mult_lib: User decision to use or not multiples libraries.

    **Ouput:**
      - core_atom: atom which will be the center of the core
      - assign: List of atoms with numbers assigned in order to cluster them
      - rank:  list of numbers for each atom which will show 
               which atoms are closer to the atom we are making the rank from.
      - group: List that classifies the atoms in groups depending on connectivity
      to later on make different multiple libraries.
    """ # Split into sections not seperated by rotatable bonds # print ' -- here3' # print bonds, assign, atom_num # mass = find_mass_names(atom_names) #    group = find_largest_ligand_group(assign,mass)  #    out_names = convert_num_to_name(group,atom_names)
tors
bonds
natoms
user_core_atom
back_tors
use_mult_lib
debug