Exemple #1
0
def obtain_jobinfo(xyzfile, frame=-1, txt=False):
    init_mol = read_geometry_to_mol(xyzfile, frame=frame, txt=txt)
    natoms = init_mol.natoms
    metal_ind = init_mol.findMetal()[0]
    liglist, ligdents, ligcons = ligand_breakdown(init_mol, flag_loose=False, BondedOct=False)
    # print(liglist)
    # print(ligdents)
    # print(ligcons)
    ### Old version
    # _, _, _, _, _, _, ax_con, eq_con, _ = ligand_assign(init_mol, liglist,
    #                                                     ligdents, ligcons)
    # print("ax_con: ", ax_con)
    # print("eq_con: ", eq_con)
    # ax_con = np.squeeze(np.array(ax_con).reshape(2, -1))
    # eq_con = np.squeeze(np.array(eq_con).reshape(4, -1))
    _, _, _, _, _, _, _ax_con, _eq_con, _ = ligand_assign_consistent(init_mol, liglist,
                                                                     ligdents, ligcons)
    print(("ax_con: ", _ax_con))
    print(("eq_con: ", _eq_con))
    job_info = {}
    info_list = ['ax_con', 'eq_con', 'ax_con_sym', 'eq_con_sym', 'catoms', 'natoms', 'metal_ind']
    eq_con, ax_con = [], []
    for x in _eq_con:
        eq_con += x
    for x in _ax_con:
        ax_con += x
    ax_con_sym = [init_mol.atoms[x].sym for x in ax_con]
    eq_con_sym = [init_mol.atoms[x].sym for x in eq_con]
    catoms = [x for x in eq_con] + [x for x in ax_con]
    for info in info_list:
        job_info.update({info: locals()[info]})
    return job_info
def getLigFormulae(mol):
    ## This function gets
    ## ax and equitorial
    ## ligand names for octahedral complexes
    axnames = []
    eqnames = []
    liglist, ligdents, ligcons = ligand_breakdown(mol)
    ax_ligand_list, eq_ligand_list, ax_natoms_list, eq_natoms_list, ax_con_int_list, eq_con_int_list, ax_con_list, eq_con_list, built_ligand_list = ligand_assign_consistent(
        mol, liglist, ligdents, ligcons, False, False)
    for axl in ax_ligand_list:
        axnames.append(axl.mol.make_formula())
    for eql in eq_ligand_list:
        eqnames.append(eql.mol.make_formula())
    return axnames, eqnames
def getOctBondDistances(mol):
    ## This function gets
    ## ax and equitorial
    ## min and max bond lengths
    liglist, ligdents, ligcons = ligand_breakdown(mol)
    ax_ligand_list, eq_ligand_list, ax_natoms_list, eq_natoms_list, ax_con_int_list, eq_con_int_list, ax_con_list, eq_con_list, built_ligand_list = ligand_assign_consistent(
        mol, liglist, ligdents, ligcons, False, False)
    ax_dist = list()
    eq_dist = list()
    for ax_ligs in ax_con_list:
        tempList = list()
        for conatms in ax_ligs:
            tempList.append(
                distance(
                    mol.getAtom(mol.findMetal()[0]).coords(),
                    mol.getAtom(conatms).coords()))
        ax_dist.append(tempList)
    for eq_ligs in eq_con_list:
        tempList = list()
        for conatms in eq_ligs:
            tempList.append(
                distance(
                    mol.getAtom(mol.findMetal()[0]).coords(),
                    mol.getAtom(conatms).coords()))
        eq_dist.append(tempList)
    return ax_dist, eq_dist