Révision 4e82c425 modules/isolated.py

b/modules/isolated.py
3 3
functions:
4 4
remove_C_linked_Hs: Removes hydrogens bonded to a carbon atom from a molecule.
5 5
gen_confs: Generate a number of conformers in random orientations.
6
get_rmsd: Gets the rmsd matrix of the conformers in a rdkit mol object.
7 6
get_moments_of_inertia: Computes moments of inertia of the given conformers.
8
mmff_opt_confs: Optimizes the geometry of the given conformers and returns the
7
get_moments_of_inertia: Computes the moments of inertia of the given conformers.
8
pre_opt_confs: Optimizes the geometry of the given conformers and returns the
9 9
    new mol object and the energies of its conformers.
10 10
run_isolated: directs the execution of functions to achieve the goal
11 11
"""
......
64 64

  
65 65

  
66 66
def get_moments_of_inertia(mol: Chem.rdchem.Mol):
67
    """Computes the moments of inertia of the given conformers
67
    """Computes the moments of inertia of the given conformers.
68 68

  
69 69
    @param mol: rdkit mol object of the relevant molecule.
70 70
    @return numpy array 2D: The inner array contains the moments of inertia for
......
144 144
    from modules.refinement import select_stable_confs
145 145

  
146 146
    logger.info('Carrying out procedures for the isolated molecule.')
147
    # Read the molecule
147 148
    rd_mol = adapt_format('rdkit', inp_vars['molec_file'],
148 149
                          inp_vars['special_atoms'])
150
    # Generate conformers
149 151
    confs = gen_confs(rd_mol, inp_vars['num_conformers'])
152
    # Pre-optimizes conformers
150 153
    if inp_vars['pre_opt']:
151 154
        confs, confs_ener = pre_opt_confs(confs, inp_vars['pre_opt'])
152 155
    else:
153 156
        confs_ener = pre_opt_confs(confs, max_iters=0)
154 157
    conf_list = confs_to_mol_list(confs)
158
    # Calculates RMSD matrix of the conformers
155 159
    rmsd_mtx = get_rmsd(conf_list)
156 160
    confs_moi = get_moments_of_inertia(confs)
161
    # Clusters the conformers and selects a representative
157 162
    exemplars = clustering(rmsd_mtx)
158 163
    mol_list = confs_to_mol_list(confs, exemplars)
159 164
    ase_atms_list = [rdkit_mol_to_ase_atoms(mol) for mol in mol_list]
......
162 167
                  "dockonsurf.inp"
163 168
        logger.error(err_msg)
164 169
        raise ValueError(err_msg)
170
    # Runs the jobs.
165 171
    run_calc('isolated', inp_vars, ase_atms_list)
166 172
    logger.info("Finished the procedures for the isolated molecule section. ")
167 173
    if inp_vars["batch_q_sys"]:

Formats disponibles : Unified diff