Révision f3004731 modules/isolated.py

b/modules/isolated.py
20 20
logger = logging.getLogger('DockOnSurf')
21 21

  
22 22

  
23
def confs_to_mol_list(mol: Chem.rdchem.Mol):
24
    """Converts the conformers inside a rdkit mol object to a list of
25
    separate mol objects.
26

  
27
    @param mol: rdkit mol object containing at least one conformer.
28
    @return: list of separate mol objects.
29
    """
30
    return [Chem.MolFromMolBlock(Chem.MolToMolBlock(mol, confId=conf.GetId()))
31
            for conf in mol.GetConformers()]
32

  
33

  
34 23
def remove_C_linked_Hs(mol: Chem.rdchem.Mol):
35 24
    """Removes hydrogen atoms bonded to a carbon atom from a rdkit mol object.
36 25

  
......
180 169
    @param inp_vars: Calculation parameters from input file.
181 170
    @return:
182 171
    """
183
    from modules.formats import adapt_format
172
    from modules.formats import adapt_format, confs_to_mol_list, \
173
        rdkit_mol_to_ase_atoms
184 174
    from modules.clustering import clustering
185 175
    from modules.calculation import run_calc
186 176

  
......
194 184
    rmsd_mtx = get_rmsd(confs)
195 185
    confs_moi = get_moments_of_inertia(confs)
196 186
    exemplars = clustering(rmsd_mtx)
197
    run_calc('isolated', inp_vars, confs=confs, exemplars=exemplars)
187
    mol_list = confs_to_mol_list(confs, exemplars)
188
    ase_atms_list = [rdkit_mol_to_ase_atoms(mol) for mol in mol_list]
189
    run_calc('isolated', inp_vars, ase_atms_list)
198 190

  
199 191
    if 'moi' in inp_vars['cluster_magns']:
200 192
        confs_moi = get_moments_of_inertia(confs)

Formats disponibles : Unified diff