Exemplo n.º 1
0
def prep_mol_ecfp4(aemol):
    aemol.get_bonds()
    aemol.get_path_lengths()
    get_coupling_types(aemol)
    aemol.atom_properties['ecfp4'] = aemol.mol_properties['ecfp4']

    return aemol
Exemplo n.º 2
0
def prep_mol(aemol):

    aemol.get_bonds()
    aemol.get_path_lengths()
    get_coupling_types(aemol)

    return aemol
Exemplo n.º 3
0
def test_prop_tofile():
    test_mol = 'to_file_pyb_test'
    test_mol = aemol(test_mol)
    ref_xyz = 'tests/test_mols/qm9_1.nmredata.sdf'
    assert os.path.isfile(ref_xyz)
    test_mol.from_file_pyb(ref_xyz, 'sdf')
    test_mol.from_pybel(test_mol.pybmol)
    test_mol.get_bonds()
    test_mol.get_path_lengths()
    get_coupling_types(test_mol)



    atoms = len(test_mol.structure['types'])
    test_mol.pair_properties['coupling'] = np.random.randn(atoms, atoms)
    test_mol.atom_properties['shift'] = np.random.randn(atoms)

    check1 = test_mol.pair_properties['coupling']
    check2 = test_mol.atom_properties['shift']

    test_mol.prop_tofile('test.nmredata.sdf', 'nmr', 'nmredata')

    checkmol = aemol('test')
    checkmol.from_file_pyb('test.nmredata.sdf', 'sdf')
    checkmol.prop_fromfile('test.nmredata.sdf', 'nmr', 'nmredata')

    os.remove('test.nmredata.sdf')
Exemplo n.º 4
0
def prep_mol_mulliken(aemol, mc_file="", mc_format=""):
    aemol.get_bonds()
    aemol.get_path_lengths()
    get_coupling_types(aemol)
    if os.path.isfile(mc_file):
        aemol.prop_from_file(mc_file, mc_format, 'mc')
    else:
        print('Setting fake mulliken charge values', mc_file)
        aemol.atom_properties['mull_chg'] = np.zeros(len(
            aemol.structure['types']),
                                                     dtype=np.float64)

    return aemol
Exemplo n.º 5
0
def prep_mol_ic50(aemol, ic50_file="", ic50_type=""):
    aemol.get_bonds()
    aemol.get_path_lengths()
    get_coupling_types(aemol)
    if os.path.isfile(ic50_file):
        aemol.prop_from_file(ic50_file, ic50_type, 'ic50')
        aemol.atom_properties['ic50'] = np.full(len(aemol.structure['types']),
                                                aemol.mol_properties['ic50'],
                                                dtype=np.float64)
    else:
        print('Setting fake ic50 values', ic50_file)
        aemol.atom_properties['ic50'] = np.zeros(len(aemol.structure['types']),
                                                 dtype=np.float64)

    return aemol
Exemplo n.º 6
0
def prep_mol_nmr(aemol, nmr_file="", nmr_type=""):

    aemol.get_bonds()
    aemol.get_path_lengths()
    get_coupling_types(aemol)
    if os.path.isfile(nmr_file):
        aemol.prop_from_file(nmr_file, 'nmr', nmr_type)
    else:
        aemol.atom_properties['shift'] = np.zeros(len(
            aemol.structure['types']),
                                                  dtype=np.float64)
        aemol.pair_properties['coupling'] = np.zeros(
            (len(aemol.structure['types']), len(aemol.structure['types'])),
            dtype=np.float64)
    return aemol
Exemplo n.º 7
0
        amol = aemol(id)
        #amol.from_file(file, ftype='g09')
        amol.from_file_pyb(file, ftype='log')
        opt_file = f'OPT/{str(id)}.log'
        amol.prop_from_file(opt_file, 'g09', 'scf')

        assert amol.mol_properties['energy'] < 1000000, print(
            amol.mol_properties)

        amol.prop_from_file(file, 'g09', 'nmr')
        #amol.prop_fromfile(file, 'nmredata', 'nmr')

        amol.get_bonds()
        amol.get_path_lengths()
        get_coupling_types(amol)
        scale_chemical_shifts(amol)

        write_nmredata(outfile, amol)

        amols.append(amol)
    except:
        print('Bad file, ID', id)
        file = 'NMR/' + file
        with open('NMR_RESUB_ARRAY.txt', 'a') as f:
            print(file, file=f)

eops.calc_pops(amols)

with open('energies.txt', 'w') as f:
    string = "{0:<10s}\t{1:<10s}\t{2:<10s}".format("Molid", "Energy", "Pop")