molSimplify 1.7.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- docs/source/conf.py +224 -0
- molSimplify/Classes/__init__.py +6 -0
- molSimplify/Classes/atom3D.py +235 -0
- molSimplify/Classes/dft_obs.py +130 -0
- molSimplify/Classes/globalvars.py +827 -0
- molSimplify/Classes/helpers.py +161 -0
- molSimplify/Classes/ligand.py +2330 -0
- molSimplify/Classes/mGUI.py +2493 -0
- molSimplify/Classes/mWidgets.py +438 -0
- molSimplify/Classes/miniGUI.py +41 -0
- molSimplify/Classes/mol2D.py +260 -0
- molSimplify/Classes/mol3D.py +5846 -0
- molSimplify/Classes/monomer3D.py +253 -0
- molSimplify/Classes/partialcharges.py +226 -0
- molSimplify/Classes/protein3D.py +1178 -0
- molSimplify/Classes/rundiag.py +151 -0
- molSimplify/Data/ML.dat +212 -0
- molSimplify/Data/MLS_FSR_for_inter.dat +23 -0
- molSimplify/Data/MLS_FSR_for_inter2.dat +23 -0
- molSimplify/Data/MLS_angle_for_click.dat +8 -0
- molSimplify/Data/MLS_angle_for_inter.dat +23 -0
- molSimplify/Data/MLS_angle_for_inter2.dat +48 -0
- molSimplify/Data/MLS_angle_for_intra.dat +10 -0
- molSimplify/Data/MLS_angle_for_intra2.dat +6 -0
- molSimplify/Data/MLS_angle_for_oa.dat +18 -0
- molSimplify/Data/ML_FSR_for_inter.dat +112 -0
- molSimplify/Data/ML_FSR_for_inter2.dat +110 -0
- molSimplify/Data/ML_bond_for_cat.dat +8 -0
- molSimplify/Data/ML_bond_for_click.dat +8 -0
- molSimplify/Data/ML_bond_for_inter.dat +48 -0
- molSimplify/Data/ML_bond_for_inter2.dat +48 -0
- molSimplify/Data/ML_bond_for_intra.dat +10 -0
- molSimplify/Data/ML_bond_for_intra2.dat +6 -0
- molSimplify/Data/ML_bond_for_oa.dat +18 -0
- molSimplify/Data/bp1.dat +21 -0
- molSimplify/Data/li.dat +3 -0
- molSimplify/Data/no.dat +2 -0
- molSimplify/Data/oct.dat +7 -0
- molSimplify/Data/pbp.dat +8 -0
- molSimplify/Data/spy.dat +6 -0
- molSimplify/Data/sqap.dat +9 -0
- molSimplify/Data/sqp.dat +5 -0
- molSimplify/Data/tbp.dat +6 -0
- molSimplify/Data/tdhd.dat +9 -0
- molSimplify/Data/thd.dat +5 -0
- molSimplify/Data/tpl.dat +4 -0
- molSimplify/Data/tpr.dat +7 -0
- molSimplify/Informatics/HFXsensitivity/__init__.py +0 -0
- molSimplify/Informatics/HFXsensitivity/measure_HFX_sensitivity_oxo_hat_reb_rel.py +443 -0
- molSimplify/Informatics/HFXsensitivity/measure_HFX_stable.py +346 -0
- molSimplify/Informatics/MOF/Linker_rotation.py +179 -0
- molSimplify/Informatics/MOF/MOF_descriptors.py +1299 -0
- molSimplify/Informatics/MOF/MOF_descriptors_alternate_functional.py +589 -0
- molSimplify/Informatics/MOF/MOF_functionalizer.py +1648 -0
- molSimplify/Informatics/MOF/PBC_functions.py +1347 -0
- molSimplify/Informatics/MOF/__init__.py +0 -0
- molSimplify/Informatics/MOF/atomic.py +267 -0
- molSimplify/Informatics/MOF/cluster_extraction.py +388 -0
- molSimplify/Informatics/MOF/fragment_MOFs_for_pormake.py +895 -0
- molSimplify/Informatics/MOF/monofunctionalized_BDC/index_information.py +10 -0
- molSimplify/Informatics/Mol2Parser.py +46 -0
- molSimplify/Informatics/RACassemble.py +408 -0
- molSimplify/Informatics/__init__.py +0 -0
- molSimplify/Informatics/active_learning/__init__.py +0 -0
- molSimplify/Informatics/active_learning/expected_improvement.py +269 -0
- molSimplify/Informatics/autocorrelation.py +1930 -0
- molSimplify/Informatics/clean_autocorrelation.py +778 -0
- molSimplify/Informatics/coulomb_analyze.py +67 -0
- molSimplify/Informatics/decoration_manager.py +193 -0
- molSimplify/Informatics/geo_analyze.py +88 -0
- molSimplify/Informatics/geometrics.py +56 -0
- molSimplify/Informatics/graph_analyze.py +163 -0
- molSimplify/Informatics/graph_racs.py +288 -0
- molSimplify/Informatics/jupyter_vis.py +172 -0
- molSimplify/Informatics/lacRACAssemble.py +2192 -0
- molSimplify/Informatics/lacRACAssemble_bisdithiolenes.py +236 -0
- molSimplify/Informatics/misc_descriptors.py +198 -0
- molSimplify/Informatics/organic_fingerprints.py +61 -0
- molSimplify/Informatics/partialcharges.py +345 -0
- molSimplify/Informatics/protein/activesite.py +53 -0
- molSimplify/Informatics/protein/pymol_add_hs.py +33 -0
- molSimplify/Informatics/rac155_geo.py +48 -0
- molSimplify/Ligands/(1_methylbenzimidazol_2_yl)pyridine.xyz +45 -0
- molSimplify/Ligands/1-4-dimethyl-1-2-3-triazole.xyz +15 -0
- molSimplify/Ligands/12crown4.mol +62 -0
- molSimplify/Ligands/Antipyrine.mol +58 -0
- molSimplify/Ligands/BPAbipy.mol +106 -0
- molSimplify/Ligands/Hpyrrole.mol +26 -0
- molSimplify/Ligands/N-quinolinylbutyramidate.xyz +31 -0
- molSimplify/Ligands/N-quinolinylmethylmethinylacetamidate.xyz +30 -0
- molSimplify/Ligands/NMe2_-1.xyz +11 -0
- molSimplify/Ligands/PCy3.mol +111 -0
- molSimplify/Ligands/PMe3.xyz +15 -0
- molSimplify/Ligands/PPh3.mol +76 -0
- molSimplify/Ligands/Propyphenazone.mol +77 -0
- molSimplify/Ligands/acac.mol +33 -0
- molSimplify/Ligands/acacen.mol +76 -0
- molSimplify/Ligands/acetate.smi +1 -0
- molSimplify/Ligands/acetate.xyz +9 -0
- molSimplify/Ligands/aceticacidbipyridine.mol +70 -0
- molSimplify/Ligands/acetonitrile.mol +17 -0
- molSimplify/Ligands/alanine.mol +30 -0
- molSimplify/Ligands/alphabetizer.py +21 -0
- molSimplify/Ligands/amine.mol +11 -0
- molSimplify/Ligands/ammonia.mol +12 -0
- molSimplify/Ligands/arginine.mol +58 -0
- molSimplify/Ligands/asparagine.mol +38 -0
- molSimplify/Ligands/aspartic_acid.mol +35 -0
- molSimplify/Ligands/azide.mol +11 -0
- molSimplify/Ligands/benzene.mol +28 -0
- molSimplify/Ligands/benzene_pi.mol +30 -0
- molSimplify/Ligands/benzenedithiol.mol +30 -0
- molSimplify/Ligands/benzenethiol.mol +30 -0
- molSimplify/Ligands/benzylisocy.mol +38 -0
- molSimplify/Ligands/bidiazine.mol +42 -0
- molSimplify/Ligands/bidiazole.mol +38 -0
- molSimplify/Ligands/bifuran.mol +38 -0
- molSimplify/Ligands/bihydrodiazine.mol +58 -0
- molSimplify/Ligands/bihydrodiazole.mol +46 -0
- molSimplify/Ligands/bihydrooxazine.mol +54 -0
- molSimplify/Ligands/bihydrooxazole.mol +42 -0
- molSimplify/Ligands/bihydrothiazine.mol +54 -0
- molSimplify/Ligands/bihydrothiazole.mol +42 -0
- molSimplify/Ligands/biimidazole.mol +38 -0
- molSimplify/Ligands/bioxazole.mol +34 -0
- molSimplify/Ligands/bipy.mol +46 -0
- molSimplify/Ligands/bipyrazine.xyz +20 -0
- molSimplify/Ligands/bipyrimidine.mol +42 -0
- molSimplify/Ligands/bipyrrole.mol +42 -0
- molSimplify/Ligands/bisnapthyridylpyridine.mol +111 -0
- molSimplify/Ligands/bithiazole.mol +34 -0
- molSimplify/Ligands/bromide.mol +7 -0
- molSimplify/Ligands/bromide.smi +1 -0
- molSimplify/Ligands/c2.mol +9 -0
- molSimplify/Ligands/caprolactone.mol +41 -0
- molSimplify/Ligands/carbonyl.mol +8 -0
- molSimplify/Ligands/carboxyl.mol +13 -0
- molSimplify/Ligands/cat.mol +30 -0
- molSimplify/Ligands/chloride.mol +7 -0
- molSimplify/Ligands/chloride.smi +1 -0
- molSimplify/Ligands/chloropyridine.mol +27 -0
- molSimplify/Ligands/co2.mol +10 -0
- molSimplify/Ligands/corrolazine.mol +72 -0
- molSimplify/Ligands/cs.mol +8 -0
- molSimplify/Ligands/cyanate.xyz +5 -0
- molSimplify/Ligands/cyanide.mol +9 -0
- molSimplify/Ligands/cyanoaceticporphyrin.mol +114 -0
- molSimplify/Ligands/cyanopyridine.mol +29 -0
- molSimplify/Ligands/cyclam.mol +81 -0
- molSimplify/Ligands/cyclen.mol +69 -0
- molSimplify/Ligands/cyclopentadienyl.mol +26 -0
- molSimplify/Ligands/cysteine.mol +32 -0
- molSimplify/Ligands/diaminomethyl.mol +19 -0
- molSimplify/Ligands/diazine.mol +25 -0
- molSimplify/Ligands/diazole.mol +23 -0
- molSimplify/Ligands/dicyanamide.mol +15 -0
- molSimplify/Ligands/dihydrofuran.mol +27 -0
- molSimplify/Ligands/dmap.xyz +35 -0
- molSimplify/Ligands/dmf.mol +28 -0
- molSimplify/Ligands/dmi.mol +41 -0
- molSimplify/Ligands/dmpe.mol +52 -0
- molSimplify/Ligands/dpmu.mol +47 -0
- molSimplify/Ligands/dppe.mol +112 -0
- molSimplify/Ligands/edta.mol +69 -0
- molSimplify/Ligands/en.mol +28 -0
- molSimplify/Ligands/ethanethiol.mol +21 -0
- molSimplify/Ligands/ethanolamine.mol +26 -0
- molSimplify/Ligands/ethbipy.mol +70 -0
- molSimplify/Ligands/ethyl.mol +19 -0
- molSimplify/Ligands/ethylamine.mol +24 -0
- molSimplify/Ligands/ethylene.mol +16 -0
- molSimplify/Ligands/ethylesteracac.mol +57 -0
- molSimplify/Ligands/fluoride.mol +7 -0
- molSimplify/Ligands/fluoride.smi +1 -0
- molSimplify/Ligands/formaldehyde.mol +12 -0
- molSimplify/Ligands/formamidate.xyz +8 -0
- molSimplify/Ligands/formate.xyz +6 -0
- molSimplify/Ligands/furan.mol +23 -0
- molSimplify/Ligands/glutamic_acid.mol +42 -0
- molSimplify/Ligands/glutamine.mol +44 -0
- molSimplify/Ligands/glycinate.mol +23 -0
- molSimplify/Ligands/glycine.mol +24 -0
- molSimplify/Ligands/h2s.mol +10 -0
- molSimplify/Ligands/helium.mol +6 -0
- molSimplify/Ligands/histidine.mol +45 -0
- molSimplify/Ligands/hmpa.mol +62 -0
- molSimplify/Ligands/hs-.mol +9 -0
- molSimplify/Ligands/hydride.mol +7 -0
- molSimplify/Ligands/hydrocarboxyacetylide.xyz +8 -0
- molSimplify/Ligands/hydrocyanide.mol +10 -0
- molSimplify/Ligands/hydrodiazine.mol +33 -0
- molSimplify/Ligands/hydrodiazole.mol +27 -0
- molSimplify/Ligands/hydrogensulfide.mol +10 -0
- molSimplify/Ligands/hydroisocyanide.mol +11 -0
- molSimplify/Ligands/hydrooxazine.mol +31 -0
- molSimplify/Ligands/hydrooxazole.mol +25 -0
- molSimplify/Ligands/hydrothiazine.mol +31 -0
- molSimplify/Ligands/hydrothiazole.mol +25 -0
- molSimplify/Ligands/hydroxyl.mol +9 -0
- molSimplify/Ligands/imidazole.mol +23 -0
- molSimplify/Ligands/imidazolidinone.mol +29 -0
- molSimplify/Ligands/imine.mol +13 -0
- molSimplify/Ligands/iminodiacetic.mol +33 -0
- molSimplify/Ligands/iodide.mol +7 -0
- molSimplify/Ligands/iodobenzene.xyz +14 -0
- molSimplify/Ligands/isoleucine.mol +48 -0
- molSimplify/Ligands/isothiocyanate.mol +11 -0
- molSimplify/Ligands/leucine.mol +48 -0
- molSimplify/Ligands/ligands.dict +257 -0
- molSimplify/Ligands/lysine.mol +54 -0
- molSimplify/Ligands/mebenzenedithiol.mol +36 -0
- molSimplify/Ligands/mebim_py.xyz +29 -0
- molSimplify/Ligands/mebim_pz.xyz +28 -0
- molSimplify/Ligands/mebipy.mol +58 -0
- molSimplify/Ligands/mecat.mol +36 -0
- molSimplify/Ligands/methanal.mol +11 -0
- molSimplify/Ligands/methanethiol.mol +15 -0
- molSimplify/Ligands/methanol.mol +16 -0
- molSimplify/Ligands/methionine.mol +44 -0
- molSimplify/Ligands/methyl.mol +13 -0
- molSimplify/Ligands/methylacetylide.xyz +8 -0
- molSimplify/Ligands/methylamine.mol +19 -0
- molSimplify/Ligands/methylazide.xyz +9 -0
- molSimplify/Ligands/methylisocy.mol +17 -0
- molSimplify/Ligands/methylpyridine.mol +33 -0
- molSimplify/Ligands/n2.mol +8 -0
- molSimplify/Ligands/n4py.xyz +51 -0
- molSimplify/Ligands/nch.mol +10 -0
- molSimplify/Ligands/nco-.mol +11 -0
- molSimplify/Ligands/nethanolamine.mol +26 -0
- molSimplify/Ligands/nitrate.mol +14 -0
- molSimplify/Ligands/nitrite.mol +11 -0
- molSimplify/Ligands/nitro.mol +11 -0
- molSimplify/Ligands/nitrobipy.mol +54 -0
- molSimplify/Ligands/nitroso.mol +8 -0
- molSimplify/Ligands/nme3.mol +30 -0
- molSimplify/Ligands/no-.mol +10 -0
- molSimplify/Ligands/no2-.mol +11 -0
- molSimplify/Ligands/noxygen.mol +8 -0
- molSimplify/Ligands/ns-.mol +10 -0
- molSimplify/Ligands/o-pyridylbenzene.xyz +23 -0
- molSimplify/Ligands/o-pyridylphenylanion.xyz +22 -0
- molSimplify/Ligands/o2-.mol +9 -0
- molSimplify/Ligands/o2.xyz +4 -0
- molSimplify/Ligands/och2.mol +12 -0
- molSimplify/Ligands/oethanolamine.mol +26 -0
- molSimplify/Ligands/ome2.mol +22 -0
- molSimplify/Ligands/ooh.xyz +5 -0
- molSimplify/Ligands/oxalate.mol +17 -0
- molSimplify/Ligands/oxalate.smi +1 -0
- molSimplify/Ligands/oxygen.mol +7 -0
- molSimplify/Ligands/pentacyanocyclopentadienide.mol +36 -0
- molSimplify/Ligands/ph2-.mol +11 -0
- molSimplify/Ligands/ph3.mol +12 -0
- molSimplify/Ligands/phen.mol +51 -0
- molSimplify/Ligands/phenacac.mol +63 -0
- molSimplify/Ligands/phenalalanine.mol +51 -0
- molSimplify/Ligands/phendione.mol +51 -0
- molSimplify/Ligands/phenphen.mol +75 -0
- molSimplify/Ligands/phenylbenzoxazole.mol +54 -0
- molSimplify/Ligands/phenylcyc.mol +99 -0
- molSimplify/Ligands/phenylenediamine.mol +37 -0
- molSimplify/Ligands/phenylisocy.mol +32 -0
- molSimplify/Ligands/phosacidbipy.mol +66 -0
- molSimplify/Ligands/phosphine.mol +13 -0
- molSimplify/Ligands/phosphorine.mol +27 -0
- molSimplify/Ligands/phosphorustrifluoride.mol +12 -0
- molSimplify/Ligands/phthalocyanine.mol +126 -0
- molSimplify/Ligands/pme3o.mol +32 -0
- molSimplify/Ligands/porphyrin.mol +82 -0
- molSimplify/Ligands/pph3o.mol +77 -0
- molSimplify/Ligands/proline.mol +39 -0
- molSimplify/Ligands/propdiol.mol +21 -0
- molSimplify/Ligands/propylene.mol +23 -0
- molSimplify/Ligands/pyridine.mol +27 -0
- molSimplify/Ligands/pyrimidone.mol +27 -0
- molSimplify/Ligands/pyrrole.mol +24 -0
- molSimplify/Ligands/quinoxalinedithiol.mol +39 -0
- molSimplify/Ligands/s2-.mol +9 -0
- molSimplify/Ligands/salen.mol +75 -0
- molSimplify/Ligands/salphen.mol +84 -0
- molSimplify/Ligands/serine.mol +32 -0
- molSimplify/Ligands/simple_ligands.dict +14 -0
- molSimplify/Ligands/sulfacidbipy.mol +63 -0
- molSimplify/Ligands/tbucat.mol +54 -0
- molSimplify/Ligands/tbuphisocy.mol +56 -0
- molSimplify/Ligands/tbutylcyclen.mol +166 -0
- molSimplify/Ligands/tbutylisocy.mol +35 -0
- molSimplify/Ligands/tbutylthiol.mol +33 -0
- molSimplify/Ligands/tcnoet.mol +43 -0
- molSimplify/Ligands/tcnoetOH.mol +45 -0
- molSimplify/Ligands/terpy.mol +65 -0
- molSimplify/Ligands/tetrahydrofuran.mol +31 -0
- molSimplify/Ligands/thiane.mol +37 -0
- molSimplify/Ligands/thiazole.mol +21 -0
- molSimplify/Ligands/thiocyanate.mol +11 -0
- molSimplify/Ligands/thiol.mol +9 -0
- molSimplify/Ligands/thiophene.mol +23 -0
- molSimplify/Ligands/thiopyridine.mol +29 -0
- molSimplify/Ligands/threonine.mol +38 -0
- molSimplify/Ligands/tpp.mol +165 -0
- molSimplify/Ligands/tricyanomethyl.mol +19 -0
- molSimplify/Ligands/trifluoromethyl.mol +13 -0
- molSimplify/Ligands/tryptophan.mol +60 -0
- molSimplify/Ligands/tyrosine.mol +53 -0
- molSimplify/Ligands/uthiol.mol +11 -0
- molSimplify/Ligands/uthiolme2.mol +23 -0
- molSimplify/Ligands/valine.mol +42 -0
- molSimplify/Ligands/water.mol +10 -0
- molSimplify/Ligands/x.mol +6 -0
- molSimplify/Scripts/__init__.py +0 -0
- molSimplify/Scripts/addtodb.py +308 -0
- molSimplify/Scripts/cellbuilder.py +1592 -0
- molSimplify/Scripts/cellbuilder_tools.py +701 -0
- molSimplify/Scripts/chains.py +342 -0
- molSimplify/Scripts/convert_2to3.py +23 -0
- molSimplify/Scripts/dbinteract.py +631 -0
- molSimplify/Scripts/distgeom.py +617 -0
- molSimplify/Scripts/findcorrelations.py +287 -0
- molSimplify/Scripts/generator.py +267 -0
- molSimplify/Scripts/geometry.py +1224 -0
- molSimplify/Scripts/grabguivars.py +845 -0
- molSimplify/Scripts/in_b3lyp_usetc.py +141 -0
- molSimplify/Scripts/inparse.py +1673 -0
- molSimplify/Scripts/io.py +1149 -0
- molSimplify/Scripts/isomers.py +415 -0
- molSimplify/Scripts/jobgen.py +247 -0
- molSimplify/Scripts/krr_prep.py +1262 -0
- molSimplify/Scripts/molSimplify_io.py +18 -0
- molSimplify/Scripts/molden2psi4wfn.py +166 -0
- molSimplify/Scripts/namegen.py +32 -0
- molSimplify/Scripts/nn_prep.py +561 -0
- molSimplify/Scripts/oct_check_mols.py +782 -0
- molSimplify/Scripts/periodic_QE.py +97 -0
- molSimplify/Scripts/postmold.py +304 -0
- molSimplify/Scripts/postmwfn.py +709 -0
- molSimplify/Scripts/postparse.py +488 -0
- molSimplify/Scripts/postproc.py +139 -0
- molSimplify/Scripts/qcgen.py +1450 -0
- molSimplify/Scripts/rmsd.py +489 -0
- molSimplify/Scripts/rungen.py +670 -0
- molSimplify/Scripts/structgen.py +3040 -0
- molSimplify/Scripts/tf_nn_prep.py +894 -0
- molSimplify/Scripts/tsgen.py +295 -0
- molSimplify/Scripts/uq_calibration.py +69 -0
- molSimplify/__init__.py +0 -0
- molSimplify/__main__.py +197 -0
- molSimplify/icons/chemdb.png +0 -0
- molSimplify/icons/hjklogo.png +0 -0
- molSimplify/icons/icon.png +0 -0
- molSimplify/icons/logo.png +0 -0
- molSimplify/icons/logo_old.png +0 -0
- molSimplify/icons/petachem.png +0 -0
- molSimplify/icons/petachem2.png +0 -0
- molSimplify/icons/petachem_full.png +0 -0
- molSimplify/icons/pythonlogo.png +0 -0
- molSimplify/icons/sge copy.png +0 -0
- molSimplify/icons/sge.png +0 -0
- molSimplify/icons/slurm.png +0 -0
- molSimplify/icons/wft1.png +0 -0
- molSimplify/icons/wft2.png +0 -0
- molSimplify/icons/wft3.png +0 -0
- molSimplify/ml/__init__.py +0 -0
- molSimplify/ml/kernels.py +36 -0
- molSimplify/ml/layers.py +29 -0
- molSimplify/molscontrol/__init__.py +14 -0
- molSimplify/molscontrol/_version.py +521 -0
- molSimplify/molscontrol/clf_tools.py +144 -0
- molSimplify/molscontrol/data/README.md +21 -0
- molSimplify/molscontrol/data/look_and_say.dat +15 -0
- molSimplify/molscontrol/dynamic_classifier.py +514 -0
- molSimplify/molscontrol/io_tools.py +363 -0
- molSimplify/molscontrol/molscontrol.py +49 -0
- molSimplify/molscontrol/terachem/jobscript_control.sh +31 -0
- molSimplify/molscontrol/terachem/terachem_input +22 -0
- molSimplify/python_krr/X_train_TS.csv +535 -0
- molSimplify/python_krr/__init__.py +0 -0
- molSimplify/python_krr/hat2_X_mean_std.csv +3 -0
- molSimplify/python_krr/hat2_feature_names.csv +1 -0
- molSimplify/python_krr/hat2_y_mean_std.csv +2 -0
- molSimplify/python_krr/hat_X_mean_std.csv +6 -0
- molSimplify/python_krr/hat_feature_names.csv +1 -0
- molSimplify/python_krr/hat_krr_X_train.csv +5205 -0
- molSimplify/python_krr/hat_krr_dual_coef.csv +1 -0
- molSimplify/python_krr/hat_y_mean_std.csv +2 -0
- molSimplify/python_krr/sklearn_models.py +34 -0
- molSimplify/python_krr/y_train_TS.csv +535 -0
- molSimplify/python_nn/ANN.py +198 -0
- molSimplify/python_nn/__init__.py +0 -0
- molSimplify/python_nn/clf_analysis_tool.py +125 -0
- molSimplify/python_nn/dictionary_toolbox.py +49 -0
- molSimplify/python_nn/ensemble_test.py +309 -0
- molSimplify/python_nn/hs_center.csv +26 -0
- molSimplify/python_nn/hs_scale.csv +26 -0
- molSimplify/python_nn/ls_center.csv +26 -0
- molSimplify/python_nn/ls_scale.csv +26 -0
- molSimplify/python_nn/ms_hs_b1.csv +50 -0
- molSimplify/python_nn/ms_hs_b2.csv +50 -0
- molSimplify/python_nn/ms_hs_b3.csv +1 -0
- molSimplify/python_nn/ms_hs_w1.csv +50 -0
- molSimplify/python_nn/ms_hs_w2.csv +50 -0
- molSimplify/python_nn/ms_hs_w3.csv +1 -0
- molSimplify/python_nn/ms_ls_b1.csv +50 -0
- molSimplify/python_nn/ms_ls_b2.csv +50 -0
- molSimplify/python_nn/ms_ls_b3.csv +1 -0
- molSimplify/python_nn/ms_ls_w1.csv +50 -0
- molSimplify/python_nn/ms_ls_w2.csv +50 -0
- molSimplify/python_nn/ms_ls_w3.csv +1 -0
- molSimplify/python_nn/ms_slope_b1.csv +50 -0
- molSimplify/python_nn/ms_slope_b2.csv +50 -0
- molSimplify/python_nn/ms_slope_b3.csv +1 -0
- molSimplify/python_nn/ms_slope_w1.csv +50 -0
- molSimplify/python_nn/ms_slope_w2.csv +50 -0
- molSimplify/python_nn/ms_slope_w3.csv +1 -0
- molSimplify/python_nn/ms_split_b1.csv +50 -0
- molSimplify/python_nn/ms_split_b2.csv +50 -0
- molSimplify/python_nn/ms_split_b3.csv +1 -0
- molSimplify/python_nn/ms_split_w1.csv +50 -0
- molSimplify/python_nn/ms_split_w2.csv +50 -0
- molSimplify/python_nn/ms_split_w3.csv +1 -0
- molSimplify/python_nn/slope_center.csv +25 -0
- molSimplify/python_nn/slope_scale.csv +25 -0
- molSimplify/python_nn/split_center.csv +26 -0
- molSimplify/python_nn/split_scale.csv +26 -0
- molSimplify/python_nn/tf_ANN.py +762 -0
- molSimplify/python_nn/train_data.csv +1211 -0
- molSimplify/tf_nn/__init__.py +0 -0
- molSimplify/tf_nn/geo_static_clf/geo_static_clf_model.h5 +0 -0
- molSimplify/tf_nn/geo_static_clf/geo_static_clf_train_name.csv +1591 -0
- molSimplify/tf_nn/geo_static_clf/geo_static_clf_train_x.csv +2790 -0
- molSimplify/tf_nn/geo_static_clf/geo_static_clf_train_y.csv +2790 -0
- molSimplify/tf_nn/geo_static_clf/geo_static_clf_vars.csv +154 -0
- molSimplify/tf_nn/geos/hs_ii_bl_x.csv +1577 -0
- molSimplify/tf_nn/geos/hs_ii_bl_y.csv +1577 -0
- molSimplify/tf_nn/geos/hs_ii_model.h5 +0 -0
- molSimplify/tf_nn/geos/hs_ii_model.json +1 -0
- molSimplify/tf_nn/geos/hs_ii_vars.csv +154 -0
- molSimplify/tf_nn/geos/hs_iii_bl_x.csv +1659 -0
- molSimplify/tf_nn/geos/hs_iii_bl_y.csv +1659 -0
- molSimplify/tf_nn/geos/hs_iii_model.h5 +0 -0
- molSimplify/tf_nn/geos/hs_iii_model.json +1 -0
- molSimplify/tf_nn/geos/hs_iii_vars.csv +154 -0
- molSimplify/tf_nn/geos/ls_ii_bl_x.csv +1374 -0
- molSimplify/tf_nn/geos/ls_ii_bl_y.csv +1374 -0
- molSimplify/tf_nn/geos/ls_ii_model.h5 +0 -0
- molSimplify/tf_nn/geos/ls_ii_model.json +1 -0
- molSimplify/tf_nn/geos/ls_ii_vars.csv +154 -0
- molSimplify/tf_nn/geos/ls_iii_bl_x.csv +1364 -0
- molSimplify/tf_nn/geos/ls_iii_bl_y.csv +1364 -0
- molSimplify/tf_nn/geos/ls_iii_model.h5 +0 -0
- molSimplify/tf_nn/geos/ls_iii_model.json +1 -0
- molSimplify/tf_nn/geos/ls_iii_vars.csv +154 -0
- molSimplify/tf_nn/homolumo/gap_model.h5 +0 -0
- molSimplify/tf_nn/homolumo/gap_model.json +1 -0
- molSimplify/tf_nn/homolumo/gap_test_names.csv +175 -0
- molSimplify/tf_nn/homolumo/gap_test_x.csv +176 -0
- molSimplify/tf_nn/homolumo/gap_test_y.csv +176 -0
- molSimplify/tf_nn/homolumo/gap_train_names.csv +699 -0
- molSimplify/tf_nn/homolumo/gap_train_x.csv +700 -0
- molSimplify/tf_nn/homolumo/gap_train_y.csv +700 -0
- molSimplify/tf_nn/homolumo/gap_vars.csv +153 -0
- molSimplify/tf_nn/homolumo/homo_model.h5 +0 -0
- molSimplify/tf_nn/homolumo/homo_model.json +126 -0
- molSimplify/tf_nn/homolumo/homo_test_names.csv +175 -0
- molSimplify/tf_nn/homolumo/homo_test_x.csv +176 -0
- molSimplify/tf_nn/homolumo/homo_test_y.csv +176 -0
- molSimplify/tf_nn/homolumo/homo_train_names.csv +699 -0
- molSimplify/tf_nn/homolumo/homo_train_x.csv +700 -0
- molSimplify/tf_nn/homolumo/homo_train_y.csv +700 -0
- molSimplify/tf_nn/homolumo/homo_vars.csv +153 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_info.json +7 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_model.h5 +0 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_model.json +1 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_test_names.csv +143 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_test_x.csv +144 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_test_y.csv +144 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_train_names.csv +513 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_train_x.csv +514 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_train_y.csv +514 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_val_names.csv +143 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_val_x.csv +58 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_val_y.csv +58 -0
- molSimplify/tf_nn/oxoandhomo/homo_empty_vars.csv +155 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_info.json +7 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_model.h5 +0 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_model.json +1 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_test_names.csv +143 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_test_x.csv +144 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_test_y.csv +144 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_train_names.csv +513 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_train_x.csv +514 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_train_y.csv +514 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_val_names.csv +143 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_val_x.csv +58 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_val_y.csv +58 -0
- molSimplify/tf_nn/oxoandhomo/oxo20_vars.csv +154 -0
- molSimplify/tf_nn/oxocatalysis/hat_model.h5 +0 -0
- molSimplify/tf_nn/oxocatalysis/hat_model.json +1 -0
- molSimplify/tf_nn/oxocatalysis/hat_test_names.csv +419 -0
- molSimplify/tf_nn/oxocatalysis/hat_test_x.csv +420 -0
- molSimplify/tf_nn/oxocatalysis/hat_test_y.csv +420 -0
- molSimplify/tf_nn/oxocatalysis/hat_train_names.csv +1507 -0
- molSimplify/tf_nn/oxocatalysis/hat_train_x.csv +1508 -0
- molSimplify/tf_nn/oxocatalysis/hat_train_y.csv +1508 -0
- molSimplify/tf_nn/oxocatalysis/hat_val_x.csv +169 -0
- molSimplify/tf_nn/oxocatalysis/hat_val_y.csv +169 -0
- molSimplify/tf_nn/oxocatalysis/hat_vars.csv +162 -0
- molSimplify/tf_nn/oxocatalysis/oxo_model.h5 +0 -0
- molSimplify/tf_nn/oxocatalysis/oxo_model.json +1 -0
- molSimplify/tf_nn/oxocatalysis/oxo_test_names.csv +527 -0
- molSimplify/tf_nn/oxocatalysis/oxo_test_x.csv +528 -0
- molSimplify/tf_nn/oxocatalysis/oxo_test_y.csv +528 -0
- molSimplify/tf_nn/oxocatalysis/oxo_train_names.csv +1897 -0
- molSimplify/tf_nn/oxocatalysis/oxo_train_x.csv +1898 -0
- molSimplify/tf_nn/oxocatalysis/oxo_train_y.csv +1898 -0
- molSimplify/tf_nn/oxocatalysis/oxo_val_x.csv +212 -0
- molSimplify/tf_nn/oxocatalysis/oxo_val_y.csv +212 -0
- molSimplify/tf_nn/oxocatalysis/oxo_vars.csv +162 -0
- molSimplify/tf_nn/rescaling_data/gap_mean_x.csv +153 -0
- molSimplify/tf_nn/rescaling_data/gap_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/gap_var_x.csv +153 -0
- molSimplify/tf_nn/rescaling_data/gap_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/geo_static_clf_mean_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/geo_static_clf_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/geo_static_clf_var_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/geo_static_clf_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/hat_mean_x.csv +162 -0
- molSimplify/tf_nn/rescaling_data/hat_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/hat_var_x.csv +162 -0
- molSimplify/tf_nn/rescaling_data/hat_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/homo_empty_mean_x.csv +155 -0
- molSimplify/tf_nn/rescaling_data/homo_empty_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/homo_empty_var_x.csv +155 -0
- molSimplify/tf_nn/rescaling_data/homo_empty_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/homo_mean_x.csv +153 -0
- molSimplify/tf_nn/rescaling_data/homo_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/homo_var_x.csv +153 -0
- molSimplify/tf_nn/rescaling_data/homo_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/hs_ii_mean_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/hs_ii_mean_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/hs_ii_var_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/hs_ii_var_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/hs_iii_mean_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/hs_iii_mean_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/hs_iii_var_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/hs_iii_var_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/ls_ii_mean_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/ls_ii_mean_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/ls_ii_var_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/ls_ii_var_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/ls_iii_mean_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/ls_iii_mean_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/ls_iii_var_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/ls_iii_var_y.csv +3 -0
- molSimplify/tf_nn/rescaling_data/oxo20_mean_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/oxo20_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/oxo20_var_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/oxo20_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/oxo_mean_x.csv +162 -0
- molSimplify/tf_nn/rescaling_data/oxo_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/oxo_var_x.csv +162 -0
- molSimplify/tf_nn/rescaling_data/oxo_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/sc_static_clf_mean_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/sc_static_clf_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/sc_static_clf_var_x.csv +154 -0
- molSimplify/tf_nn/rescaling_data/sc_static_clf_var_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/split_mean_x.csv +155 -0
- molSimplify/tf_nn/rescaling_data/split_mean_y.csv +1 -0
- molSimplify/tf_nn/rescaling_data/split_var_x.csv +155 -0
- molSimplify/tf_nn/rescaling_data/split_var_y.csv +1 -0
- molSimplify/tf_nn/sc_static_clf/sc_static_clf_model.h5 +0 -0
- molSimplify/tf_nn/sc_static_clf/sc_static_clf_train_name.csv +1591 -0
- molSimplify/tf_nn/sc_static_clf/sc_static_clf_train_x.csv +1592 -0
- molSimplify/tf_nn/sc_static_clf/sc_static_clf_train_y.csv +1592 -0
- molSimplify/tf_nn/sc_static_clf/sc_static_clf_vars.csv +154 -0
- molSimplify/tf_nn/split/split_model.h5 +0 -0
- molSimplify/tf_nn/split/split_model.json +1 -0
- molSimplify/tf_nn/split/split_vars.csv +155 -0
- molSimplify/tf_nn/split/split_x.csv +1902 -0
- molSimplify/tf_nn/split/split_y.csv +1902 -0
- molSimplify/tf_nn/split/train_names.csv +1901 -0
- molSimplify/utils/__init__.py +0 -0
- molSimplify/utils/decorators.py +16 -0
- molSimplify/utils/metaclasses.py +12 -0
- molSimplify/utils/tensorflow.py +23 -0
- molSimplify/utils/timer.py +16 -0
- molSimplify-1.7.4.dist-info/LICENSE +674 -0
- molSimplify-1.7.4.dist-info/METADATA +821 -0
- molSimplify-1.7.4.dist-info/RECORD +651 -0
- molSimplify-1.7.4.dist-info/WHEEL +5 -0
- molSimplify-1.7.4.dist-info/entry_points.txt +3 -0
- molSimplify-1.7.4.dist-info/top_level.txt +4 -0
- tests/generateTests.py +122 -0
- tests/helperFuncs.py +658 -0
- tests/informatics/test_MOF_descriptors.py +128 -0
- tests/informatics/test_active_learning.py +113 -0
- tests/informatics/test_coulomb_analyze.py +24 -0
- tests/informatics/test_graph_racs.py +193 -0
- tests/ml/test_kernels.py +20 -0
- tests/ml/test_layers.py +47 -0
- tests/runtest.py +10 -0
- tests/test_Mol2D.py +128 -0
- tests/test_basic_imports.py +62 -0
- tests/test_bidentate.py +25 -0
- tests/test_cli.py +20 -0
- tests/test_distgeom.py +106 -0
- tests/test_example_1.py +29 -0
- tests/test_example_3.py +31 -0
- tests/test_example_5.py +43 -0
- tests/test_example_7.py +28 -0
- tests/test_example_8.py +15 -0
- tests/test_example_tbp.py +15 -0
- tests/test_ff_xtb.py +111 -0
- tests/test_geocheck_oct.py +26 -0
- tests/test_geocheck_one_empty.py +15 -0
- tests/test_geometry.py +44 -0
- tests/test_inparse.py +76 -0
- tests/test_io.py +84 -0
- tests/test_jobgen.py +84 -0
- tests/test_joption_pythonic.py +27 -0
- tests/test_ligand_assign.py +58 -0
- tests/test_ligand_assign_consistent.py +60 -0
- tests/test_ligand_class.py +26 -0
- tests/test_ligand_from_mol_file.py +35 -0
- tests/test_ligands.py +86 -0
- tests/test_mol3D.py +337 -0
- tests/test_molcas_caspt2.py +15 -0
- tests/test_molcas_casscf.py +15 -0
- tests/test_old_ANNs.py +68 -0
- tests/test_orca_ccsdt.py +15 -0
- tests/test_orca_dft.py +15 -0
- tests/test_qcgen.py +50 -0
- tests/test_racs.py +124 -0
- tests/test_rmsd.py +68 -0
- tests/test_structgen_functions.py +198 -0
- tests/test_tetrahedral.py +29 -0
- tests/test_tutorial_10_part_one.py +16 -0
- tests/test_tutorial_10_part_two.py +15 -0
- tests/test_tutorial_2.py +11 -0
- tests/test_tutorial_3.py +15 -0
- tests/test_tutorial_4.py +57 -0
- tests/test_tutorial_6.py +10 -0
- tests/test_tutorial_8.py +29 -0
- tests/test_tutorial_9_part_one.py +15 -0
- tests/test_tutorial_9_part_two.py +15 -0
- tests/test_tutorial_qm9_part_one.py +6 -0
- tests/testresources/refs/racs/generate_references.py +85 -0
- workflows/NandyJACSAu2022/bridge_functionalizer.py +253 -0
- workflows/NandyJACSAu2022/frag_functionalizer.py +242 -0
- workflows/NandyJACSAu2022/fragment_classes.py +586 -0
- workflows/NandyJACSAu2022/macrocycle_synthesis.py +179 -0
|
@@ -0,0 +1,2192 @@
|
|
|
1
|
+
# Written JP Janet
|
|
2
|
+
# for HJK Group
|
|
3
|
+
# Dpt of Chemical Engineering, MIT
|
|
4
|
+
|
|
5
|
+
# #########################################################
|
|
6
|
+
# ####### Defines methods for assembling ###############
|
|
7
|
+
# ####### RACs from lists of ligands ###############
|
|
8
|
+
# #########################################################
|
|
9
|
+
from __future__ import print_function
|
|
10
|
+
import numpy as np
|
|
11
|
+
from molSimplify.Classes.ligand import ligand_breakdown
|
|
12
|
+
from molSimplify.Classes.ligand import ligand_assign_consistent as ligand_assign
|
|
13
|
+
from molSimplify.Classes.globalvars import globalvars
|
|
14
|
+
|
|
15
|
+
globs = globalvars()
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def get_descriptor_vector(this_complex, custom_ligand_dict=False,
|
|
19
|
+
ox_modifier=False, NumB=False, Gval=False,
|
|
20
|
+
lacRACs=True, loud=False, metal_ind=None,
|
|
21
|
+
smiles_charge=False, eq_sym=False,
|
|
22
|
+
use_dist=False, size_normalize=False,
|
|
23
|
+
alleq=False, MRdiag_dict={}, depth=3):
|
|
24
|
+
""" Calculate and return all geo-based RACs for a given octahedral complex (featurize).
|
|
25
|
+
|
|
26
|
+
Parameters
|
|
27
|
+
----------
|
|
28
|
+
this_complex : mol3D
|
|
29
|
+
Transition metal complex to be featurized.
|
|
30
|
+
custom_ligand_dict : bool, optional
|
|
31
|
+
Custom ligand dictionary to evaluate for complex if passed, by default False
|
|
32
|
+
Skip the ligand breakdown steps -
|
|
33
|
+
in cases where 3D geo is not correct/formed
|
|
34
|
+
custom_ligand_dict.keys() must be eq_ligands_list, ax_ligand_list
|
|
35
|
+
ax_con_int_list ,eq_con_int_list
|
|
36
|
+
with types: eq/ax_ligand_list list of mol3D
|
|
37
|
+
eq/ax_con_int_list list of list/tuple of int e.g, [[1,2] [1,2]]
|
|
38
|
+
ox_modifier : bool, optional
|
|
39
|
+
dict, used to modify prop vector (e.g. for adding
|
|
40
|
+
ONLY used with ox_nuclear_charge ox or charge)
|
|
41
|
+
{"Fe":2, "Co": 3} etc, by default False
|
|
42
|
+
NumB : bool, optional
|
|
43
|
+
Use Number of Bonds as additional RAC, by default False
|
|
44
|
+
Gval : bool, optional
|
|
45
|
+
Use group number as RAC, by default False
|
|
46
|
+
lacRACs : bool, optional
|
|
47
|
+
Use ligand_assign_consistent (lac) to represent mol3D given
|
|
48
|
+
if False, use ligand_assign (older), default True
|
|
49
|
+
loud : bool, optional
|
|
50
|
+
Print debugging information, by default False
|
|
51
|
+
metal_ind : bool, optional
|
|
52
|
+
index of the metal atom to generate property, by default False
|
|
53
|
+
smiles_charge : bool, optional
|
|
54
|
+
use obmol conversion through smiles to assign ligand_misc_charges, by default False
|
|
55
|
+
use_dist : bool, optional
|
|
56
|
+
Whether or not CD-RACs used.
|
|
57
|
+
size_normalize : bool, optional
|
|
58
|
+
Whether or not to normalize by the number of atoms.
|
|
59
|
+
alleq : bool, optional
|
|
60
|
+
Whether or not all ligands are equatorial.
|
|
61
|
+
MRdiag_dict : dict, optional
|
|
62
|
+
Keys are ligand identifiers, values are MR diagnostics like E_corr.
|
|
63
|
+
depth : int, optional
|
|
64
|
+
The depth of the RACs (how many bonds out the RACs go).
|
|
65
|
+
|
|
66
|
+
Returns
|
|
67
|
+
-------
|
|
68
|
+
descriptor_names : list
|
|
69
|
+
Compiled list of descriptor names
|
|
70
|
+
descriptors : list
|
|
71
|
+
Compiled list of descriptor values
|
|
72
|
+
|
|
73
|
+
"""
|
|
74
|
+
# modifier -
|
|
75
|
+
descriptor_names = []
|
|
76
|
+
descriptors = []
|
|
77
|
+
# Generate custom_ligand_dict if one not passed!
|
|
78
|
+
if not custom_ligand_dict:
|
|
79
|
+
liglist, ligdents, ligcons = ligand_breakdown(this_complex, BondedOct=True) # Complex is assumed to be octahedral
|
|
80
|
+
# print(liglist, ligdents, ligcons)
|
|
81
|
+
if not alleq:
|
|
82
|
+
if lacRACs:
|
|
83
|
+
from molSimplify.Classes.ligand import ligand_assign_consistent as ligand_assign
|
|
84
|
+
else:
|
|
85
|
+
from molSimplify.Classes.ligand import ligand_assign as ligand_assign
|
|
86
|
+
ax_ligand_list, eq_ligand_list, ax_natoms_list, eq_natoms_list, \
|
|
87
|
+
ax_con_int_list, eq_con_int_list, ax_con_list, eq_con_list, \
|
|
88
|
+
built_ligand_list = ligand_assign(this_complex, liglist, ligdents, ligcons, loud, eq_sym_match=eq_sym)
|
|
89
|
+
else:
|
|
90
|
+
from molSimplify.Classes.ligand import ligand_assign_alleq
|
|
91
|
+
ax_ligand_list, eq_ligand_list, ax_con_int_list, eq_con_int_list = ligand_assign_alleq(
|
|
92
|
+
this_complex, liglist, ligdents, ligcons)
|
|
93
|
+
custom_ligand_dict = {'ax_ligand_list': ax_ligand_list,
|
|
94
|
+
'eq_ligand_list': eq_ligand_list,
|
|
95
|
+
'ax_con_int_list': ax_con_int_list,
|
|
96
|
+
'eq_con_int_list': eq_con_int_list}
|
|
97
|
+
# misc descriptors
|
|
98
|
+
results_dictionary = generate_all_ligand_misc(this_complex, loud=False,
|
|
99
|
+
custom_ligand_dict=custom_ligand_dict,
|
|
100
|
+
smiles_charge=smiles_charge)
|
|
101
|
+
descriptor_names, descriptors = append_descriptors(descriptor_names, descriptors,
|
|
102
|
+
results_dictionary['colnames'],
|
|
103
|
+
results_dictionary['result_ax'],
|
|
104
|
+
'misc', 'ax')
|
|
105
|
+
descriptor_names, descriptors = append_descriptors(descriptor_names, descriptors,
|
|
106
|
+
results_dictionary['colnames'],
|
|
107
|
+
results_dictionary['result_eq'],
|
|
108
|
+
'misc', 'eq')
|
|
109
|
+
|
|
110
|
+
# full ACs
|
|
111
|
+
results_dictionary = generate_full_complex_autocorrelations(this_complex, depth=depth,
|
|
112
|
+
loud=False, flag_name=False,
|
|
113
|
+
modifier=ox_modifier, NumB=NumB,
|
|
114
|
+
Gval=Gval, use_dist=use_dist,
|
|
115
|
+
size_normalize=size_normalize,
|
|
116
|
+
MRdiag_dict=MRdiag_dict)
|
|
117
|
+
descriptor_names, descriptors = append_descriptors(descriptor_names, descriptors,
|
|
118
|
+
results_dictionary['colnames'],
|
|
119
|
+
results_dictionary['results'],
|
|
120
|
+
'f', 'all')
|
|
121
|
+
# # ligand ACs
|
|
122
|
+
results_dictionary = generate_all_ligand_autocorrelations(this_complex, depth=depth,
|
|
123
|
+
loud=False, flag_name=False,
|
|
124
|
+
custom_ligand_dict=custom_ligand_dict,
|
|
125
|
+
NumB=NumB, Gval=Gval, use_dist=use_dist,
|
|
126
|
+
size_normalize=size_normalize,
|
|
127
|
+
MRdiag_dict=MRdiag_dict)
|
|
128
|
+
if not alleq:
|
|
129
|
+
descriptor_names, descriptors = append_descriptors(descriptor_names, descriptors,
|
|
130
|
+
results_dictionary['colnames'],
|
|
131
|
+
results_dictionary['result_ax_full'],
|
|
132
|
+
'f', 'ax')
|
|
133
|
+
descriptor_names, descriptors = append_descriptors(descriptor_names, descriptors,
|
|
134
|
+
results_dictionary['colnames'],
|
|
135
|
+
results_dictionary['result_eq_full'],
|
|
136
|
+
'f', 'eq')
|
|
137
|
+
if not alleq:
|
|
138
|
+
descriptor_names, descriptors = append_descriptors(descriptor_names, descriptors,
|
|
139
|
+
results_dictionary['colnames'],
|
|
140
|
+
results_dictionary['result_ax_con'],
|
|
141
|
+
'lc', 'ax')
|
|
142
|
+
descriptor_names, descriptors = append_descriptors(descriptor_names, descriptors,
|
|
143
|
+
results_dictionary['colnames'],
|
|
144
|
+
results_dictionary['result_eq_con'],
|
|
145
|
+
'lc', 'eq')
|
|
146
|
+
|
|
147
|
+
results_dictionary = generate_all_ligand_deltametrics(this_complex, depth=depth, loud=False,
|
|
148
|
+
custom_ligand_dict=custom_ligand_dict,
|
|
149
|
+
NumB=NumB, Gval=Gval, use_dist=use_dist,
|
|
150
|
+
size_normalize=size_normalize,
|
|
151
|
+
MRdiag_dict=MRdiag_dict)
|
|
152
|
+
if not alleq:
|
|
153
|
+
descriptor_names, descriptors = append_descriptors(descriptor_names, descriptors,
|
|
154
|
+
results_dictionary['colnames'],
|
|
155
|
+
results_dictionary['result_ax_con'],
|
|
156
|
+
'D_lc', 'ax')
|
|
157
|
+
descriptor_names, descriptors = append_descriptors(descriptor_names, descriptors,
|
|
158
|
+
results_dictionary['colnames'],
|
|
159
|
+
results_dictionary['result_eq_con'],
|
|
160
|
+
'D_lc', 'eq')
|
|
161
|
+
|
|
162
|
+
# metal ACs
|
|
163
|
+
# print('getting metal ACs')
|
|
164
|
+
results_dictionary = generate_metal_autocorrelations(this_complex, depth=depth,
|
|
165
|
+
loud=False, modifier=ox_modifier,
|
|
166
|
+
NumB=NumB, Gval=Gval, metal_ind=metal_ind,
|
|
167
|
+
use_dist=use_dist,
|
|
168
|
+
size_normalize=size_normalize,
|
|
169
|
+
MRdiag_dict=MRdiag_dict)
|
|
170
|
+
descriptor_names, descriptors = append_descriptors(descriptor_names, descriptors,
|
|
171
|
+
results_dictionary['colnames'],
|
|
172
|
+
results_dictionary['results'],
|
|
173
|
+
'mc', 'all')
|
|
174
|
+
|
|
175
|
+
results_dictionary = generate_metal_deltametrics(this_complex, depth=depth,
|
|
176
|
+
loud=False, modifier=ox_modifier,
|
|
177
|
+
NumB=NumB, Gval=Gval, metal_ind=metal_ind,
|
|
178
|
+
use_dist=use_dist,
|
|
179
|
+
size_normalize=size_normalize,
|
|
180
|
+
MRdiag_dict=MRdiag_dict)
|
|
181
|
+
descriptor_names, descriptors = append_descriptors(descriptor_names, descriptors,
|
|
182
|
+
results_dictionary['colnames'],
|
|
183
|
+
results_dictionary['results'],
|
|
184
|
+
'D_mc', 'all')
|
|
185
|
+
|
|
186
|
+
# ## ox-metal ACs, if ox available
|
|
187
|
+
if ox_modifier:
|
|
188
|
+
results_dictionary = generate_metal_ox_autocorrelations(ox_modifier, this_complex,
|
|
189
|
+
depth=depth, loud=False,
|
|
190
|
+
metal_ind=metal_ind, use_dist=use_dist,
|
|
191
|
+
size_normalize=size_normalize)
|
|
192
|
+
descriptor_names, descriptors = append_descriptors(descriptor_names, descriptors,
|
|
193
|
+
results_dictionary['colnames'],
|
|
194
|
+
results_dictionary['results'],
|
|
195
|
+
'mc', 'all')
|
|
196
|
+
results_dictionary = generate_metal_ox_deltametrics(ox_modifier, this_complex,
|
|
197
|
+
depth=depth, loud=False,
|
|
198
|
+
metal_ind=metal_ind,
|
|
199
|
+
use_dist=use_dist,
|
|
200
|
+
size_normalize=size_normalize)
|
|
201
|
+
descriptor_names, descriptors = append_descriptors(descriptor_names, descriptors,
|
|
202
|
+
results_dictionary['colnames'],
|
|
203
|
+
results_dictionary['results'],
|
|
204
|
+
'D_mc', 'all')
|
|
205
|
+
return descriptor_names, descriptors
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def get_descriptor_derivatives(this_complex, custom_ligand_dict=False, ox_modifier=False,
|
|
209
|
+
lacRACs=True, depth=4, loud=False, metal_ind=None):
|
|
210
|
+
""" Calculate and return all derivatives of RACs for a given octahedral complex.
|
|
211
|
+
|
|
212
|
+
Parameters
|
|
213
|
+
----------
|
|
214
|
+
this_complex : mol3D
|
|
215
|
+
Transition metal complex to be featurized.
|
|
216
|
+
custom_ligand_dict : bool, optional
|
|
217
|
+
Custom ligand dictionary to evaluate for complex if passed, by default False
|
|
218
|
+
Skip the ligand breakdown steps -
|
|
219
|
+
in cases where 3D geo is not correct/formed
|
|
220
|
+
custom_ligand_dict.keys() must be eq_ligands_list, ax_ligand_list
|
|
221
|
+
ax_con_int_list ,eq_con_int_list
|
|
222
|
+
with types: eq/ax_ligand_list list of mol3D
|
|
223
|
+
eq/ax_con_int_list list of list/tuple of int e.g, [[1,2] [1,2]]
|
|
224
|
+
ox_modifier : bool, optional
|
|
225
|
+
dict, used to modify prop vector (e.g. for adding
|
|
226
|
+
ONLY used with ox_nuclear_charge ox or charge)
|
|
227
|
+
{"Fe":2, "Co": 3} etc, by default False
|
|
228
|
+
lacRACs : bool, optional
|
|
229
|
+
Use ligand_assign_consistent (lac) to represent mol3D given
|
|
230
|
+
if False, use ligand_assign (older), default True
|
|
231
|
+
depth : int, optional
|
|
232
|
+
depth of RACs to calculate, by default 4
|
|
233
|
+
loud : bool, optional
|
|
234
|
+
Print debugging information, by default False
|
|
235
|
+
metal_ind : bool, optional
|
|
236
|
+
index of the metal atom to generate RACs from, by default False
|
|
237
|
+
|
|
238
|
+
Returns
|
|
239
|
+
-------
|
|
240
|
+
descriptor_derivative_names : list
|
|
241
|
+
Compiled list (matrix) of descriptor derivative names
|
|
242
|
+
descriptor_derivatives : list
|
|
243
|
+
Derivatives of RACs w.r.t atomic props (matrix)
|
|
244
|
+
|
|
245
|
+
"""
|
|
246
|
+
if not custom_ligand_dict:
|
|
247
|
+
if lacRACs:
|
|
248
|
+
from molSimplify.Classes.ligand import ligand_assign_consistent as ligand_assign
|
|
249
|
+
else:
|
|
250
|
+
from molSimplify.Classes.ligand import ligand_assign as ligand_assign
|
|
251
|
+
liglist, ligdents, ligcons = ligand_breakdown(this_complex, BondedOct=True) # Complex is assumed to be octahedral
|
|
252
|
+
(ax_ligand_list, eq_ligand_list, ax_natoms_list, eq_natoms_list,
|
|
253
|
+
ax_con_int_list, eq_con_int_list, ax_con_list, eq_con_list,
|
|
254
|
+
built_ligand_list) = ligand_assign(this_complex, liglist, ligdents, ligcons, loud)
|
|
255
|
+
custom_ligand_dict = {'ax_ligand_list': ax_ligand_list,
|
|
256
|
+
'eq_ligand_list': eq_ligand_list,
|
|
257
|
+
'ax_con_int_list': ax_con_int_list,
|
|
258
|
+
'eq_con_int_list': eq_con_int_list}
|
|
259
|
+
# cannot do misc descriptors !
|
|
260
|
+
descriptor_derivative_names = []
|
|
261
|
+
descriptor_derivatives = None
|
|
262
|
+
# full ACs
|
|
263
|
+
results_dictionary = generate_full_complex_autocorrelation_derivatives(this_complex, depth=depth,
|
|
264
|
+
loud=False, flag_name=False,
|
|
265
|
+
modifier=ox_modifier)
|
|
266
|
+
descriptor_derivative_names, descriptor_derivatives = append_descriptor_derivatives(descriptor_derivative_names,
|
|
267
|
+
descriptor_derivatives,
|
|
268
|
+
results_dictionary['colnames'],
|
|
269
|
+
results_dictionary['results'],
|
|
270
|
+
'f', 'all')
|
|
271
|
+
# ligand ACs
|
|
272
|
+
# print('getting ligand AC derivatives')
|
|
273
|
+
results_dictionary = generate_all_ligand_autocorrelation_derivatives(this_complex, depth=depth, loud=False,
|
|
274
|
+
custom_ligand_dict=custom_ligand_dict)
|
|
275
|
+
descriptor_derivative_names, descriptor_derivatives = append_descriptor_derivatives(descriptor_derivative_names,
|
|
276
|
+
descriptor_derivatives,
|
|
277
|
+
results_dictionary['colnames'],
|
|
278
|
+
results_dictionary['result_ax_full'],
|
|
279
|
+
'f', 'ax')
|
|
280
|
+
descriptor_derivative_names, descriptor_derivatives = append_descriptor_derivatives(descriptor_derivative_names,
|
|
281
|
+
descriptor_derivatives,
|
|
282
|
+
results_dictionary['colnames'],
|
|
283
|
+
results_dictionary['result_eq_full'],
|
|
284
|
+
'f', 'eq')
|
|
285
|
+
descriptor_derivative_names, descriptor_derivatives = append_descriptor_derivatives(descriptor_derivative_names,
|
|
286
|
+
descriptor_derivatives,
|
|
287
|
+
results_dictionary['colnames'],
|
|
288
|
+
results_dictionary['result_ax_con'],
|
|
289
|
+
'lc', 'ax')
|
|
290
|
+
descriptor_derivative_names, descriptor_derivatives = append_descriptor_derivatives(descriptor_derivative_names,
|
|
291
|
+
descriptor_derivatives,
|
|
292
|
+
results_dictionary['colnames'],
|
|
293
|
+
results_dictionary['result_eq_con'],
|
|
294
|
+
'lc', 'eq')
|
|
295
|
+
results_dictionary = generate_all_ligand_deltametric_derivatives(this_complex, depth=depth, loud=False,
|
|
296
|
+
custom_ligand_dict=custom_ligand_dict)
|
|
297
|
+
descriptor_derivative_names, descriptor_derivatives = append_descriptor_derivatives(descriptor_derivative_names,
|
|
298
|
+
descriptor_derivatives,
|
|
299
|
+
results_dictionary['colnames'],
|
|
300
|
+
results_dictionary['result_ax_con'],
|
|
301
|
+
'D_lc', 'ax')
|
|
302
|
+
descriptor_derivative_names, descriptor_derivatives = append_descriptor_derivatives(descriptor_derivative_names,
|
|
303
|
+
descriptor_derivatives,
|
|
304
|
+
results_dictionary['colnames'],
|
|
305
|
+
results_dictionary['result_eq_con'],
|
|
306
|
+
'D_lc', 'eq')
|
|
307
|
+
# metal ACs
|
|
308
|
+
# print('getting metal AC derivatives')
|
|
309
|
+
results_dictionary = generate_metal_autocorrelation_derivatives(this_complex, depth=depth, loud=False,
|
|
310
|
+
modifier=ox_modifier, metal_ind=metal_ind)
|
|
311
|
+
descriptor_derivative_names, descriptor_derivatives = append_descriptor_derivatives(descriptor_derivative_names,
|
|
312
|
+
descriptor_derivatives,
|
|
313
|
+
results_dictionary['colnames'],
|
|
314
|
+
results_dictionary['results'],
|
|
315
|
+
'mc', 'all')
|
|
316
|
+
results_dictionary = generate_metal_deltametric_derivatives(this_complex, depth=depth, loud=False,
|
|
317
|
+
modifier=ox_modifier, metal_ind=metal_ind)
|
|
318
|
+
descriptor_derivative_names, descriptor_derivatives = append_descriptor_derivatives(descriptor_derivative_names,
|
|
319
|
+
descriptor_derivatives,
|
|
320
|
+
results_dictionary['colnames'],
|
|
321
|
+
results_dictionary['results'],
|
|
322
|
+
'D_mc', 'all')
|
|
323
|
+
# ## ox-metal ACs
|
|
324
|
+
if ox_modifier:
|
|
325
|
+
results_dictionary = generate_metal_ox_autocorrelation_derivatives(ox_modifier, this_complex, depth=depth,
|
|
326
|
+
loud=False, metal_ind=metal_ind)
|
|
327
|
+
descriptor_derivative_names, descriptor_derivatives = append_descriptor_derivatives(descriptor_derivative_names,
|
|
328
|
+
descriptor_derivatives,
|
|
329
|
+
results_dictionary['colnames'],
|
|
330
|
+
results_dictionary['results'],
|
|
331
|
+
'mc', 'all')
|
|
332
|
+
|
|
333
|
+
results_dictionary = generate_metal_ox_deltametric_derivatives(ox_modifier, this_complex, depth=depth,
|
|
334
|
+
loud=False, metal_ind=metal_ind)
|
|
335
|
+
descriptor_derivative_names, descriptor_derivatives = append_descriptor_derivatives(descriptor_derivative_names,
|
|
336
|
+
descriptor_derivatives,
|
|
337
|
+
results_dictionary['colnames'],
|
|
338
|
+
results_dictionary['results'],
|
|
339
|
+
'D_mc', 'all')
|
|
340
|
+
|
|
341
|
+
return descriptor_derivative_names, descriptor_derivatives
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
def append_descriptors(descriptor_names, descriptors, list_of_names, list_of_props, prefix, suffix):
|
|
345
|
+
"""Utility to build standardly formated RACS
|
|
346
|
+
|
|
347
|
+
Parameters
|
|
348
|
+
----------
|
|
349
|
+
descriptor_names : list
|
|
350
|
+
Descriptors names list to be appended to
|
|
351
|
+
descriptors : list
|
|
352
|
+
Descriptors list to be appended to
|
|
353
|
+
list_of_names : list
|
|
354
|
+
nmaes to be added
|
|
355
|
+
list_of_props : list
|
|
356
|
+
Types of RACs
|
|
357
|
+
prefix : str
|
|
358
|
+
Prefix to be added to names
|
|
359
|
+
suffix : str
|
|
360
|
+
Suffix to be added to names
|
|
361
|
+
|
|
362
|
+
Returns
|
|
363
|
+
-------
|
|
364
|
+
descriptor_names : list
|
|
365
|
+
Compiled list of descriptor names
|
|
366
|
+
descriptors : list
|
|
367
|
+
Compiled list of descriptor values
|
|
368
|
+
|
|
369
|
+
"""
|
|
370
|
+
try:
|
|
371
|
+
basestring
|
|
372
|
+
except NameError:
|
|
373
|
+
basestring = str
|
|
374
|
+
|
|
375
|
+
for names in list_of_names:
|
|
376
|
+
if not isinstance(names, basestring):
|
|
377
|
+
names = ["-".join([prefix, str(i), suffix]) for i in names]
|
|
378
|
+
descriptor_names += names
|
|
379
|
+
else:
|
|
380
|
+
names = "-".join([prefix, str(names), suffix])
|
|
381
|
+
descriptor_names.append(names)
|
|
382
|
+
for values in list_of_props:
|
|
383
|
+
if not isinstance(names, basestring):
|
|
384
|
+
descriptors.extend(values)
|
|
385
|
+
else:
|
|
386
|
+
descriptors.append(values)
|
|
387
|
+
return descriptor_names, descriptors
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
def append_descriptor_derivatives(descriptor_derivative_names, descriptor_derivatives,
|
|
391
|
+
mat_of_names, dmat, prefix, suffix):
|
|
392
|
+
"""Utility to build standardly formated RACS derivatives
|
|
393
|
+
|
|
394
|
+
Parameters
|
|
395
|
+
----------
|
|
396
|
+
descriptor_derivative_names : list
|
|
397
|
+
RAC names, will be a matrix, will be appended to
|
|
398
|
+
descriptor_derivatives : list
|
|
399
|
+
RAC, will be appended to
|
|
400
|
+
mat_of_names : list
|
|
401
|
+
names, will be added
|
|
402
|
+
dmat : list
|
|
403
|
+
mat of RAC derivatives
|
|
404
|
+
prefix : str
|
|
405
|
+
RAC prefix
|
|
406
|
+
suffix : str
|
|
407
|
+
RAC suffix
|
|
408
|
+
|
|
409
|
+
Returns
|
|
410
|
+
-------
|
|
411
|
+
descriptor_derivative_names : list
|
|
412
|
+
Compiled list (matrix) of descriptor derivative names
|
|
413
|
+
descriptor_derivatives : list
|
|
414
|
+
Derivatives of RACs w.r.t atomic props (matrix)
|
|
415
|
+
|
|
416
|
+
"""
|
|
417
|
+
# try:
|
|
418
|
+
# basestring
|
|
419
|
+
# except NameError:
|
|
420
|
+
# basestring = str
|
|
421
|
+
|
|
422
|
+
for names in mat_of_names:
|
|
423
|
+
jnames = ["-".join([prefix, str(i), suffix]) for i in names]
|
|
424
|
+
descriptor_derivative_names.append(jnames)
|
|
425
|
+
if descriptor_derivatives is None:
|
|
426
|
+
descriptor_derivatives = dmat
|
|
427
|
+
else:
|
|
428
|
+
descriptor_derivatives = np.row_stack([descriptor_derivatives, dmat])
|
|
429
|
+
return descriptor_derivative_names, descriptor_derivatives
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
def autocorrelation(mol, prop_vec, orig, d, oct=True, use_dist=False, size_normalize=False):
|
|
433
|
+
"""Calculate and return the products autocorrelation
|
|
434
|
+
|
|
435
|
+
Parameters
|
|
436
|
+
----------
|
|
437
|
+
mol : mol3D
|
|
438
|
+
mol3D object to calculate autocorrelation over
|
|
439
|
+
prop_vec : list
|
|
440
|
+
property of atoms in mol in order of index
|
|
441
|
+
orig : int
|
|
442
|
+
zero-indexed starting atom
|
|
443
|
+
d : int
|
|
444
|
+
number of hops to travel
|
|
445
|
+
oct : bool, optional
|
|
446
|
+
Flag is octahedral complex, by default True
|
|
447
|
+
use_dist : bool, optional
|
|
448
|
+
Weigh autocorrelation by physical distance of atom from original, by default False
|
|
449
|
+
size_normalize : bool, optional
|
|
450
|
+
Whether or not to normalize by the number of atoms.
|
|
451
|
+
|
|
452
|
+
Returns
|
|
453
|
+
-------
|
|
454
|
+
result_vector : list
|
|
455
|
+
assembled products autocorrelations
|
|
456
|
+
|
|
457
|
+
"""
|
|
458
|
+
result_vector = np.zeros(d + 1)
|
|
459
|
+
hopped = 0
|
|
460
|
+
active_set = set([orig])
|
|
461
|
+
historical_set = set()
|
|
462
|
+
if not use_dist:
|
|
463
|
+
result_vector[hopped] = prop_vec[orig] * prop_vec[orig]
|
|
464
|
+
else:
|
|
465
|
+
result_vector[hopped] = 0.5 * abs(prop_vec[orig]) ** 2.4 / mol.natoms
|
|
466
|
+
while hopped < (d):
|
|
467
|
+
hopped += 1
|
|
468
|
+
new_active_set = set()
|
|
469
|
+
for this_atom in active_set:
|
|
470
|
+
this_atoms_neighbors = mol.getBondedAtomsSmart(this_atom, oct=oct)
|
|
471
|
+
for bound_atoms in this_atoms_neighbors:
|
|
472
|
+
if (bound_atoms not in historical_set) and (bound_atoms not in active_set):
|
|
473
|
+
new_active_set.add(bound_atoms)
|
|
474
|
+
for inds in new_active_set:
|
|
475
|
+
if not use_dist:
|
|
476
|
+
result_vector[hopped] += prop_vec[orig] * prop_vec[inds]
|
|
477
|
+
else:
|
|
478
|
+
this_dist = mol.getDistToMetal(orig, inds)
|
|
479
|
+
if size_normalize:
|
|
480
|
+
result_vector[hopped] += prop_vec[orig] * prop_vec[inds] / (this_dist * mol.natoms)
|
|
481
|
+
else:
|
|
482
|
+
result_vector[hopped] += prop_vec[orig] * prop_vec[inds] / (this_dist)
|
|
483
|
+
historical_set.update(active_set)
|
|
484
|
+
active_set = new_active_set
|
|
485
|
+
return (result_vector)
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
def autocorrelation_derivative(mol, prop_vec, orig, d, oct=True):
|
|
489
|
+
"""Returns derivative vector of products autocorrelations
|
|
490
|
+
|
|
491
|
+
Parameters
|
|
492
|
+
----------
|
|
493
|
+
mol : mol3D
|
|
494
|
+
mol3D object to calculate derivatives over
|
|
495
|
+
prop_vec : list
|
|
496
|
+
property of atoms in mol in order of index
|
|
497
|
+
orig : int
|
|
498
|
+
zero-indexed starting atom
|
|
499
|
+
d : int
|
|
500
|
+
number of hops to travel
|
|
501
|
+
oct : bool, optional
|
|
502
|
+
Flag is octahedral complex, by default True
|
|
503
|
+
|
|
504
|
+
Returns
|
|
505
|
+
-------
|
|
506
|
+
derivative_mat : list
|
|
507
|
+
RAC derivatives matrix
|
|
508
|
+
|
|
509
|
+
"""
|
|
510
|
+
derivative_mat = np.zeros((d + 1, len(prop_vec)))
|
|
511
|
+
# loop for each atom
|
|
512
|
+
hopped = 0
|
|
513
|
+
active_set = set([orig])
|
|
514
|
+
historical_set = set()
|
|
515
|
+
for derivate_ind in range(0, len(prop_vec)):
|
|
516
|
+
if derivate_ind == orig:
|
|
517
|
+
derivative_mat[hopped, derivate_ind] = 2 * prop_vec[orig]
|
|
518
|
+
else:
|
|
519
|
+
derivative_mat[hopped, derivate_ind] = 0
|
|
520
|
+
while hopped < (d):
|
|
521
|
+
|
|
522
|
+
hopped += 1
|
|
523
|
+
new_active_set = set()
|
|
524
|
+
for this_atom in active_set:
|
|
525
|
+
# prepare all atoms attached to this connection
|
|
526
|
+
# print('called in AC')
|
|
527
|
+
this_atoms_neighbors = mol.getBondedAtomsSmart(this_atom, oct=oct)
|
|
528
|
+
for bound_atoms in this_atoms_neighbors:
|
|
529
|
+
if (bound_atoms not in historical_set) and (bound_atoms not in active_set):
|
|
530
|
+
new_active_set.add(bound_atoms)
|
|
531
|
+
# print('new active set at hop = ' +str(hopped) + ' is ' +str(new_active_set))
|
|
532
|
+
for inds in new_active_set:
|
|
533
|
+
for derivate_ind in range(0, len(prop_vec)):
|
|
534
|
+
if derivate_ind == orig:
|
|
535
|
+
derivative_mat[hopped, derivate_ind] += prop_vec[inds]
|
|
536
|
+
elif derivate_ind == inds:
|
|
537
|
+
derivative_mat[hopped, derivate_ind] += prop_vec[orig]
|
|
538
|
+
historical_set.update(active_set)
|
|
539
|
+
active_set = new_active_set
|
|
540
|
+
return (derivative_mat)
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
def deltametric(mol, prop_vec, orig, d, oct=True, use_dist=False, size_normalize=False):
|
|
544
|
+
"""Returns the deltametric autocorrelation
|
|
545
|
+
|
|
546
|
+
Parameters
|
|
547
|
+
----------
|
|
548
|
+
mol : mol3D
|
|
549
|
+
mol3D object to calculate deltametric autocorrelation over
|
|
550
|
+
prop_vec : list
|
|
551
|
+
property of atoms in mol in order of index
|
|
552
|
+
orig : int
|
|
553
|
+
zero-indexed starting atom
|
|
554
|
+
d : int
|
|
555
|
+
number of hops to travel
|
|
556
|
+
oct : bool, optional
|
|
557
|
+
Flag is octahedral complex, by default True
|
|
558
|
+
use_dist : bool, optional
|
|
559
|
+
Weigh autocorrelation by physical distance of atom from original, by default False
|
|
560
|
+
size_normalize : bool, optional
|
|
561
|
+
Whether or not to normalize by the number of atoms.
|
|
562
|
+
|
|
563
|
+
Returns
|
|
564
|
+
-------
|
|
565
|
+
results_vector : list
|
|
566
|
+
deltametric autocorrelations
|
|
567
|
+
|
|
568
|
+
"""
|
|
569
|
+
result_vector = np.zeros(d + 1)
|
|
570
|
+
hopped = 0
|
|
571
|
+
active_set = set([orig])
|
|
572
|
+
historical_set = set()
|
|
573
|
+
result_vector[hopped] = 0.00
|
|
574
|
+
while hopped < (d):
|
|
575
|
+
hopped += 1
|
|
576
|
+
new_active_set = set()
|
|
577
|
+
for this_atom in active_set:
|
|
578
|
+
# prepare all atoms attached to this connection
|
|
579
|
+
# print('called in DAC')
|
|
580
|
+
this_atoms_neighbors = mol.getBondedAtomsSmart(this_atom, oct=oct)
|
|
581
|
+
for bound_atoms in this_atoms_neighbors:
|
|
582
|
+
if (bound_atoms not in historical_set) and (bound_atoms not in active_set):
|
|
583
|
+
new_active_set.add(bound_atoms)
|
|
584
|
+
# print('new active set at hop = ' +str(hopped) + ' is ' +str(new_active_set))
|
|
585
|
+
for inds in new_active_set:
|
|
586
|
+
if not use_dist:
|
|
587
|
+
result_vector[hopped] += prop_vec[orig] - prop_vec[inds]
|
|
588
|
+
else:
|
|
589
|
+
this_dist = mol.getDistToMetal(orig, inds)
|
|
590
|
+
if size_normalize:
|
|
591
|
+
result_vector[hopped] += (prop_vec[orig] - prop_vec[inds]) / (this_dist * mol.natoms + 1e-6)
|
|
592
|
+
else:
|
|
593
|
+
result_vector[hopped] += (prop_vec[orig] - prop_vec[inds]) / (this_dist + 1e-6)
|
|
594
|
+
historical_set.update(active_set)
|
|
595
|
+
active_set = new_active_set
|
|
596
|
+
return (result_vector)
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
def deltametric_derivative(mol, prop_vec, orig, d, oct=True):
|
|
600
|
+
"""Returns the deltametric autocorrelation derivative vector
|
|
601
|
+
|
|
602
|
+
Parameters
|
|
603
|
+
----------
|
|
604
|
+
mol : mol3D
|
|
605
|
+
mol3D object to calculate deltametric autocorrelation derivative over
|
|
606
|
+
prop_vec : list
|
|
607
|
+
property of atoms in mol in order of index
|
|
608
|
+
orig : int
|
|
609
|
+
zero-indexed starting atom
|
|
610
|
+
d : int
|
|
611
|
+
number of hops to travel
|
|
612
|
+
oct : bool, optional
|
|
613
|
+
Flag is octahedral complex, by default True
|
|
614
|
+
|
|
615
|
+
Returns
|
|
616
|
+
-------
|
|
617
|
+
derivative_mat : list
|
|
618
|
+
Deltametric autocorrelation derivatives matrix
|
|
619
|
+
|
|
620
|
+
"""
|
|
621
|
+
derivative_mat = np.zeros((d + 1, len(prop_vec)))
|
|
622
|
+
hopped = 0
|
|
623
|
+
active_set = set([orig])
|
|
624
|
+
historical_set = set()
|
|
625
|
+
# the zero-depth element is always zero
|
|
626
|
+
for derivate_ind in range(0, len(prop_vec)):
|
|
627
|
+
derivative_mat[hopped, derivate_ind] = 0.0
|
|
628
|
+
while hopped < (d):
|
|
629
|
+
hopped += 1
|
|
630
|
+
new_active_set = set()
|
|
631
|
+
for this_atom in active_set:
|
|
632
|
+
# prepare all atoms attached to this connection
|
|
633
|
+
# print('called in DAC')
|
|
634
|
+
this_atoms_neighbors = mol.getBondedAtomsSmart(this_atom, oct=oct)
|
|
635
|
+
for bound_atoms in this_atoms_neighbors:
|
|
636
|
+
if (bound_atoms not in historical_set) and (bound_atoms not in active_set):
|
|
637
|
+
new_active_set.add(bound_atoms)
|
|
638
|
+
# print('new active set at hop = ' +str(hopped) + ' is ' +str(new_active_set))
|
|
639
|
+
for inds in new_active_set:
|
|
640
|
+
for derivate_ind in range(0, len(prop_vec)):
|
|
641
|
+
if derivate_ind == orig:
|
|
642
|
+
derivative_mat[hopped, derivate_ind] += 1
|
|
643
|
+
elif derivate_ind == inds:
|
|
644
|
+
derivative_mat[hopped, derivate_ind] += -1
|
|
645
|
+
historical_set.update(active_set)
|
|
646
|
+
active_set = new_active_set
|
|
647
|
+
return (derivative_mat)
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
def construct_property_vector(mol, prop, oct=True, modifier=False, MRdiag_dict={}):
|
|
651
|
+
"""Assigns the value of property for atom i (zero index) in mol.
|
|
652
|
+
|
|
653
|
+
Parameters
|
|
654
|
+
----------
|
|
655
|
+
mol : mol3D
|
|
656
|
+
molecule to generate property vector for
|
|
657
|
+
prop : str
|
|
658
|
+
Property to generate vector for - Acceptable prop values: ['electronegativity',
|
|
659
|
+
'nuclear_charge', 'ident', 'topology', 'ox_nuclear_charge', 'size', 'vdwrad',
|
|
660
|
+
'group_number', 'polarizability', 'bondvalence', 'num_bonds',
|
|
661
|
+
'bondvalence_devi', 'bodavrg', 'bodstd', 'charge']
|
|
662
|
+
oct : bool, optional
|
|
663
|
+
Flag is octahedral complex, by default True
|
|
664
|
+
modifier : bool, optional
|
|
665
|
+
if passed - dict, used to modify prop vector (e.g. for adding
|
|
666
|
+
ONLY used with ox_nuclear_charge ox or charge)
|
|
667
|
+
{"Fe":2, "Co": 3} etc, by default False
|
|
668
|
+
MRdiag_dict : dict, optional
|
|
669
|
+
Keys are ligand identifiers, values are MR diagnostics like E_corr.
|
|
670
|
+
|
|
671
|
+
Returns
|
|
672
|
+
-------
|
|
673
|
+
w : list
|
|
674
|
+
property vector for mol by atom
|
|
675
|
+
|
|
676
|
+
"""
|
|
677
|
+
allowed_strings = ['electronegativity', 'nuclear_charge', 'ident', 'topology',
|
|
678
|
+
'ox_nuclear_charge', 'size', 'vdwrad', 'group_number', 'polarizability',
|
|
679
|
+
'bondvalence', 'num_bonds', 'bondvalence_devi', 'bodavrg', 'bodstd', 'charge',
|
|
680
|
+
]
|
|
681
|
+
if len(MRdiag_dict):
|
|
682
|
+
for k in list(MRdiag_dict):
|
|
683
|
+
allowed_strings += [k]
|
|
684
|
+
prop_dict = dict()
|
|
685
|
+
w = np.zeros(mol.natoms)
|
|
686
|
+
done = False
|
|
687
|
+
if prop not in allowed_strings:
|
|
688
|
+
print(('error, property ' + str(prop) + ' is not a vaild choice'))
|
|
689
|
+
print((' options are ' + str(allowed_strings)))
|
|
690
|
+
return False
|
|
691
|
+
if prop == 'electronegativity':
|
|
692
|
+
prop_dict = globs.endict()
|
|
693
|
+
elif prop == 'size':
|
|
694
|
+
at_keys = list(globs.amass().keys())
|
|
695
|
+
for keys in at_keys:
|
|
696
|
+
values = globs.amass()[keys][2]
|
|
697
|
+
prop_dict.update({keys: values})
|
|
698
|
+
elif prop == 'nuclear_charge':
|
|
699
|
+
at_keys = list(globs.amass().keys())
|
|
700
|
+
for keys in at_keys:
|
|
701
|
+
values = globs.amass()[keys][1]
|
|
702
|
+
prop_dict.update({keys: values})
|
|
703
|
+
elif prop == 'group_number': # Uses number of valence electrons
|
|
704
|
+
at_keys = list(globs.amass().keys())
|
|
705
|
+
for keys in at_keys:
|
|
706
|
+
values = globs.amass()[keys][3]
|
|
707
|
+
prop_dict.update({keys: values})
|
|
708
|
+
elif prop == 'ox_nuclear_charge':
|
|
709
|
+
if not modifier:
|
|
710
|
+
print('Error, must give modifier with ox_nuclear_charge')
|
|
711
|
+
return False
|
|
712
|
+
else:
|
|
713
|
+
at_keys = list(globs.amass().keys())
|
|
714
|
+
for keys in at_keys:
|
|
715
|
+
values = globs.amass()[keys][1]
|
|
716
|
+
if keys in list(modifier.keys()):
|
|
717
|
+
values -= float(modifier[keys]) # assumes oxidation state provided (i.e. Fe(IV))
|
|
718
|
+
prop_dict.update({keys: values})
|
|
719
|
+
elif prop == 'polarizability':
|
|
720
|
+
prop_dict = globs.polarizability()
|
|
721
|
+
for i, atoms in enumerate(mol.getAtoms()):
|
|
722
|
+
atom_type = atoms.symbol()
|
|
723
|
+
w[i] = prop_dict[atom_type]
|
|
724
|
+
elif prop == 'ident':
|
|
725
|
+
at_keys = list(globs.amass().keys())
|
|
726
|
+
for keys in at_keys:
|
|
727
|
+
prop_dict.update({keys: 1})
|
|
728
|
+
elif prop == 'topology':
|
|
729
|
+
for i, atoms in enumerate(mol.getAtoms()):
|
|
730
|
+
w[i] = len(mol.getBondedAtomsSmart(i, oct=oct))
|
|
731
|
+
done = True
|
|
732
|
+
elif prop == 'vdwrad':
|
|
733
|
+
prop_dict = globs.vdwrad()
|
|
734
|
+
for i, atoms in enumerate(mol.getAtoms()):
|
|
735
|
+
atom_type = atoms.symbol()
|
|
736
|
+
if atom_type in globs.metalslist():
|
|
737
|
+
w[i] = globs.amass()[atoms.symbol()][2]
|
|
738
|
+
else:
|
|
739
|
+
w[i] = prop_dict[atoms.symbol()]
|
|
740
|
+
done = True
|
|
741
|
+
elif prop == 'bondvalence':
|
|
742
|
+
assert len(mol.getAtoms()) == len(mol.bv_dict)
|
|
743
|
+
for i, atoms in enumerate(mol.getAtoms()):
|
|
744
|
+
w[i] = mol.bv_dict[i]
|
|
745
|
+
done = True
|
|
746
|
+
elif prop == 'num_bonds':
|
|
747
|
+
for i, atom in enumerate(mol.getAtoms()):
|
|
748
|
+
if not atom.ismetal():
|
|
749
|
+
w[i] = globs.bondsdict()[atom.symbol()]
|
|
750
|
+
else:
|
|
751
|
+
w[i] = len(mol.getBondedAtomsSmart(i, oct=True))
|
|
752
|
+
done = True
|
|
753
|
+
elif prop == 'bondvalence_devi':
|
|
754
|
+
assert len(mol.getAtoms()) == len(mol.bvd_dict)
|
|
755
|
+
for i, atoms in enumerate(mol.getAtoms()):
|
|
756
|
+
w[i] = mol.bvd_dict[i]
|
|
757
|
+
done = True
|
|
758
|
+
elif prop == 'bodavrg':
|
|
759
|
+
assert len(mol.getAtoms()) == len(mol.bodavrg_dict)
|
|
760
|
+
for i, atoms in enumerate(mol.getAtoms()):
|
|
761
|
+
w[i] = mol.bodavrg_dict[i]
|
|
762
|
+
done = True
|
|
763
|
+
elif prop == 'bodstd':
|
|
764
|
+
assert len(mol.getAtoms()) == len(mol.bodstd_dict)
|
|
765
|
+
for i, atoms in enumerate(mol.getAtoms()):
|
|
766
|
+
w[i] = mol.bodstd_dict[i]
|
|
767
|
+
done = True
|
|
768
|
+
elif prop == 'charge':
|
|
769
|
+
assert len(mol.getAtoms()) == len(mol.charge_dict)
|
|
770
|
+
for i, atoms in enumerate(mol.getAtoms()):
|
|
771
|
+
w[i] = mol.charge_dict[i]
|
|
772
|
+
done = True
|
|
773
|
+
elif prop in ['A25PBE', 'B1', 'rND_PBE', 'IND_PBE', 'nLUMO_MP2', 'T1',
|
|
774
|
+
'largest_amp', 'TAE', 'C0^2', 'nLUMO_CAS', '%CorrE_orca']:
|
|
775
|
+
for i, atoms in enumerate(mol.getAtoms()):
|
|
776
|
+
w[i] = MRdiag_dict[prop][mol.getAtom(i).symbol()]
|
|
777
|
+
done = True
|
|
778
|
+
if not done:
|
|
779
|
+
for i, atoms in enumerate(mol.getAtoms()):
|
|
780
|
+
w[i] = prop_dict[atoms.symbol()]
|
|
781
|
+
return (w)
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
def full_autocorrelation(mol, prop, d, oct=True, modifier=False, use_dist=False, size_normalize=False, MRdiag_dict={}):
|
|
785
|
+
"""Calculate full scope product autocorrelations (i.e. start at every atom up to depth d)
|
|
786
|
+
|
|
787
|
+
Parameters
|
|
788
|
+
----------
|
|
789
|
+
mol : mol3D
|
|
790
|
+
molecule to calculate full scope RAC over
|
|
791
|
+
prop : str
|
|
792
|
+
Property to evaluete
|
|
793
|
+
d : int
|
|
794
|
+
depth of full scope autocorrelation
|
|
795
|
+
oct : bool, optional
|
|
796
|
+
Is octahedral flag, by default True
|
|
797
|
+
modifier : bool, optional
|
|
798
|
+
Use ox modifier, by default False
|
|
799
|
+
use_dist : bool, optional
|
|
800
|
+
Weigh autocorrelation by distance of atoms from each other, by default False
|
|
801
|
+
size_normalize : bool, optional
|
|
802
|
+
Whether or not to normalize by the number of atoms.
|
|
803
|
+
MRdiag_dict : dict, optional
|
|
804
|
+
Keys are ligand identifiers, values are MR diagnostics like E_corr.
|
|
805
|
+
|
|
806
|
+
Returns
|
|
807
|
+
-------
|
|
808
|
+
autocorrelation_vector : list
|
|
809
|
+
full scope product autocorrelation values
|
|
810
|
+
|
|
811
|
+
"""
|
|
812
|
+
w = construct_property_vector(mol, prop, oct=oct, modifier=modifier, MRdiag_dict=MRdiag_dict)
|
|
813
|
+
index_set = list(range(0, mol.natoms))
|
|
814
|
+
autocorrelation_vector = np.zeros(d + 1)
|
|
815
|
+
for centers in index_set:
|
|
816
|
+
autocorrelation_vector += autocorrelation(mol, w, centers, d, oct=oct, use_dist=use_dist,
|
|
817
|
+
size_normalize=size_normalize)
|
|
818
|
+
return (autocorrelation_vector)
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
def full_autocorrelation_derivative(mol, prop, d, oct=True, modifier=False):
|
|
822
|
+
"""Calculate full scope product autocorrelations derivatives
|
|
823
|
+
(i.e. start at every atom up to depth d)
|
|
824
|
+
|
|
825
|
+
Parameters
|
|
826
|
+
----------
|
|
827
|
+
mol : mol3D
|
|
828
|
+
molecule to calculate full scope RAC over
|
|
829
|
+
prop : str
|
|
830
|
+
Property to evaluate
|
|
831
|
+
d : int
|
|
832
|
+
depth of scope to evalue
|
|
833
|
+
oct : bool, optional
|
|
834
|
+
Is octahedral flag, by default True
|
|
835
|
+
use_dist : bool, optional
|
|
836
|
+
Weigh autocorrelation by physical distance of atom from original, by default False
|
|
837
|
+
modifier : bool, optional
|
|
838
|
+
Use ox modifier, by default False
|
|
839
|
+
|
|
840
|
+
Returns
|
|
841
|
+
-------
|
|
842
|
+
autocorrelation_derivative_mat : list
|
|
843
|
+
full scope autocorrelation derivative matrix
|
|
844
|
+
|
|
845
|
+
"""
|
|
846
|
+
w = construct_property_vector(mol, prop, oct=oct, modifier=modifier)
|
|
847
|
+
index_set = list(range(0, mol.natoms))
|
|
848
|
+
autocorrelation_derivative_mat = np.zeros((d + 1, mol.natoms))
|
|
849
|
+
for centers in index_set:
|
|
850
|
+
autocorrelation_derivative_mat += autocorrelation_derivative(mol, w, centers, d, oct=oct)
|
|
851
|
+
return (autocorrelation_derivative_mat)
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
def generate_full_complex_autocorrelations(mol, loud,
|
|
855
|
+
depth=4, oct=True,
|
|
856
|
+
flag_name=False, modifier=False,
|
|
857
|
+
use_dist=False, size_normalize=False,
|
|
858
|
+
NumB=False, Gval=False, polarizability=False,
|
|
859
|
+
MRdiag_dict={}):
|
|
860
|
+
"""Utility to manage full complex autocorrelation generation and labeling.
|
|
861
|
+
|
|
862
|
+
Parameters
|
|
863
|
+
----------
|
|
864
|
+
mol : mol3D
|
|
865
|
+
molecule used for full scope
|
|
866
|
+
loud : bool
|
|
867
|
+
print debugging information
|
|
868
|
+
depth : int, optional
|
|
869
|
+
depth of autocorrelations to evaluate, by default 4
|
|
870
|
+
oct : bool, optional
|
|
871
|
+
is an octahedral complex, by default True
|
|
872
|
+
flag_name : bool, optional
|
|
873
|
+
Prepend "f_all" to results to track full complex, by default False
|
|
874
|
+
modifier : bool, optional
|
|
875
|
+
Use ox_modifier on metal charge, by default False
|
|
876
|
+
use_dist : bool, optional
|
|
877
|
+
Weigh autocorrelations by interatomic distances, by default False
|
|
878
|
+
size_normalize : bool, optional
|
|
879
|
+
Whether or not to normalize by the number of atoms.
|
|
880
|
+
NumB : bool, optional
|
|
881
|
+
use number of bonds as RAC, by default False
|
|
882
|
+
Gval : bool, optional
|
|
883
|
+
use G value as RAC, by default False
|
|
884
|
+
polarizability : bool, optional
|
|
885
|
+
Use polarizability (alpha) as RAC, by default False
|
|
886
|
+
MRdiag_dict : dict, optional
|
|
887
|
+
Keys are ligand identifiers, values are MR diagnostics like E_corr.
|
|
888
|
+
|
|
889
|
+
Returns
|
|
890
|
+
-------
|
|
891
|
+
results_dictionary : dict
|
|
892
|
+
formatted dictionary with {'colnames': colnames, 'results': result}
|
|
893
|
+
|
|
894
|
+
"""
|
|
895
|
+
result = list()
|
|
896
|
+
colnames = []
|
|
897
|
+
allowed_strings = ['electronegativity', 'nuclear_charge', 'ident', 'topology', 'size']
|
|
898
|
+
labels_strings = ['chi', 'Z', 'I', 'T', 'S']
|
|
899
|
+
if Gval:
|
|
900
|
+
allowed_strings += ['group_number']
|
|
901
|
+
labels_strings += ['Gval']
|
|
902
|
+
if NumB:
|
|
903
|
+
allowed_strings += ["num_bonds"]
|
|
904
|
+
labels_strings += ["NumB"]
|
|
905
|
+
if polarizability:
|
|
906
|
+
allowed_strings += ["polarizability"]
|
|
907
|
+
labels_strings += ["alpha"]
|
|
908
|
+
if len(MRdiag_dict):
|
|
909
|
+
allowed_strings, labels_strings = [], []
|
|
910
|
+
for k in list(MRdiag_dict):
|
|
911
|
+
allowed_strings += [k]
|
|
912
|
+
labels_strings += [k]
|
|
913
|
+
for ii, properties in enumerate(allowed_strings):
|
|
914
|
+
metal_ac = full_autocorrelation(mol, properties, depth,
|
|
915
|
+
oct=oct, modifier=modifier,
|
|
916
|
+
use_dist=use_dist, size_normalize=size_normalize, MRdiag_dict=MRdiag_dict)
|
|
917
|
+
this_colnames = []
|
|
918
|
+
for i in range(0, depth + 1):
|
|
919
|
+
this_colnames.append(labels_strings[ii] + '-' + str(i))
|
|
920
|
+
colnames.append(this_colnames)
|
|
921
|
+
result.append(metal_ac)
|
|
922
|
+
if flag_name:
|
|
923
|
+
results_dictionary = {'colnames': colnames, 'results_f_all': result}
|
|
924
|
+
else:
|
|
925
|
+
results_dictionary = {'colnames': colnames, 'results': result}
|
|
926
|
+
return results_dictionary
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
def generate_full_complex_autocorrelation_derivatives(mol, loud, depth=4, oct=True, flag_name=False,
|
|
930
|
+
modifier=False, NumB=False, Gval=False):
|
|
931
|
+
"""Utility to manage full complex autocorrelation derivative generation and labeling.
|
|
932
|
+
|
|
933
|
+
Parameters
|
|
934
|
+
----------
|
|
935
|
+
mol : mol3D
|
|
936
|
+
molecule used for full scope
|
|
937
|
+
loud : bool
|
|
938
|
+
print debugging information
|
|
939
|
+
depth : int, optional
|
|
940
|
+
depth of autocorrelations to evaluate, by default 4
|
|
941
|
+
oct : bool, optional
|
|
942
|
+
is an octahedral complex, by default True
|
|
943
|
+
flag_name : bool, optional
|
|
944
|
+
Prepend "f_all" to results to track full complex, by default False
|
|
945
|
+
modifier : bool, optional
|
|
946
|
+
Use ox_modifier on metal charge, by default False
|
|
947
|
+
NumB : bool, optional
|
|
948
|
+
use number of bonds as RAC, by default False
|
|
949
|
+
Gval : bool, optional
|
|
950
|
+
use G value as RAC, by default False
|
|
951
|
+
|
|
952
|
+
Returns
|
|
953
|
+
-------
|
|
954
|
+
results_dictionary : dict
|
|
955
|
+
formatted dictionary with {'colnames': colnames, 'results': result}
|
|
956
|
+
|
|
957
|
+
"""
|
|
958
|
+
result = None
|
|
959
|
+
colnames = []
|
|
960
|
+
allowed_strings = ['electronegativity', 'nuclear_charge', 'ident', 'topology', 'size']
|
|
961
|
+
labels_strings = ['chi', 'Z', 'I', 'T', 'S']
|
|
962
|
+
if Gval:
|
|
963
|
+
allowed_strings += ['group_number']
|
|
964
|
+
labels_strings += ['Gval']
|
|
965
|
+
if NumB:
|
|
966
|
+
allowed_strings += ["num_bonds"]
|
|
967
|
+
labels_strings += ["NumB"]
|
|
968
|
+
for ii, properties in enumerate(allowed_strings):
|
|
969
|
+
f_ac_der = full_autocorrelation_derivative(mol, properties, depth, oct=oct, modifier=modifier)
|
|
970
|
+
for i in range(0, depth + 1):
|
|
971
|
+
colnames.append(['d' + labels_strings[ii] + '-' + str(i) + '/d' + labels_strings[ii] + str(j) for j in
|
|
972
|
+
range(0, mol.natoms)])
|
|
973
|
+
# colnames.append(this_colnames)
|
|
974
|
+
if result is None:
|
|
975
|
+
result = f_ac_der
|
|
976
|
+
else:
|
|
977
|
+
result = np.row_stack([result, f_ac_der])
|
|
978
|
+
if flag_name:
|
|
979
|
+
results_dictionary = {'colnames': colnames, 'results_f_all': result}
|
|
980
|
+
else:
|
|
981
|
+
results_dictionary = {'colnames': colnames, 'results': result}
|
|
982
|
+
return results_dictionary
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
def atom_only_autocorrelation(mol, prop, d, atomIdx, oct=True, use_dist=False, size_normalize=False, MRdiag_dict={}):
|
|
986
|
+
"""Calculate product autocorrelation vectors from a given atom or list of atoms
|
|
987
|
+
(e.g. up to depth 4 from the connecting atoms)
|
|
988
|
+
|
|
989
|
+
Parameters
|
|
990
|
+
----------
|
|
991
|
+
mol : mol3D
|
|
992
|
+
molecule to calculate atom-only autocorrelations from
|
|
993
|
+
prop : str
|
|
994
|
+
property to calculate
|
|
995
|
+
d : int
|
|
996
|
+
depth to calculate derivatives over
|
|
997
|
+
atomIdx : int or list
|
|
998
|
+
atoms from which the autocorrelation vector should be centered
|
|
999
|
+
oct : bool, optional
|
|
1000
|
+
use octahedral flag, by default True
|
|
1001
|
+
use_dist : bool, optional
|
|
1002
|
+
Weigh autocorrelation by physical distance of atom from original, by default False
|
|
1003
|
+
size_normalize : bool, optional
|
|
1004
|
+
Whether or not to normalize by the number of atoms.
|
|
1005
|
+
MRdiag_dict : dict, optional
|
|
1006
|
+
Keys are ligand identifiers, values are MR diagnostics like E_corr.
|
|
1007
|
+
|
|
1008
|
+
Returns
|
|
1009
|
+
-------
|
|
1010
|
+
autocorrelation_vector : list
|
|
1011
|
+
list of atom-only autocorrelations
|
|
1012
|
+
|
|
1013
|
+
"""
|
|
1014
|
+
w = construct_property_vector(mol, prop, oct, MRdiag_dict=MRdiag_dict)
|
|
1015
|
+
autocorrelation_vector = np.zeros(d + 1)
|
|
1016
|
+
if hasattr(atomIdx, "__len__"):
|
|
1017
|
+
for elements in atomIdx:
|
|
1018
|
+
autocorrelation_vector += autocorrelation(mol, w, elements, d, oct=oct, use_dist=use_dist,
|
|
1019
|
+
size_normalize=size_normalize)
|
|
1020
|
+
autocorrelation_vector = np.divide(autocorrelation_vector, len(atomIdx))
|
|
1021
|
+
else:
|
|
1022
|
+
autocorrelation_vector += autocorrelation(mol, w, atomIdx, d, oct=oct, use_dist=use_dist,
|
|
1023
|
+
size_normalize=size_normalize)
|
|
1024
|
+
return (autocorrelation_vector)
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
def atom_only_autocorrelation_derivative(mol, prop, d, atomIdx, oct=True):
|
|
1028
|
+
"""Calculate product autocorrelation derivative vectors from a given atom or list of atoms
|
|
1029
|
+
(e.g. up to depth 4 from the connecting atoms)
|
|
1030
|
+
|
|
1031
|
+
Parameters
|
|
1032
|
+
----------
|
|
1033
|
+
mol : mol3D
|
|
1034
|
+
molecule to calculate atom-only autocorrelation derivatives from
|
|
1035
|
+
prop : str
|
|
1036
|
+
property to calculate
|
|
1037
|
+
d : int
|
|
1038
|
+
depth to calculate derivatives over
|
|
1039
|
+
atomIdx : int or list
|
|
1040
|
+
atoms from which the autocorrelation vector should be centered
|
|
1041
|
+
oct : bool, optional
|
|
1042
|
+
use octahedral flag, by default True
|
|
1043
|
+
|
|
1044
|
+
Returns
|
|
1045
|
+
-------
|
|
1046
|
+
autocorrelation_vector : list
|
|
1047
|
+
list of atom-only autocorrelation derivatives
|
|
1048
|
+
|
|
1049
|
+
"""
|
|
1050
|
+
w = construct_property_vector(mol, prop, oct)
|
|
1051
|
+
autocorrelation_derivative_mat = np.zeros((d + 1, mol.natoms))
|
|
1052
|
+
if hasattr(atomIdx, "__len__"):
|
|
1053
|
+
for elements in atomIdx:
|
|
1054
|
+
autocorrelation_derivative_mat += autocorrelation_derivative(mol, w, elements, d, oct=oct)
|
|
1055
|
+
autocorrelation_derivative_mat = np.divide(autocorrelation_derivative_mat, len(atomIdx))
|
|
1056
|
+
else:
|
|
1057
|
+
autocorrelation_derivative_mat += autocorrelation_derivative(mol, w, atomIdx, d, oct=oct)
|
|
1058
|
+
return (autocorrelation_derivative_mat)
|
|
1059
|
+
|
|
1060
|
+
|
|
1061
|
+
def metal_only_autocorrelation(mol, prop, d, oct=True, metal_ind=None,
|
|
1062
|
+
func=autocorrelation, modifier=False, use_dist=False, size_normalize=False, MRdiag_dict={}):
|
|
1063
|
+
"""Calculate the metal_only product autocorrelations
|
|
1064
|
+
(e.g. metal-centered atom-only RACs)
|
|
1065
|
+
|
|
1066
|
+
Parameters
|
|
1067
|
+
----------
|
|
1068
|
+
mol : mol3D
|
|
1069
|
+
molecule with metal to calculate MC product RACs for
|
|
1070
|
+
prop : str
|
|
1071
|
+
Property to evaluate
|
|
1072
|
+
d : int
|
|
1073
|
+
depth of autocorrelation
|
|
1074
|
+
oct : bool, optional
|
|
1075
|
+
use octahedral geometry evaluations, by default True
|
|
1076
|
+
metal_ind : bool, optional
|
|
1077
|
+
index of the metal atom to generate property, by default False
|
|
1078
|
+
func : function, optional
|
|
1079
|
+
which function to evaluate mc-racs by, by default autocorrelation
|
|
1080
|
+
modifier : bool, optional
|
|
1081
|
+
use ox_modifier, by default False
|
|
1082
|
+
use_dist : bool, optional
|
|
1083
|
+
Weigh autocorrelation by physical distance of atom from original, by default False
|
|
1084
|
+
size_normalize : bool, optional
|
|
1085
|
+
Whether or not to normalize by the number of atoms.
|
|
1086
|
+
MRdiag_dict : dict, optional
|
|
1087
|
+
Keys are ligand identifiers, values are MR diagnostics like E_corr.
|
|
1088
|
+
|
|
1089
|
+
Returns
|
|
1090
|
+
-------
|
|
1091
|
+
autocorrelation_vector: list
|
|
1092
|
+
MC atom-only RACs vector
|
|
1093
|
+
|
|
1094
|
+
"""
|
|
1095
|
+
try:
|
|
1096
|
+
if not isinstance(metal_ind, int):
|
|
1097
|
+
metal_ind = mol.findMetal()[0]
|
|
1098
|
+
w = construct_property_vector(mol, prop, oct=oct, modifier=modifier, MRdiag_dict=MRdiag_dict)
|
|
1099
|
+
autocorrelation_vector = func(mol, w, metal_ind, d, oct=oct, use_dist=use_dist, size_normalize=size_normalize)
|
|
1100
|
+
except IndexError:
|
|
1101
|
+
print('Error, no metal found in mol object!')
|
|
1102
|
+
return False
|
|
1103
|
+
return (autocorrelation_vector)
|
|
1104
|
+
|
|
1105
|
+
|
|
1106
|
+
def metal_only_autocorrelation_derivative(mol, prop, d, oct=True, metal_ind=None,
|
|
1107
|
+
func=autocorrelation_derivative, modifier=False):
|
|
1108
|
+
"""Calculate the metal_only product autocorrelation derivatives
|
|
1109
|
+
(e.g. metal-centered atom-only RAC derivatives)
|
|
1110
|
+
|
|
1111
|
+
Parameters
|
|
1112
|
+
----------
|
|
1113
|
+
mol : mol3D
|
|
1114
|
+
molecule with metal to calculate MC product RAC derivatives for
|
|
1115
|
+
prop : str
|
|
1116
|
+
Property to evaluate
|
|
1117
|
+
d : int
|
|
1118
|
+
depth of autocorrelation
|
|
1119
|
+
oct : bool, optional
|
|
1120
|
+
use octahedral geometry evaluations, by default True
|
|
1121
|
+
metal_ind : bool, optional
|
|
1122
|
+
index (int) of metal atom to consider, default False
|
|
1123
|
+
func : function, optional
|
|
1124
|
+
which function to evaluate mc-racs by, by default autocorrelation_derivative
|
|
1125
|
+
modifier : bool, optional
|
|
1126
|
+
use ox_modifier, by default False
|
|
1127
|
+
|
|
1128
|
+
Returns
|
|
1129
|
+
-------
|
|
1130
|
+
autocorrelation_vector: list
|
|
1131
|
+
MC atom-only RAC derivatives vector (matrix)
|
|
1132
|
+
|
|
1133
|
+
"""
|
|
1134
|
+
try:
|
|
1135
|
+
if not isinstance(metal_ind, int):
|
|
1136
|
+
metal_ind = mol.findMetal()[0]
|
|
1137
|
+
w = construct_property_vector(mol, prop, oct=oct, modifier=modifier)
|
|
1138
|
+
autocorrelation_vector_derivative = func(mol, w, metal_ind, d, oct=oct)
|
|
1139
|
+
except IndexError:
|
|
1140
|
+
print('Error, no metal found in mol object!')
|
|
1141
|
+
return False
|
|
1142
|
+
return (autocorrelation_vector_derivative)
|
|
1143
|
+
|
|
1144
|
+
|
|
1145
|
+
def atom_only_deltametric(mol, prop, d, atomIdx, oct=True, modifier=False,
|
|
1146
|
+
use_dist=False, size_normalize=False, MRdiag_dict={}):
|
|
1147
|
+
"""Calculate deltametric autocorrelation vectors from a given atom or list of atoms
|
|
1148
|
+
(e.g. up to depth 4 from the connecting atoms)
|
|
1149
|
+
|
|
1150
|
+
Parameters
|
|
1151
|
+
----------
|
|
1152
|
+
mol : mol3D
|
|
1153
|
+
molecule to calculate atom-only autocorrelations from
|
|
1154
|
+
prop : str
|
|
1155
|
+
property to calculate
|
|
1156
|
+
d : int
|
|
1157
|
+
depth to calculate derivatives over
|
|
1158
|
+
atomIdx : int or list
|
|
1159
|
+
atoms from which the autocorrelation vector should be centered
|
|
1160
|
+
oct : bool, optional
|
|
1161
|
+
use octahedral flag, by default True
|
|
1162
|
+
modifier : TODO
|
|
1163
|
+
use_dist : bool, optional
|
|
1164
|
+
Weigh autocorrelation by physical distance of atom from original, by default False
|
|
1165
|
+
size_normalize : bool, optional
|
|
1166
|
+
Whether or not to normalize by the number of atoms.
|
|
1167
|
+
MRdiag_dict : dict, optional
|
|
1168
|
+
Keys are ligand identifiers, values are MR diagnostics like E_corr.
|
|
1169
|
+
|
|
1170
|
+
Returns
|
|
1171
|
+
-------
|
|
1172
|
+
autocorrelation_vector : list
|
|
1173
|
+
list of atom-only deltametric autocorrelations
|
|
1174
|
+
|
|
1175
|
+
"""
|
|
1176
|
+
w = construct_property_vector(mol, prop, oct=oct, modifier=modifier, MRdiag_dict=MRdiag_dict)
|
|
1177
|
+
deltametric_vector = np.zeros(d + 1)
|
|
1178
|
+
if hasattr(atomIdx, "__len__"):
|
|
1179
|
+
for elements in atomIdx:
|
|
1180
|
+
deltametric_vector += deltametric(mol, w, elements, d, oct=oct, use_dist=use_dist, size_normalize=size_normalize)
|
|
1181
|
+
deltametric_vector = np.divide(deltametric_vector, len(atomIdx))
|
|
1182
|
+
else:
|
|
1183
|
+
deltametric_vector += deltametric(mol, w, atomIdx, d, oct=oct, use_dist=use_dist, size_normalize=size_normalize)
|
|
1184
|
+
return (deltametric_vector)
|
|
1185
|
+
|
|
1186
|
+
|
|
1187
|
+
def atom_only_deltametric_derivative(mol, prop, d, atomIdx, oct=True, modifier=False):
|
|
1188
|
+
"""Calculate deltametric autocorrelation derivative vectors
|
|
1189
|
+
from a given atom or list of atoms
|
|
1190
|
+
(e.g. up to depth 4 from the connecting atoms)
|
|
1191
|
+
|
|
1192
|
+
Parameters
|
|
1193
|
+
----------
|
|
1194
|
+
mol : mol3D
|
|
1195
|
+
molecule to calculate atom-only deltametric autocorrelation derivatives from
|
|
1196
|
+
prop : str
|
|
1197
|
+
property to calculate
|
|
1198
|
+
d : int
|
|
1199
|
+
depth to calculate derivatives over
|
|
1200
|
+
atomIdx : int or list
|
|
1201
|
+
atoms from which the autocorrelation vector should be centered
|
|
1202
|
+
oct : bool, optional
|
|
1203
|
+
use octahedral flag, by default True
|
|
1204
|
+
modifier : bool, optional
|
|
1205
|
+
use ox_modifier, by default False
|
|
1206
|
+
|
|
1207
|
+
Returns
|
|
1208
|
+
-------
|
|
1209
|
+
deltametric_derivative_mat : list
|
|
1210
|
+
matrix of atom-only deltametric autocorrelation derivatives
|
|
1211
|
+
|
|
1212
|
+
"""
|
|
1213
|
+
w = construct_property_vector(mol, prop, oct=oct, modifier=modifier)
|
|
1214
|
+
deltametric_derivative_mat = np.zeros((d + 1, mol.natoms))
|
|
1215
|
+
if hasattr(atomIdx, "__len__"):
|
|
1216
|
+
for elements in atomIdx:
|
|
1217
|
+
deltametric_derivative_mat += deltametric_derivative(mol, w, elements, d, oct=oct)
|
|
1218
|
+
deltametric_derivative_mat = np.divide(deltametric_derivative_mat, len(atomIdx))
|
|
1219
|
+
else:
|
|
1220
|
+
|
|
1221
|
+
deltametric_derivative_mat += deltametric_derivative(mol, w, atomIdx, d, oct=oct)
|
|
1222
|
+
return (deltametric_derivative_mat)
|
|
1223
|
+
|
|
1224
|
+
|
|
1225
|
+
def metal_only_deltametric_derivative(mol, prop, d, oct=True, metal_ind=None,
|
|
1226
|
+
func=deltametric_derivative, modifier=False):
|
|
1227
|
+
"""Gets the metal atom-only deltametric derivatives
|
|
1228
|
+
|
|
1229
|
+
Parameters
|
|
1230
|
+
----------
|
|
1231
|
+
mol : mol3D
|
|
1232
|
+
molecule with metal to calculate MC deltametric RAC derivatives for
|
|
1233
|
+
prop : str
|
|
1234
|
+
Property to evaluate
|
|
1235
|
+
d : int
|
|
1236
|
+
depth of autocorrelation
|
|
1237
|
+
oct : bool, optional
|
|
1238
|
+
use octahedral geometry evaluations, by default True
|
|
1239
|
+
metal_ind : bool, optional
|
|
1240
|
+
index of metal atom to consider, by default False
|
|
1241
|
+
func : function, optional
|
|
1242
|
+
which function to evaluate mc-racs by, by default deltametric_derivative
|
|
1243
|
+
modifier : bool, optional
|
|
1244
|
+
use ox_modifier, by default False
|
|
1245
|
+
|
|
1246
|
+
Returns
|
|
1247
|
+
-------
|
|
1248
|
+
deltametric_vector_derivative : list
|
|
1249
|
+
metal-centerted deltametric derivatives vector (matrix)
|
|
1250
|
+
|
|
1251
|
+
"""
|
|
1252
|
+
try:
|
|
1253
|
+
if not isinstance(metal_ind, int):
|
|
1254
|
+
metal_ind = mol.findMetal()[0]
|
|
1255
|
+
w = construct_property_vector(mol, prop, oct=oct, modifier=modifier)
|
|
1256
|
+
deltametric_vector_derivative = func(mol, w, metal_ind, d, oct=oct)
|
|
1257
|
+
except IndexError:
|
|
1258
|
+
print('Error, no metal found in mol object!')
|
|
1259
|
+
return False
|
|
1260
|
+
return (deltametric_vector_derivative)
|
|
1261
|
+
|
|
1262
|
+
|
|
1263
|
+
def metal_only_deltametric(mol, prop, d, oct=True, metal_ind=None,
|
|
1264
|
+
func=deltametric, modifier=False, use_dist=False, size_normalize=False, MRdiag_dict={}):
|
|
1265
|
+
"""Gets the metal atom-only deltametric RAC
|
|
1266
|
+
|
|
1267
|
+
Parameters
|
|
1268
|
+
----------
|
|
1269
|
+
mol : mol3D
|
|
1270
|
+
molecule with metal to calculate MC deltametric RACs
|
|
1271
|
+
prop : str
|
|
1272
|
+
Property to evaluate
|
|
1273
|
+
d : int
|
|
1274
|
+
depth of autocorrelation
|
|
1275
|
+
oct : bool, optional
|
|
1276
|
+
use octahedral geometry evaluations, by default True
|
|
1277
|
+
metal_ind : bool, optional
|
|
1278
|
+
index of metal atom to consider, by default False
|
|
1279
|
+
func : function, optional
|
|
1280
|
+
which function to evaluate mc-racs by, by default deltametric
|
|
1281
|
+
modifier : bool, optional
|
|
1282
|
+
use ox_modifier, by default False
|
|
1283
|
+
use_dist : bool, optional
|
|
1284
|
+
Weigh autocorrelation by physical distance of atom from original, by default False
|
|
1285
|
+
size_normalize : bool, optional
|
|
1286
|
+
Whether or not to normalize by the number of atoms.
|
|
1287
|
+
MRdiag_dict : dict, optional
|
|
1288
|
+
Keys are ligand identifiers, values are MR diagnostics like E_corr.
|
|
1289
|
+
|
|
1290
|
+
Returns
|
|
1291
|
+
-------
|
|
1292
|
+
deltametric_vector : list
|
|
1293
|
+
metal-centerted deltametric RAC vector
|
|
1294
|
+
|
|
1295
|
+
"""
|
|
1296
|
+
try:
|
|
1297
|
+
if not isinstance(metal_ind, int):
|
|
1298
|
+
metal_ind = mol.findMetal()[0]
|
|
1299
|
+
w = construct_property_vector(mol, prop, oct=oct, modifier=modifier, MRdiag_dict=MRdiag_dict)
|
|
1300
|
+
deltametric_vector = func(mol, w, metal_ind, d, oct=oct, use_dist=use_dist, size_normalize=size_normalize)
|
|
1301
|
+
except IndexError:
|
|
1302
|
+
print('Error, no metal found in mol object!')
|
|
1303
|
+
return False
|
|
1304
|
+
return (deltametric_vector)
|
|
1305
|
+
|
|
1306
|
+
|
|
1307
|
+
# Get the ligand_misc_descriptors
|
|
1308
|
+
# custom_ligand_dict.keys() must be eq_ligands_list, ax_ligand_list
|
|
1309
|
+
# # ax_con_int_list ,eq_con_int_list
|
|
1310
|
+
# @param mol, mol3D class
|
|
1311
|
+
# @param loud, bool, print out statements for debugging
|
|
1312
|
+
# @return results_dictionary, vector, ax vs eq. charge (from OBMol) and denticity
|
|
1313
|
+
def generate_all_ligand_misc(mol, loud, custom_ligand_dict=False, smiles_charge=False):
|
|
1314
|
+
"""Get the ligand_misc_descriptors (axial vs. equatorial
|
|
1315
|
+
charge (from OBMol) and denticity)
|
|
1316
|
+
|
|
1317
|
+
Parameters
|
|
1318
|
+
----------
|
|
1319
|
+
mol : mol3D
|
|
1320
|
+
molecule to get the ligand_misc descriptors from
|
|
1321
|
+
loud : bool
|
|
1322
|
+
print debugging information
|
|
1323
|
+
custom_ligand_dict : bool, optional
|
|
1324
|
+
custom_ligand_dictionary if passed, by default False
|
|
1325
|
+
smiles_charge : bool, optional
|
|
1326
|
+
Whether or not to use the smiles charge assignent, default is False
|
|
1327
|
+
|
|
1328
|
+
Returns
|
|
1329
|
+
-------
|
|
1330
|
+
results_dictionary : dict
|
|
1331
|
+
Labels and results of ligand_misc RACs - {'colnames': colnames,
|
|
1332
|
+
'result_ax': result_ax, 'result_eq': result_eq}
|
|
1333
|
+
|
|
1334
|
+
"""
|
|
1335
|
+
result_ax = list()
|
|
1336
|
+
result_eq = list()
|
|
1337
|
+
colnames = ['dent', 'charge']
|
|
1338
|
+
if not custom_ligand_dict:
|
|
1339
|
+
liglist, ligdents, ligcons = ligand_breakdown(mol, BondedOct=True) # Complex is assumed to be octahedral
|
|
1340
|
+
ax_ligand_list, eq_ligand_list, ax_natoms_list, eq_natoms_list, ax_con_int_list, eq_con_int_list, \
|
|
1341
|
+
ax_con_list, eq_con_list, built_ligand_list = ligand_assign(
|
|
1342
|
+
mol, liglist, ligdents, ligcons, loud)
|
|
1343
|
+
else:
|
|
1344
|
+
ax_ligand_list = custom_ligand_dict["ax_ligand_list"]
|
|
1345
|
+
eq_ligand_list = custom_ligand_dict["eq_ligand_list"]
|
|
1346
|
+
# ax_con_int_list = custom_ligand_dict["ax_con_int_list"]
|
|
1347
|
+
# eq_con_int_list = custom_ligand_dict["eq_con_int_list"]
|
|
1348
|
+
# count ligands
|
|
1349
|
+
n_ax = len(ax_ligand_list)
|
|
1350
|
+
n_eq = len(eq_ligand_list)
|
|
1351
|
+
# allocate
|
|
1352
|
+
result_ax_dent = False
|
|
1353
|
+
result_eq_dent = False
|
|
1354
|
+
result_ax_charge = False
|
|
1355
|
+
result_eq_charge = False
|
|
1356
|
+
# loop over axial ligands
|
|
1357
|
+
if n_ax > 0:
|
|
1358
|
+
for i in range(0, n_ax):
|
|
1359
|
+
if mol.bo_dict:
|
|
1360
|
+
ax_ligand_list[i].mol.convert2OBMol2()
|
|
1361
|
+
else:
|
|
1362
|
+
ax_ligand_list[i].mol.convert2OBMol()
|
|
1363
|
+
if not (i == 0):
|
|
1364
|
+
result_ax_dent += ax_ligand_list[i].dent
|
|
1365
|
+
if smiles_charge:
|
|
1366
|
+
result_ax_charge += ax_ligand_list[i].mol.get_smilesOBmol_charge()
|
|
1367
|
+
else:
|
|
1368
|
+
result_ax_charge += ax_ligand_list[i].mol.OBMol.GetTotalCharge()
|
|
1369
|
+
else:
|
|
1370
|
+
result_ax_dent = ax_ligand_list[i].dent
|
|
1371
|
+
if smiles_charge:
|
|
1372
|
+
result_ax_charge = ax_ligand_list[i].mol.get_smilesOBmol_charge()
|
|
1373
|
+
else:
|
|
1374
|
+
result_ax_charge = ax_ligand_list[i].mol.OBMol.GetTotalCharge()
|
|
1375
|
+
# average axial results
|
|
1376
|
+
result_ax_dent = np.divide(result_ax_dent, n_ax)
|
|
1377
|
+
result_ax_charge = np.divide(result_ax_charge, n_ax)
|
|
1378
|
+
# loop over eq ligands
|
|
1379
|
+
if n_eq > 0:
|
|
1380
|
+
for i in range(0, n_eq):
|
|
1381
|
+
if mol.bo_dict:
|
|
1382
|
+
eq_ligand_list[i].mol.convert2OBMol2()
|
|
1383
|
+
else:
|
|
1384
|
+
eq_ligand_list[i].mol.convert2OBMol()
|
|
1385
|
+
if not (i == 0):
|
|
1386
|
+
result_eq_dent += eq_ligand_list[i].dent
|
|
1387
|
+
if smiles_charge:
|
|
1388
|
+
result_eq_charge += eq_ligand_list[i].mol.get_smilesOBmol_charge()
|
|
1389
|
+
else:
|
|
1390
|
+
result_eq_charge += eq_ligand_list[i].mol.OBMol.GetTotalCharge()
|
|
1391
|
+
else:
|
|
1392
|
+
result_eq_dent = eq_ligand_list[i].dent
|
|
1393
|
+
if smiles_charge:
|
|
1394
|
+
result_eq_charge = eq_ligand_list[i].mol.get_smilesOBmol_charge()
|
|
1395
|
+
else:
|
|
1396
|
+
result_eq_charge = eq_ligand_list[i].mol.OBMol.GetTotalCharge()
|
|
1397
|
+
# average eq results
|
|
1398
|
+
result_eq_dent = np.divide(result_eq_dent, n_eq)
|
|
1399
|
+
result_eq_charge = np.divide(result_eq_charge, n_eq)
|
|
1400
|
+
# save the results
|
|
1401
|
+
result_ax.append(result_ax_dent)
|
|
1402
|
+
result_ax.append(result_ax_charge)
|
|
1403
|
+
result_eq.append(result_eq_dent)
|
|
1404
|
+
result_eq.append(result_eq_charge)
|
|
1405
|
+
results_dictionary = {'colnames': colnames,
|
|
1406
|
+
'result_ax': result_ax, 'result_eq': result_eq}
|
|
1407
|
+
return results_dictionary
|
|
1408
|
+
|
|
1409
|
+
|
|
1410
|
+
def generate_all_ligand_autocorrelations(mol, loud, depth=4, flag_name=False,
|
|
1411
|
+
custom_ligand_dict=False, NumB=False, Gval=False,
|
|
1412
|
+
use_dist=False, size_normalize=False, MRdiag_dict={}):
|
|
1413
|
+
"""Utility for generating all ligand-based product autocorrelations for a complex
|
|
1414
|
+
|
|
1415
|
+
Parameters
|
|
1416
|
+
----------
|
|
1417
|
+
mol : mol3D
|
|
1418
|
+
molecule to get lc-RACs for
|
|
1419
|
+
loud : bool
|
|
1420
|
+
print debugging information
|
|
1421
|
+
depth : int, optional
|
|
1422
|
+
depth of RACs to calculate, by default 4
|
|
1423
|
+
flag_name : bool, optional
|
|
1424
|
+
Shift RAC names slightly, by default False
|
|
1425
|
+
custom_ligand_dict : bool, optional
|
|
1426
|
+
Dict of ligands if passed - see generate_descriptor_vector, by default False
|
|
1427
|
+
NumB : bool, optional
|
|
1428
|
+
Use number of bonds as descriptor property, by default False
|
|
1429
|
+
Gval : bool, optional
|
|
1430
|
+
Use G value as descriptor property, by default False
|
|
1431
|
+
use_dist : bool, optional
|
|
1432
|
+
Weigh autocorrelation by physical distance of atom from original, by default False
|
|
1433
|
+
size_normalize : bool, optional
|
|
1434
|
+
Whether or not to normalize by the number of atoms.
|
|
1435
|
+
MRdiag_dict : dict, optional
|
|
1436
|
+
Keys are ligand identifiers, values are MR diagnostics like E_corr.
|
|
1437
|
+
|
|
1438
|
+
Returns
|
|
1439
|
+
-------
|
|
1440
|
+
results_dictionary: dict
|
|
1441
|
+
Dictionary of all geo-based ligand product descriptors (both full and connecting atom scopes) -
|
|
1442
|
+
{'colnames': colnames, 'result_ax_full': result_ax_full, 'result_eq_full': result_eq_full,
|
|
1443
|
+
'result_ax_con': result_ax_con, 'result_eq_con': result_eq_con}
|
|
1444
|
+
|
|
1445
|
+
"""
|
|
1446
|
+
allowed_strings = ['electronegativity', 'nuclear_charge', 'ident', 'topology', 'size']
|
|
1447
|
+
labels_strings = ['chi', 'Z', 'I', 'T', 'S']
|
|
1448
|
+
if Gval:
|
|
1449
|
+
allowed_strings += ['group_number']
|
|
1450
|
+
labels_strings += ['Gval']
|
|
1451
|
+
if NumB:
|
|
1452
|
+
allowed_strings += ["num_bonds"]
|
|
1453
|
+
labels_strings += ["NumB"]
|
|
1454
|
+
if len(MRdiag_dict):
|
|
1455
|
+
allowed_strings, labels_strings = [], []
|
|
1456
|
+
for k in list(MRdiag_dict):
|
|
1457
|
+
allowed_strings += [k]
|
|
1458
|
+
labels_strings += [k]
|
|
1459
|
+
result_ax_full = list()
|
|
1460
|
+
result_eq_full = list()
|
|
1461
|
+
result_ax_con = list()
|
|
1462
|
+
result_eq_con = list()
|
|
1463
|
+
if not custom_ligand_dict:
|
|
1464
|
+
liglist, ligdents, ligcons = ligand_breakdown(mol, BondedOct=True) # Complex is assumed to be octahedral
|
|
1465
|
+
(ax_ligand_list, eq_ligand_list, ax_natoms_list, eq_natoms_list, ax_con_int_list, eq_con_int_list,
|
|
1466
|
+
ax_con_list, eq_con_list, built_ligand_list) = ligand_assign(
|
|
1467
|
+
mol, liglist, ligdents, ligcons, loud)
|
|
1468
|
+
else:
|
|
1469
|
+
ax_ligand_list = custom_ligand_dict["ax_ligand_list"]
|
|
1470
|
+
eq_ligand_list = custom_ligand_dict["eq_ligand_list"]
|
|
1471
|
+
ax_con_int_list = custom_ligand_dict["ax_con_int_list"]
|
|
1472
|
+
eq_con_int_list = custom_ligand_dict["eq_con_int_list"]
|
|
1473
|
+
# count ligands
|
|
1474
|
+
n_ax = len(ax_ligand_list)
|
|
1475
|
+
n_eq = len(eq_ligand_list)
|
|
1476
|
+
colnames = []
|
|
1477
|
+
for ii, properties in enumerate(allowed_strings):
|
|
1478
|
+
# ############## replaced find_ligand_autocorrelations_oct function here
|
|
1479
|
+
# get full ligand AC
|
|
1480
|
+
ax_ligand_ac_full = []
|
|
1481
|
+
eq_ligand_ac_full = []
|
|
1482
|
+
for i in range(0, n_ax):
|
|
1483
|
+
if not list(ax_ligand_ac_full):
|
|
1484
|
+
ax_ligand_ac_full = full_autocorrelation(ax_ligand_list[i].mol, properties, depth, use_dist=use_dist,
|
|
1485
|
+
size_normalize=size_normalize, MRdiag_dict=MRdiag_dict)
|
|
1486
|
+
else:
|
|
1487
|
+
ax_ligand_ac_full += full_autocorrelation(ax_ligand_list[i].mol, properties, depth, use_dist=use_dist,
|
|
1488
|
+
size_normalize=size_normalize, MRdiag_dict=MRdiag_dict)
|
|
1489
|
+
ax_ligand_ac_full = np.divide(ax_ligand_ac_full, n_ax)
|
|
1490
|
+
for i in range(0, n_eq):
|
|
1491
|
+
if not list(eq_ligand_ac_full):
|
|
1492
|
+
eq_ligand_ac_full = full_autocorrelation(eq_ligand_list[i].mol, properties, depth, use_dist=use_dist,
|
|
1493
|
+
size_normalize=size_normalize, MRdiag_dict=MRdiag_dict)
|
|
1494
|
+
else:
|
|
1495
|
+
eq_ligand_ac_full += full_autocorrelation(eq_ligand_list[i].mol, properties, depth, use_dist=use_dist,
|
|
1496
|
+
size_normalize=size_normalize, MRdiag_dict=MRdiag_dict)
|
|
1497
|
+
eq_ligand_ac_full = np.divide(eq_ligand_ac_full, n_eq)
|
|
1498
|
+
ax_ligand_ac_con = []
|
|
1499
|
+
eq_ligand_ac_con = []
|
|
1500
|
+
for i in range(0, n_ax):
|
|
1501
|
+
if not list(ax_ligand_ac_con):
|
|
1502
|
+
ax_ligand_ac_con = atom_only_autocorrelation(ax_ligand_list[i].mol, properties, depth, ax_con_int_list[i],
|
|
1503
|
+
use_dist=use_dist, size_normalize=size_normalize,
|
|
1504
|
+
MRdiag_dict=MRdiag_dict)
|
|
1505
|
+
else:
|
|
1506
|
+
ax_ligand_ac_con += atom_only_autocorrelation(ax_ligand_list[i].mol, properties, depth, ax_con_int_list[i],
|
|
1507
|
+
use_dist=use_dist, size_normalize=size_normalize,
|
|
1508
|
+
MRdiag_dict=MRdiag_dict)
|
|
1509
|
+
ax_ligand_ac_con = np.divide(ax_ligand_ac_con, n_ax)
|
|
1510
|
+
for i in range(0, n_eq):
|
|
1511
|
+
if not list(eq_ligand_ac_con):
|
|
1512
|
+
eq_ligand_ac_con = atom_only_autocorrelation(eq_ligand_list[i].mol, properties, depth, eq_con_int_list[i],
|
|
1513
|
+
use_dist=use_dist, size_normalize=size_normalize,
|
|
1514
|
+
MRdiag_dict=MRdiag_dict)
|
|
1515
|
+
else:
|
|
1516
|
+
eq_ligand_ac_con += atom_only_autocorrelation(eq_ligand_list[i].mol, properties, depth, eq_con_int_list[i],
|
|
1517
|
+
use_dist=use_dist, size_normalize=size_normalize,
|
|
1518
|
+
MRdiag_dict=MRdiag_dict)
|
|
1519
|
+
eq_ligand_ac_con = np.divide(eq_ligand_ac_con, n_eq)
|
|
1520
|
+
################
|
|
1521
|
+
this_colnames = []
|
|
1522
|
+
for i in range(0, depth + 1):
|
|
1523
|
+
this_colnames.append(labels_strings[ii] + '-' + str(i))
|
|
1524
|
+
colnames.append(this_colnames)
|
|
1525
|
+
result_ax_full.append(ax_ligand_ac_full)
|
|
1526
|
+
result_eq_full.append(eq_ligand_ac_full)
|
|
1527
|
+
result_ax_con.append(ax_ligand_ac_con)
|
|
1528
|
+
result_eq_con.append(eq_ligand_ac_con)
|
|
1529
|
+
if flag_name:
|
|
1530
|
+
results_dictionary = {'colnames': colnames, 'result_ax_full_ac': result_ax_full,
|
|
1531
|
+
'result_eq_full_ac': result_eq_full,
|
|
1532
|
+
'result_ax_con_ac': result_ax_con, 'result_eq_con_ac': result_eq_con}
|
|
1533
|
+
else:
|
|
1534
|
+
results_dictionary = {'colnames': colnames, 'result_ax_full': result_ax_full, 'result_eq_full': result_eq_full,
|
|
1535
|
+
'result_ax_con': result_ax_con, 'result_eq_con': result_eq_con}
|
|
1536
|
+
return results_dictionary
|
|
1537
|
+
|
|
1538
|
+
|
|
1539
|
+
def generate_all_ligand_autocorrelation_derivatives(mol, loud, depth=4, flag_name=False,
|
|
1540
|
+
custom_ligand_dict=False, NumB=False, Gval=False):
|
|
1541
|
+
"""Utility for generating all ligand-based autocorrelation derivatives for a complex
|
|
1542
|
+
|
|
1543
|
+
Parameters
|
|
1544
|
+
----------
|
|
1545
|
+
mol : mol3D
|
|
1546
|
+
molecule to get lc-RAC derivatives for
|
|
1547
|
+
loud : bool
|
|
1548
|
+
print debugging information
|
|
1549
|
+
depth : int, optional
|
|
1550
|
+
depth of RACs to calculate, by default 4
|
|
1551
|
+
flag_name : bool, optional
|
|
1552
|
+
Shift RAC names slightly, by default False
|
|
1553
|
+
custom_ligand_dict : bool, optional
|
|
1554
|
+
Dict of ligands if passed - see generate_descriptor_vector, by default False
|
|
1555
|
+
NumB : bool, optional
|
|
1556
|
+
Use number of bonds as descriptor property, by default False
|
|
1557
|
+
Gval : bool, optional
|
|
1558
|
+
Use G value as descriptor property, by default False
|
|
1559
|
+
|
|
1560
|
+
Returns
|
|
1561
|
+
-------
|
|
1562
|
+
results_dictionary: dict
|
|
1563
|
+
Dictionary of all geo-based ligand product descriptor derivatives
|
|
1564
|
+
(both full and connecting atom scopes)
|
|
1565
|
+
{'colnames': colnames, 'result_ax_full': result_ax_full, 'result_eq_full': result_eq_full,
|
|
1566
|
+
'result_ax_con': result_ax_con, 'result_eq_con': result_eq_con}
|
|
1567
|
+
|
|
1568
|
+
"""
|
|
1569
|
+
result_ax_full = None
|
|
1570
|
+
result_eq_full = None
|
|
1571
|
+
result_ax_con = None
|
|
1572
|
+
result_eq_con = None
|
|
1573
|
+
colnames = []
|
|
1574
|
+
allowed_strings = ['electronegativity', 'nuclear_charge', 'ident', 'topology', 'size']
|
|
1575
|
+
labels_strings = ['chi', 'Z', 'I', 'T', 'S']
|
|
1576
|
+
if Gval:
|
|
1577
|
+
allowed_strings += ['group_number']
|
|
1578
|
+
labels_strings += ['Gval']
|
|
1579
|
+
if NumB:
|
|
1580
|
+
allowed_strings += ["num_bonds"]
|
|
1581
|
+
labels_strings += ["NumB"]
|
|
1582
|
+
if not custom_ligand_dict:
|
|
1583
|
+
liglist, ligdents, ligcons = ligand_breakdown(mol, BondedOct=True) # Complex is assumed to be octahedral
|
|
1584
|
+
ax_ligand_list, eq_ligand_list, ax_natoms_list, eq_natoms_list, ax_con_int_list, eq_con_int_list, \
|
|
1585
|
+
ax_con_list, eq_con_list, built_ligand_list = ligand_assign(
|
|
1586
|
+
mol, liglist, ligdents, ligcons, loud)
|
|
1587
|
+
else:
|
|
1588
|
+
ax_ligand_list = custom_ligand_dict["ax_ligand_list"]
|
|
1589
|
+
eq_ligand_list = custom_ligand_dict["eq_ligand_list"]
|
|
1590
|
+
ax_con_int_list = custom_ligand_dict["ax_con_int_list"]
|
|
1591
|
+
eq_con_int_list = custom_ligand_dict["eq_con_int_list"]
|
|
1592
|
+
# count ligands
|
|
1593
|
+
n_ax = len(ax_ligand_list)
|
|
1594
|
+
n_eq = len(eq_ligand_list)
|
|
1595
|
+
for ii, properties in enumerate(allowed_strings):
|
|
1596
|
+
# allocate the full jacobian matrix
|
|
1597
|
+
ax_full_j = np.zeros([depth + 1, mol.natoms])
|
|
1598
|
+
eq_full_j = np.zeros([depth + 1, mol.natoms])
|
|
1599
|
+
ax_con_j = np.zeros([depth + 1, mol.natoms])
|
|
1600
|
+
eq_con_j = np.zeros([depth + 1, mol.natoms])
|
|
1601
|
+
#################
|
|
1602
|
+
# full ligand ACs
|
|
1603
|
+
for i in range(0, n_ax): # for each ax ligand
|
|
1604
|
+
ax_ligand_ac_full_derivative = full_autocorrelation_derivative(ax_ligand_list[i].mol, properties, depth)
|
|
1605
|
+
# now we need to map back to full positions
|
|
1606
|
+
for jj, row in enumerate(ax_ligand_ac_full_derivative):
|
|
1607
|
+
for original_ids in list(ax_ligand_list[i].ext_int_dict.keys()):
|
|
1608
|
+
ax_full_j[jj, original_ids] += np.divide(row[ax_ligand_list[i].ext_int_dict[original_ids]], n_ax)
|
|
1609
|
+
for i in range(0, n_eq): # for each eq ligand
|
|
1610
|
+
# now we need to map back to full positions
|
|
1611
|
+
eq_ligand_eq_full_derivative = full_autocorrelation_derivative(eq_ligand_list[i].mol, properties, depth)
|
|
1612
|
+
for jj, row in enumerate(eq_ligand_eq_full_derivative):
|
|
1613
|
+
for original_ids in list(eq_ligand_list[i].ext_int_dict.keys()):
|
|
1614
|
+
eq_full_j[jj, original_ids] += np.divide(row[eq_ligand_list[i].ext_int_dict[original_ids]], n_eq)
|
|
1615
|
+
# ligand connection ACs
|
|
1616
|
+
for i in range(0, n_ax):
|
|
1617
|
+
ax_ligand_ac_con_derivative = atom_only_autocorrelation_derivative(ax_ligand_list[i].mol, properties, depth,
|
|
1618
|
+
ax_con_int_list[i])
|
|
1619
|
+
# now we need to map back to full positions
|
|
1620
|
+
for jj, row in enumerate(ax_ligand_ac_con_derivative):
|
|
1621
|
+
for original_ids in list(ax_ligand_list[i].ext_int_dict.keys()):
|
|
1622
|
+
ax_con_j[jj, original_ids] += np.divide(row[ax_ligand_list[i].ext_int_dict[original_ids]], n_ax)
|
|
1623
|
+
for i in range(0, n_eq):
|
|
1624
|
+
eq_ligand_ac_con_derivative = atom_only_autocorrelation_derivative(eq_ligand_list[i].mol, properties, depth,
|
|
1625
|
+
eq_con_int_list[i])
|
|
1626
|
+
# now we need to map back to full positions
|
|
1627
|
+
for jj, row in enumerate(eq_ligand_ac_con_derivative):
|
|
1628
|
+
for original_ids in list(eq_ligand_list[i].ext_int_dict.keys()):
|
|
1629
|
+
eq_con_j[jj, original_ids] += np.divide(row[eq_ligand_list[i].ext_int_dict[original_ids]], n_eq)
|
|
1630
|
+
ax_ligand_ac_full, eq_ligand_ac_full, ax_ligand_ac_con, eq_ligand_ac_con = ax_full_j, eq_full_j, ax_con_j, eq_con_j
|
|
1631
|
+
#################
|
|
1632
|
+
for i in range(0, depth + 1):
|
|
1633
|
+
colnames.append(['d' + labels_strings[ii] + '-' + str(i) + '/d' + labels_strings[ii] + str(j) for j in
|
|
1634
|
+
range(0, mol.natoms)])
|
|
1635
|
+
if result_ax_full is None:
|
|
1636
|
+
result_ax_full = ax_ligand_ac_full
|
|
1637
|
+
else:
|
|
1638
|
+
result_ax_full = np.row_stack([result_ax_full, ax_ligand_ac_full])
|
|
1639
|
+
|
|
1640
|
+
if result_eq_full is None:
|
|
1641
|
+
result_eq_full = eq_ligand_ac_full
|
|
1642
|
+
else:
|
|
1643
|
+
result_eq_full = np.row_stack([result_eq_full, eq_ligand_ac_full])
|
|
1644
|
+
|
|
1645
|
+
if result_ax_con is None:
|
|
1646
|
+
result_ax_con = ax_ligand_ac_con
|
|
1647
|
+
else:
|
|
1648
|
+
result_ax_con = np.row_stack([result_ax_con, ax_ligand_ac_con])
|
|
1649
|
+
|
|
1650
|
+
if result_eq_con is None:
|
|
1651
|
+
result_eq_con = eq_ligand_ac_con
|
|
1652
|
+
else:
|
|
1653
|
+
result_eq_con = np.row_stack([result_eq_con, eq_ligand_ac_con])
|
|
1654
|
+
if flag_name:
|
|
1655
|
+
results_dictionary = {'colnames': colnames, 'result_ax_full_ac': result_ax_full,
|
|
1656
|
+
'result_eq_full_ac': result_eq_full,
|
|
1657
|
+
'result_ax_con_ac': result_ax_con, 'result_eq_con_ac': result_eq_con}
|
|
1658
|
+
else:
|
|
1659
|
+
results_dictionary = {'colnames': colnames, 'result_ax_full': result_ax_full, 'result_eq_full': result_eq_full,
|
|
1660
|
+
'result_ax_con': result_ax_con, 'result_eq_con': result_eq_con}
|
|
1661
|
+
return results_dictionary
|
|
1662
|
+
|
|
1663
|
+
|
|
1664
|
+
def generate_all_ligand_deltametrics(mol, loud, depth=4, flag_name=False,
|
|
1665
|
+
custom_ligand_dict=False, NumB=False, Gval=False,
|
|
1666
|
+
use_dist=False, size_normalize=False, MRdiag_dict={}):
|
|
1667
|
+
"""Utility for generating all ligand-based deltametric autocorrelations for a complex
|
|
1668
|
+
|
|
1669
|
+
Parameters
|
|
1670
|
+
----------
|
|
1671
|
+
mol : mol3D
|
|
1672
|
+
molecule to get D_lc-RACs for
|
|
1673
|
+
loud : bool
|
|
1674
|
+
print debugging information
|
|
1675
|
+
depth : int, optional
|
|
1676
|
+
depth of RACs to calculate, by default 4
|
|
1677
|
+
flag_name : bool, optional
|
|
1678
|
+
Shift RAC names slightly, by default False
|
|
1679
|
+
custom_ligand_dict : bool, optional
|
|
1680
|
+
Dict of ligands if passed - see generate_descriptor_vector, by default False
|
|
1681
|
+
NumB : bool, optional
|
|
1682
|
+
Use number of bonds as descriptor property, by default False
|
|
1683
|
+
Gval : bool, optional
|
|
1684
|
+
Use G value as descriptor property, by default False
|
|
1685
|
+
use_dist : bool, optional
|
|
1686
|
+
Weigh autocorrelation by physical distance of atom from original, by default False
|
|
1687
|
+
size_normalize : bool, optional
|
|
1688
|
+
Whether or not to normalize by the number of atoms.
|
|
1689
|
+
MRdiag_dict : dict, optional
|
|
1690
|
+
Keys are ligand identifiers, values are MR diagnostics like E_corr.
|
|
1691
|
+
|
|
1692
|
+
Returns
|
|
1693
|
+
-------
|
|
1694
|
+
results_dictionary: dict
|
|
1695
|
+
Dictionary of all geo-based ligand deltametric descriptors (both full and connecting atom scopes) -
|
|
1696
|
+
{'colnames': colnames, 'result_ax_con': result_ax_con, 'result_eq_con': result_eq_con}
|
|
1697
|
+
|
|
1698
|
+
"""
|
|
1699
|
+
result_ax_con = list()
|
|
1700
|
+
result_eq_con = list()
|
|
1701
|
+
colnames = []
|
|
1702
|
+
allowed_strings = ['electronegativity', 'nuclear_charge', 'ident', 'topology', 'size']
|
|
1703
|
+
labels_strings = ['chi', 'Z', 'I', 'T', 'S']
|
|
1704
|
+
if Gval:
|
|
1705
|
+
allowed_strings += ['group_number']
|
|
1706
|
+
labels_strings += ['Gval']
|
|
1707
|
+
if NumB:
|
|
1708
|
+
allowed_strings += ["num_bonds"]
|
|
1709
|
+
labels_strings += ["NumB"]
|
|
1710
|
+
if len(MRdiag_dict):
|
|
1711
|
+
allowed_strings, labels_strings = [], []
|
|
1712
|
+
for k in list(MRdiag_dict):
|
|
1713
|
+
allowed_strings += [k]
|
|
1714
|
+
labels_strings += [k]
|
|
1715
|
+
if not custom_ligand_dict:
|
|
1716
|
+
liglist, ligdents, ligcons = ligand_breakdown(mol, BondedOct=True) # Complex is assumed to be octahedral
|
|
1717
|
+
(ax_ligand_list, eq_ligand_list, ax_natoms_list, eq_natoms_list, ax_con_int_list, eq_con_int_list,
|
|
1718
|
+
ax_con_list, eq_con_list, built_ligand_list) = ligand_assign(mol, liglist, ligdents, ligcons, loud)
|
|
1719
|
+
else:
|
|
1720
|
+
ax_ligand_list = custom_ligand_dict["ax_ligand_list"]
|
|
1721
|
+
eq_ligand_list = custom_ligand_dict["eq_ligand_list"]
|
|
1722
|
+
ax_con_int_list = custom_ligand_dict["ax_con_int_list"]
|
|
1723
|
+
eq_con_int_list = custom_ligand_dict["eq_con_int_list"]
|
|
1724
|
+
# count ligands
|
|
1725
|
+
n_ax = len(ax_ligand_list)
|
|
1726
|
+
n_eq = len(eq_ligand_list)
|
|
1727
|
+
for ii, properties in enumerate(allowed_strings):
|
|
1728
|
+
####################
|
|
1729
|
+
# get partial ligand AC
|
|
1730
|
+
ax_ligand_ac_con = []
|
|
1731
|
+
eq_ligand_ac_con = []
|
|
1732
|
+
for i in range(0, n_ax):
|
|
1733
|
+
if not list(ax_ligand_ac_con):
|
|
1734
|
+
ax_ligand_ac_con = atom_only_deltametric(ax_ligand_list[i].mol, properties, depth, ax_con_int_list[i],
|
|
1735
|
+
use_dist=use_dist, size_normalize=size_normalize,
|
|
1736
|
+
MRdiag_dict=MRdiag_dict)
|
|
1737
|
+
else:
|
|
1738
|
+
ax_ligand_ac_con += atom_only_deltametric(ax_ligand_list[i].mol, properties, depth, ax_con_int_list[i],
|
|
1739
|
+
use_dist=use_dist, size_normalize=size_normalize,
|
|
1740
|
+
MRdiag_dict=MRdiag_dict)
|
|
1741
|
+
ax_ligand_ac_con = np.divide(ax_ligand_ac_con, n_ax)
|
|
1742
|
+
for i in range(0, n_eq):
|
|
1743
|
+
if not list(eq_ligand_ac_con):
|
|
1744
|
+
eq_ligand_ac_con = atom_only_deltametric(eq_ligand_list[i].mol, properties, depth, eq_con_int_list[i],
|
|
1745
|
+
use_dist=use_dist, size_normalize=size_normalize,
|
|
1746
|
+
MRdiag_dict=MRdiag_dict)
|
|
1747
|
+
else:
|
|
1748
|
+
eq_ligand_ac_con += atom_only_deltametric(eq_ligand_list[i].mol, properties, depth, eq_con_int_list[i],
|
|
1749
|
+
use_dist=use_dist, size_normalize=size_normalize,
|
|
1750
|
+
MRdiag_dict=MRdiag_dict)
|
|
1751
|
+
eq_ligand_ac_con = np.divide(eq_ligand_ac_con, n_eq)
|
|
1752
|
+
####################
|
|
1753
|
+
this_colnames = []
|
|
1754
|
+
for i in range(0, depth + 1):
|
|
1755
|
+
this_colnames.append(labels_strings[ii] + '-' + str(i))
|
|
1756
|
+
colnames.append(this_colnames)
|
|
1757
|
+
result_ax_con.append(ax_ligand_ac_con)
|
|
1758
|
+
result_eq_con.append(eq_ligand_ac_con)
|
|
1759
|
+
if flag_name:
|
|
1760
|
+
results_dictionary = {'colnames': colnames, 'result_ax_con_del': result_ax_con,
|
|
1761
|
+
'result_eq_con_del': result_eq_con}
|
|
1762
|
+
else:
|
|
1763
|
+
results_dictionary = {'colnames': colnames, 'result_ax_con': result_ax_con, 'result_eq_con': result_eq_con}
|
|
1764
|
+
return results_dictionary
|
|
1765
|
+
|
|
1766
|
+
|
|
1767
|
+
def generate_all_ligand_deltametric_derivatives(mol, loud, depth=4, flag_name=False,
|
|
1768
|
+
custom_ligand_dict=False, NumB=False, Gval=False):
|
|
1769
|
+
"""Utility for generating all ligand-based deltametric derivatives for a complex
|
|
1770
|
+
|
|
1771
|
+
Parameters
|
|
1772
|
+
----------
|
|
1773
|
+
mol : mol3D
|
|
1774
|
+
molecule to get lc-RAC deltametric derivatives for
|
|
1775
|
+
loud : bool
|
|
1776
|
+
print debugging information
|
|
1777
|
+
depth : int, optional
|
|
1778
|
+
depth of RACs to calculate, by default 4
|
|
1779
|
+
flag_name : bool, optional
|
|
1780
|
+
Shift RAC names slightly, by default False
|
|
1781
|
+
custom_ligand_dict : bool, optional
|
|
1782
|
+
Dict of ligands if passed - see generate_descriptor_vector, by default False
|
|
1783
|
+
NumB : bool, optional
|
|
1784
|
+
Use number of bonds as descriptor property, by default False
|
|
1785
|
+
Gval : bool, optional
|
|
1786
|
+
Use G value as descriptor property, by default False
|
|
1787
|
+
|
|
1788
|
+
Returns
|
|
1789
|
+
-------
|
|
1790
|
+
results_dictionary: dict
|
|
1791
|
+
Dictionary of all geo-based ligand deltametric descriptor derivatives
|
|
1792
|
+
(both full and connecting atom scopes) -
|
|
1793
|
+
{'colnames': colnames, 'result_ax_con': result_ax_con, 'result_eq_con': result_eq_con}
|
|
1794
|
+
|
|
1795
|
+
"""
|
|
1796
|
+
result_ax_con = None
|
|
1797
|
+
result_eq_con = None
|
|
1798
|
+
colnames = []
|
|
1799
|
+
allowed_strings = ['electronegativity', 'nuclear_charge', 'ident', 'topology', 'size']
|
|
1800
|
+
labels_strings = ['chi', 'Z', 'I', 'T', 'S']
|
|
1801
|
+
if Gval:
|
|
1802
|
+
allowed_strings += ['group_number']
|
|
1803
|
+
labels_strings += ['Gval']
|
|
1804
|
+
if NumB:
|
|
1805
|
+
allowed_strings += ["num_bonds"]
|
|
1806
|
+
labels_strings += ["NumB"]
|
|
1807
|
+
if not custom_ligand_dict:
|
|
1808
|
+
liglist, ligdents, ligcons = ligand_breakdown(mol, BondedOct=True) # Complex is assumed to be octahedral
|
|
1809
|
+
ax_ligand_list, eq_ligand_list, ax_natoms_list, eq_natoms_list, ax_con_int_list, eq_con_int_list, \
|
|
1810
|
+
ax_con_list, eq_con_list, built_ligand_list = ligand_assign(
|
|
1811
|
+
mol, liglist, ligdents, ligcons, loud)
|
|
1812
|
+
else:
|
|
1813
|
+
ax_ligand_list = custom_ligand_dict["ax_ligand_list"]
|
|
1814
|
+
eq_ligand_list = custom_ligand_dict["eq_ligand_list"]
|
|
1815
|
+
ax_con_int_list = custom_ligand_dict["ax_con_int_list"]
|
|
1816
|
+
eq_con_int_list = custom_ligand_dict["eq_con_int_list"]
|
|
1817
|
+
# count ligands
|
|
1818
|
+
n_ax = len(ax_ligand_list)
|
|
1819
|
+
n_eq = len(eq_ligand_list)
|
|
1820
|
+
for ii, properties in enumerate(allowed_strings):
|
|
1821
|
+
# allocate the full jacobian matrix
|
|
1822
|
+
ax_con_j = np.zeros([depth + 1, mol.natoms])
|
|
1823
|
+
eq_con_j = np.zeros([depth + 1, mol.natoms])
|
|
1824
|
+
#################
|
|
1825
|
+
for i in range(0, n_ax):
|
|
1826
|
+
ax_ligand_ac_con_derivative = atom_only_deltametric_derivative(ax_ligand_list[i].mol, properties, depth,
|
|
1827
|
+
ax_con_int_list[i])
|
|
1828
|
+
for jj, row in enumerate(ax_ligand_ac_con_derivative):
|
|
1829
|
+
for original_ids in list(ax_ligand_list[i].ext_int_dict.keys()):
|
|
1830
|
+
ax_con_j[jj, original_ids] += np.divide(row[ax_ligand_list[i].ext_int_dict[original_ids]], n_ax)
|
|
1831
|
+
for i in range(0, n_eq):
|
|
1832
|
+
eq_ligand_ac_con_derivative = atom_only_deltametric_derivative(eq_ligand_list[i].mol, properties, depth,
|
|
1833
|
+
eq_con_int_list[i])
|
|
1834
|
+
for jj, row in enumerate(eq_ligand_ac_con_derivative):
|
|
1835
|
+
for original_ids in list(eq_ligand_list[i].ext_int_dict.keys()):
|
|
1836
|
+
eq_con_j[jj, original_ids] += np.divide(row[eq_ligand_list[i].ext_int_dict[original_ids]], n_eq)
|
|
1837
|
+
#################
|
|
1838
|
+
ax_ligand_ac_con, eq_ligand_ac_con = ax_con_j, eq_con_j
|
|
1839
|
+
for i in range(0, depth + 1):
|
|
1840
|
+
colnames.append(['d' + labels_strings[ii] + '-' + str(i) + '/d' + labels_strings[ii] + str(j) for j in
|
|
1841
|
+
range(0, mol.natoms)])
|
|
1842
|
+
if result_ax_con is None:
|
|
1843
|
+
result_ax_con = ax_ligand_ac_con
|
|
1844
|
+
else:
|
|
1845
|
+
result_ax_con = np.row_stack([result_ax_con, ax_ligand_ac_con])
|
|
1846
|
+
if result_eq_con is None:
|
|
1847
|
+
result_eq_con = eq_ligand_ac_con
|
|
1848
|
+
else:
|
|
1849
|
+
result_eq_con = np.row_stack([result_eq_con, eq_ligand_ac_con])
|
|
1850
|
+
if flag_name:
|
|
1851
|
+
results_dictionary = {'colnames': colnames, 'result_ax_con_del': result_ax_con,
|
|
1852
|
+
'result_eq_con_del': result_eq_con}
|
|
1853
|
+
else:
|
|
1854
|
+
results_dictionary = {'colnames': colnames, 'result_ax_con': result_ax_con, 'result_eq_con': result_eq_con}
|
|
1855
|
+
return results_dictionary
|
|
1856
|
+
|
|
1857
|
+
|
|
1858
|
+
def generate_metal_autocorrelations(mol, loud, depth=4, oct=True, flag_name=False,
|
|
1859
|
+
modifier=False, NumB=False, Gval=False, metal_ind=None,
|
|
1860
|
+
use_dist=False, size_normalize=False, MRdiag_dict={}):
|
|
1861
|
+
"""Utility for generating all metal-centered product autocorrelations for a complex
|
|
1862
|
+
|
|
1863
|
+
Parameters
|
|
1864
|
+
----------
|
|
1865
|
+
mol : mol3D
|
|
1866
|
+
molecule to get mc-RACs for
|
|
1867
|
+
loud : bool
|
|
1868
|
+
print debugging information
|
|
1869
|
+
depth : int, optional
|
|
1870
|
+
depth of RACs to calculate, by default 4
|
|
1871
|
+
oct : bool, optional
|
|
1872
|
+
Use octahedral criteria for structure evaluation, by default True
|
|
1873
|
+
flag_name : bool, optional
|
|
1874
|
+
Shift RAC names slightly, by default False
|
|
1875
|
+
modifier : bool, optional
|
|
1876
|
+
Use ox_modifier for metal, by default False
|
|
1877
|
+
NumB : bool, optional
|
|
1878
|
+
Use number of bonds as descriptor property, by default False
|
|
1879
|
+
Gval : bool, optional
|
|
1880
|
+
Use G value as descriptor property, by default False
|
|
1881
|
+
metal_ind : bool, optional
|
|
1882
|
+
index of the metal atom to generate property, by default False
|
|
1883
|
+
use_dist : bool, optional
|
|
1884
|
+
Weigh autocorrelation by physical distance of atom from original, by default False
|
|
1885
|
+
size_normalize : bool, optional
|
|
1886
|
+
Whether or not to normalize by the number of atoms.
|
|
1887
|
+
MRdiag_dict : dict, optional
|
|
1888
|
+
Keys are ligand identifiers, values are MR diagnostics like E_corr.
|
|
1889
|
+
|
|
1890
|
+
Returns
|
|
1891
|
+
-------
|
|
1892
|
+
results_dictionary: dict
|
|
1893
|
+
Dictionary of all geo-based MC-RAC product descriptors -
|
|
1894
|
+
{'colnames': colnames, 'results': result}
|
|
1895
|
+
|
|
1896
|
+
"""
|
|
1897
|
+
result = list()
|
|
1898
|
+
colnames = []
|
|
1899
|
+
allowed_strings = ['electronegativity', 'nuclear_charge', 'ident', 'topology', 'size']
|
|
1900
|
+
labels_strings = ['chi', 'Z', 'I', 'T', 'S']
|
|
1901
|
+
if Gval:
|
|
1902
|
+
allowed_strings += ['group_number']
|
|
1903
|
+
labels_strings += ['Gval']
|
|
1904
|
+
if NumB:
|
|
1905
|
+
allowed_strings += ["num_bonds"]
|
|
1906
|
+
labels_strings += ["NumB"]
|
|
1907
|
+
if len(MRdiag_dict):
|
|
1908
|
+
allowed_strings, labels_strings = [], []
|
|
1909
|
+
for k in list(MRdiag_dict):
|
|
1910
|
+
allowed_strings += [k]
|
|
1911
|
+
labels_strings += [k]
|
|
1912
|
+
for ii, properties in enumerate(allowed_strings):
|
|
1913
|
+
metal_ac = metal_only_autocorrelation(mol, properties, depth, oct=oct,
|
|
1914
|
+
modifier=modifier, metal_ind=metal_ind, use_dist=use_dist,
|
|
1915
|
+
size_normalize=size_normalize, MRdiag_dict=MRdiag_dict)
|
|
1916
|
+
this_colnames = []
|
|
1917
|
+
for i in range(0, depth + 1):
|
|
1918
|
+
this_colnames.append(labels_strings[ii] + '-' + str(i))
|
|
1919
|
+
colnames.append(this_colnames)
|
|
1920
|
+
result.append(metal_ac)
|
|
1921
|
+
if flag_name:
|
|
1922
|
+
results_dictionary = {'colnames': colnames, 'results_mc_ac': result}
|
|
1923
|
+
else:
|
|
1924
|
+
results_dictionary = {'colnames': colnames, 'results': result}
|
|
1925
|
+
return results_dictionary
|
|
1926
|
+
|
|
1927
|
+
|
|
1928
|
+
def generate_metal_autocorrelation_derivatives(mol, loud, depth=4, oct=True, flag_name=False,
|
|
1929
|
+
modifier=False, NumB=False, Gval=False, metal_ind=None):
|
|
1930
|
+
"""Utility for generating all metal-centered product autocorrelation derivatives for a complex
|
|
1931
|
+
|
|
1932
|
+
Parameters
|
|
1933
|
+
----------
|
|
1934
|
+
mol : mol3D
|
|
1935
|
+
molecule to get mc-RAC derivatives for
|
|
1936
|
+
loud : bool
|
|
1937
|
+
print debugging information
|
|
1938
|
+
depth : int, optional
|
|
1939
|
+
depth of RACs to calculate, by default 4
|
|
1940
|
+
oct : bool, optional
|
|
1941
|
+
Use octahedral criteria for structure evaluation, by default True
|
|
1942
|
+
flag_name : bool, optional
|
|
1943
|
+
Shift RAC names slightly, by default False
|
|
1944
|
+
modifier : bool, optional
|
|
1945
|
+
Use ox_modifier for metal, by default False
|
|
1946
|
+
NumB : bool, optional
|
|
1947
|
+
Use number of bonds as descriptor property, by default False
|
|
1948
|
+
Gval : bool, optional
|
|
1949
|
+
Use G value as descriptor property, by default False
|
|
1950
|
+
metal_ind : bool, optional
|
|
1951
|
+
index of the metal atom to generate property, by default False
|
|
1952
|
+
|
|
1953
|
+
Returns
|
|
1954
|
+
-------
|
|
1955
|
+
results_dictionary : dict
|
|
1956
|
+
Dictionary of all geo-based MC-RAC product descriptor derivatives
|
|
1957
|
+
{'colnames': colnames, 'results': result}
|
|
1958
|
+
|
|
1959
|
+
"""
|
|
1960
|
+
result = None
|
|
1961
|
+
colnames = []
|
|
1962
|
+
allowed_strings = ['electronegativity', 'nuclear_charge', 'ident', 'topology', 'size']
|
|
1963
|
+
labels_strings = ['chi', 'Z', 'I', 'T', 'S']
|
|
1964
|
+
if Gval:
|
|
1965
|
+
allowed_strings += ['group_number']
|
|
1966
|
+
labels_strings += ['Gval']
|
|
1967
|
+
if NumB:
|
|
1968
|
+
allowed_strings += ["num_bonds"]
|
|
1969
|
+
labels_strings += ["NumB"]
|
|
1970
|
+
for ii, properties in enumerate(allowed_strings):
|
|
1971
|
+
metal_ac_der = metal_only_autocorrelation_derivative(mol, properties, depth,
|
|
1972
|
+
oct=oct, modifier=modifier, metal_ind=metal_ind)
|
|
1973
|
+
for i in range(0, depth + 1):
|
|
1974
|
+
colnames.append(['d' + labels_strings[ii] + '-' + str(i) + '/d' + labels_strings[ii] + str(j) for j in
|
|
1975
|
+
range(0, mol.natoms)])
|
|
1976
|
+
|
|
1977
|
+
if result is None:
|
|
1978
|
+
result = metal_ac_der
|
|
1979
|
+
else:
|
|
1980
|
+
result = np.row_stack([result, metal_ac_der])
|
|
1981
|
+
if flag_name:
|
|
1982
|
+
results_dictionary = {'colnames': colnames, 'results_mc_ac': result}
|
|
1983
|
+
else:
|
|
1984
|
+
results_dictionary = {'colnames': colnames, 'results': result}
|
|
1985
|
+
return results_dictionary
|
|
1986
|
+
|
|
1987
|
+
|
|
1988
|
+
def generate_metal_deltametrics(mol, loud, depth=4, oct=True, flag_name=False,
|
|
1989
|
+
modifier=False, NumB=False, Gval=False, metal_ind=None,
|
|
1990
|
+
use_dist=False, size_normalize=False, MRdiag_dict={}):
|
|
1991
|
+
"""Utility for generating all metal-centered deltametric autocorrelations for a complex
|
|
1992
|
+
|
|
1993
|
+
Parameters
|
|
1994
|
+
----------
|
|
1995
|
+
mol : mol3D
|
|
1996
|
+
molecule to get D_mc-RACs for
|
|
1997
|
+
loud : bool
|
|
1998
|
+
print debugging information
|
|
1999
|
+
depth : int, optional
|
|
2000
|
+
depth of RACs to calculate, by default 4
|
|
2001
|
+
oct : bool, optional
|
|
2002
|
+
Use octahedral criteria for structure evaluation, by default True
|
|
2003
|
+
flag_name : bool, optional
|
|
2004
|
+
Shift RAC names slightly, by default False
|
|
2005
|
+
modifier : bool, optional
|
|
2006
|
+
Use ox_modifier for metal, by default False
|
|
2007
|
+
NumB : bool, optional
|
|
2008
|
+
Use number of bonds as descriptor property, by default False
|
|
2009
|
+
Gval : bool, optional
|
|
2010
|
+
Use G value as descriptor property, by default False
|
|
2011
|
+
metal_ind : bool, optional
|
|
2012
|
+
index of the metal atom to generate property, by default False
|
|
2013
|
+
use_dist : bool, optional
|
|
2014
|
+
Weigh autocorrelation by physical distance of atom from original, by default False
|
|
2015
|
+
size_normalize : bool, optional
|
|
2016
|
+
Whether or not to normalize by the number of atoms.
|
|
2017
|
+
MRdiag_dict : dict, optional
|
|
2018
|
+
Keys are ligand identifiers, values are MR diagnostics like E_corr.
|
|
2019
|
+
|
|
2020
|
+
Returns
|
|
2021
|
+
-------
|
|
2022
|
+
results_dictionary: dict
|
|
2023
|
+
Dictionary of all geo-based MC-RAC deltametric descriptors -
|
|
2024
|
+
{'colnames': colnames, 'results': result}
|
|
2025
|
+
|
|
2026
|
+
"""
|
|
2027
|
+
result = list()
|
|
2028
|
+
colnames = []
|
|
2029
|
+
allowed_strings = ['electronegativity', 'nuclear_charge', 'ident', 'topology', 'size']
|
|
2030
|
+
labels_strings = ['chi', 'Z', 'I', 'T', 'S']
|
|
2031
|
+
if Gval:
|
|
2032
|
+
allowed_strings += ['group_number']
|
|
2033
|
+
labels_strings += ['Gval']
|
|
2034
|
+
if NumB:
|
|
2035
|
+
allowed_strings += ["num_bonds"]
|
|
2036
|
+
labels_strings += ["NumB"]
|
|
2037
|
+
if len(MRdiag_dict):
|
|
2038
|
+
allowed_strings, labels_strings = [], []
|
|
2039
|
+
for k in list(MRdiag_dict):
|
|
2040
|
+
allowed_strings += [k]
|
|
2041
|
+
labels_strings += [k]
|
|
2042
|
+
for ii, properties in enumerate(allowed_strings):
|
|
2043
|
+
metal_ac = metal_only_deltametric(mol, properties, depth, oct=oct,
|
|
2044
|
+
modifier=modifier, metal_ind=metal_ind,
|
|
2045
|
+
use_dist=use_dist, size_normalize=size_normalize, MRdiag_dict=MRdiag_dict)
|
|
2046
|
+
this_colnames = []
|
|
2047
|
+
for i in range(0, depth + 1):
|
|
2048
|
+
this_colnames.append(labels_strings[ii] + '-' + str(i))
|
|
2049
|
+
colnames.append(this_colnames)
|
|
2050
|
+
result.append(metal_ac)
|
|
2051
|
+
if flag_name:
|
|
2052
|
+
results_dictionary = {'colnames': colnames, 'results_mc_del': result}
|
|
2053
|
+
else:
|
|
2054
|
+
results_dictionary = {'colnames': colnames, 'results': result}
|
|
2055
|
+
return results_dictionary
|
|
2056
|
+
|
|
2057
|
+
|
|
2058
|
+
def generate_metal_deltametric_derivatives(mol, loud, depth=4, oct=True, flag_name=False,
|
|
2059
|
+
modifier=False, NumB=False, Gval=False, metal_ind=None):
|
|
2060
|
+
"""Utility for generating all metal-centered deltametric autocorrelation derivatives
|
|
2061
|
+
for a complex
|
|
2062
|
+
|
|
2063
|
+
Parameters
|
|
2064
|
+
----------
|
|
2065
|
+
mol : mol3D
|
|
2066
|
+
molecule to get D_mc-RAC derivatives for
|
|
2067
|
+
loud : bool
|
|
2068
|
+
print debugging information
|
|
2069
|
+
depth : int, optional
|
|
2070
|
+
depth of RACs to calculate, by default 4
|
|
2071
|
+
oct : bool, optional
|
|
2072
|
+
Use octahedral criteria for structure evaluation, by default True
|
|
2073
|
+
flag_name : bool, optional
|
|
2074
|
+
Shift RAC names slightly, by default False
|
|
2075
|
+
modifier : bool, optional
|
|
2076
|
+
Use ox_modifier for metal, by default False
|
|
2077
|
+
NumB : bool, optional
|
|
2078
|
+
Use number of bonds as descriptor property, by default False
|
|
2079
|
+
Gval : bool, optional
|
|
2080
|
+
Use G value as descriptor property, by default False
|
|
2081
|
+
metal_ind : bool, optional
|
|
2082
|
+
index of the metal atom to generate property, by default False
|
|
2083
|
+
|
|
2084
|
+
Returns
|
|
2085
|
+
-------
|
|
2086
|
+
results_dictionary: dict
|
|
2087
|
+
Dictionary of all geo-based MC-RAC deltametric descriptor derivatives -
|
|
2088
|
+
{'colnames': colnames, 'results': result}
|
|
2089
|
+
|
|
2090
|
+
"""
|
|
2091
|
+
result = None
|
|
2092
|
+
colnames = []
|
|
2093
|
+
allowed_strings = ['electronegativity', 'nuclear_charge', 'ident', 'topology', 'size']
|
|
2094
|
+
labels_strings = ['chi', 'Z', 'I', 'T', 'S']
|
|
2095
|
+
if Gval:
|
|
2096
|
+
allowed_strings += ['group_number']
|
|
2097
|
+
labels_strings += ['Gval']
|
|
2098
|
+
if NumB:
|
|
2099
|
+
allowed_strings += ["num_bonds"]
|
|
2100
|
+
labels_strings += ["NumB"]
|
|
2101
|
+
for ii, properties in enumerate(allowed_strings):
|
|
2102
|
+
metal_ac_der = metal_only_deltametric_derivative(mol, properties, depth, oct=oct,
|
|
2103
|
+
metal_ind=metal_ind, modifier=modifier)
|
|
2104
|
+
for i in range(0, depth + 1):
|
|
2105
|
+
colnames.append(['d' + labels_strings[ii] + '-' + str(i) + '/d' + labels_strings[ii] + str(j) for j in
|
|
2106
|
+
range(0, mol.natoms)])
|
|
2107
|
+
if result is None:
|
|
2108
|
+
result = metal_ac_der
|
|
2109
|
+
else:
|
|
2110
|
+
result = np.row_stack([result, metal_ac_der])
|
|
2111
|
+
if flag_name:
|
|
2112
|
+
results_dictionary = {'colnames': colnames, 'results_mc_del': result}
|
|
2113
|
+
else:
|
|
2114
|
+
results_dictionary = {'colnames': colnames, 'results': result}
|
|
2115
|
+
return results_dictionary
|
|
2116
|
+
|
|
2117
|
+
|
|
2118
|
+
# ################# Possibly Needed - ox_ utilities
|
|
2119
|
+
def generate_metal_ox_autocorrelations(oxmodifier, mol, loud, depth=4,
|
|
2120
|
+
oct=True, flag_name=False, metal_ind=None,
|
|
2121
|
+
use_dist=False, size_normalize=False):
|
|
2122
|
+
# # oxmodifier - dict, used to modify prop vector (e.g. for adding
|
|
2123
|
+
# # ONLY used with ox_nuclear_charge ox or charge)
|
|
2124
|
+
# # {"Fe":2, "Co": 3} etc, normally only 1 metal...
|
|
2125
|
+
# oct - bool, if complex is octahedral, will use better bond checks
|
|
2126
|
+
result = list()
|
|
2127
|
+
colnames = []
|
|
2128
|
+
metal_ox_ac = metal_only_autocorrelation(mol, 'ox_nuclear_charge', depth, oct=oct,
|
|
2129
|
+
modifier=oxmodifier, metal_ind=metal_ind,
|
|
2130
|
+
use_dist=use_dist, size_normalize=size_normalize)
|
|
2131
|
+
this_colnames = []
|
|
2132
|
+
for i in range(0, depth + 1):
|
|
2133
|
+
this_colnames.append('O' + '-' + str(i))
|
|
2134
|
+
colnames.append(this_colnames)
|
|
2135
|
+
result.append(metal_ox_ac)
|
|
2136
|
+
results_dictionary = {'colnames': colnames, 'results': result}
|
|
2137
|
+
return results_dictionary
|
|
2138
|
+
|
|
2139
|
+
|
|
2140
|
+
def generate_metal_ox_autocorrelation_derivatives(oxmodifier, mol, loud, depth=4, oct=True, flag_name=False,
|
|
2141
|
+
metal_ind=None):
|
|
2142
|
+
# # oxmodifier - dict, used to modify prop vector (e.g. for adding
|
|
2143
|
+
# # ONLY used with ox_nuclear_charge ox or charge)
|
|
2144
|
+
# # {"Fe":2, "Co": 3} etc, normally only 1 metal...
|
|
2145
|
+
# oct - bool, if complex is octahedral, will use better bond checks
|
|
2146
|
+
result = None
|
|
2147
|
+
colnames = []
|
|
2148
|
+
metal_ox_ac = metal_only_autocorrelation_derivative(mol, 'ox_nuclear_charge', depth, oct=oct,
|
|
2149
|
+
modifier=oxmodifier, metal_ind=metal_ind)
|
|
2150
|
+
for i in range(0, depth + 1):
|
|
2151
|
+
colnames.append(['d' + 'O' + '-' + str(i) + '/d' + 'O' + str(j) for j in range(0, mol.natoms)])
|
|
2152
|
+
result = metal_ox_ac
|
|
2153
|
+
results_dictionary = {'colnames': colnames, 'results': result}
|
|
2154
|
+
return results_dictionary
|
|
2155
|
+
|
|
2156
|
+
|
|
2157
|
+
def generate_metal_ox_deltametrics(oxmodifier, mol, loud, depth=4, oct=True,
|
|
2158
|
+
flag_name=False, metal_ind=None, use_dist=False, size_normalize=False):
|
|
2159
|
+
# # oxmodifier - dict, used to modify prop vector (e.g. for adding
|
|
2160
|
+
# # ONLY used with ox_nuclear_charge ox or charge)
|
|
2161
|
+
# # {"Fe":2, "Co": 3} etc, normally only 1 metal...
|
|
2162
|
+
# oct - bool, if complex is octahedral, will use better bond checks
|
|
2163
|
+
result = list()
|
|
2164
|
+
colnames = []
|
|
2165
|
+
metal_ox_ac = metal_only_deltametric(mol, 'ox_nuclear_charge', depth, oct=oct,
|
|
2166
|
+
metal_ind=metal_ind, modifier=oxmodifier, use_dist=use_dist,
|
|
2167
|
+
size_normalize=size_normalize)
|
|
2168
|
+
this_colnames = []
|
|
2169
|
+
for i in range(0, depth + 1):
|
|
2170
|
+
this_colnames.append('O' + '-' + str(i))
|
|
2171
|
+
colnames.append(this_colnames)
|
|
2172
|
+
result.append(metal_ox_ac)
|
|
2173
|
+
results_dictionary = {'colnames': colnames, 'results': result}
|
|
2174
|
+
return results_dictionary
|
|
2175
|
+
|
|
2176
|
+
|
|
2177
|
+
def generate_metal_ox_deltametric_derivatives(oxmodifier, mol, loud, depth=4, oct=True,
|
|
2178
|
+
flag_name=False, metal_ind=False):
|
|
2179
|
+
# # oxmodifier - dict, used to modify prop vector (e.g. for adding
|
|
2180
|
+
# # ONLY used with ox_nuclear_charge ox or charge)
|
|
2181
|
+
# # {"Fe":2, "Co": 3} etc, normally only 1 metal...
|
|
2182
|
+
# oct - bool, if complex is octahedral, will use better bond checks
|
|
2183
|
+
result = list()
|
|
2184
|
+
colnames = []
|
|
2185
|
+
metal_ox_ac = metal_only_deltametric_derivative(mol, 'ox_nuclear_charge',
|
|
2186
|
+
depth, oct=oct, modifier=oxmodifier, metal_ind=metal_ind)
|
|
2187
|
+
for i in range(0, depth + 1):
|
|
2188
|
+
colnames.append(['d' + 'O' + '-' + str(i) + '/d' + 'O' + str(j) for j in range(0, mol.natoms)])
|
|
2189
|
+
|
|
2190
|
+
result = metal_ox_ac
|
|
2191
|
+
results_dictionary = {'colnames': colnames, 'results': result}
|
|
2192
|
+
return results_dictionary
|