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,670 @@
|
|
|
1
|
+
# @file rungen.py
|
|
2
|
+
# Top level script that coordinates generation of all files
|
|
3
|
+
#
|
|
4
|
+
# Written by Tim Ioannidis for HJK Group
|
|
5
|
+
#
|
|
6
|
+
# Dpt of Chemical Engineering, MIT
|
|
7
|
+
|
|
8
|
+
import itertools
|
|
9
|
+
import os
|
|
10
|
+
import random
|
|
11
|
+
import shutil
|
|
12
|
+
import sys
|
|
13
|
+
from collections import Counter
|
|
14
|
+
import glob
|
|
15
|
+
from typing import List, Union, Tuple
|
|
16
|
+
|
|
17
|
+
from argparse import Namespace
|
|
18
|
+
from molSimplify.Classes.globalvars import globalvars
|
|
19
|
+
from molSimplify.Scripts.isomers import generateisomers
|
|
20
|
+
from molSimplify.Scripts.jobgen import (sgejobgen,
|
|
21
|
+
slurmjobgen)
|
|
22
|
+
from molSimplify.Scripts.io import (core_load,
|
|
23
|
+
getlicores,
|
|
24
|
+
lig_load,
|
|
25
|
+
name_complex,
|
|
26
|
+
name_ts_complex,
|
|
27
|
+
substr_load)
|
|
28
|
+
from molSimplify.Scripts.qcgen import (mlpgen,
|
|
29
|
+
multigamgen,
|
|
30
|
+
multimolcgen,
|
|
31
|
+
multiogen,
|
|
32
|
+
multiqgen,
|
|
33
|
+
multitcgen)
|
|
34
|
+
from molSimplify.Scripts.structgen import (structgen)
|
|
35
|
+
|
|
36
|
+
# ##################################################################
|
|
37
|
+
# ## define input for cross-compatibility between python 2 and 3 ###
|
|
38
|
+
# ##################################################################
|
|
39
|
+
get_input = input
|
|
40
|
+
if sys.version_info[:2] <= (2, 7):
|
|
41
|
+
get_input = raw_input # noqa: F821
|
|
42
|
+
|
|
43
|
+
# ####################################
|
|
44
|
+
# ## constrained random generation ###
|
|
45
|
+
# ####################################
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def constrgen(rundir: str, args: Namespace) -> Tuple[Union[Namespace, bool], str]:
|
|
49
|
+
# 8/13/23 Roland: Adding assert boolean checks for ligocc and lig info in args. Should quit early so that user
|
|
50
|
+
# doesn't have and infinitely running code (-ligocc 0) or gets a nonsensical error (missing -lig gives NoneType error). More asserts
|
|
51
|
+
# can be added should it be necessary. Also, for consistency, coord number should be greater than or equal to
|
|
52
|
+
# ligocc + (lignum-1)
|
|
53
|
+
assert type(args.ligocc)==list and int(args.ligocc[0])>0, "Input File Error: -ligocc should be present and greater than 0"
|
|
54
|
+
assert type(args.lig)==list and len(args.lig)>0, "Input File Error: -lig should be present with a valid ligand"
|
|
55
|
+
assert int(args.coord)>=int(args.ligocc[0])+(int(args.lignum)-1), "Input File Error: -coord should be greater than or equal to the sum of ligocc and lignum-1"
|
|
56
|
+
|
|
57
|
+
emsg = ""
|
|
58
|
+
# load global variables
|
|
59
|
+
licores = getlicores()
|
|
60
|
+
print('Random generation started..\n\n')
|
|
61
|
+
# if ligand constraint apply it now
|
|
62
|
+
ligs0 = []
|
|
63
|
+
ligocc0 = []
|
|
64
|
+
coord = False if not args.coord else int(args.coord)
|
|
65
|
+
if args.gui:
|
|
66
|
+
args.gui.iWtxt.setText('\n----------------------------------------------------------------------------------\n' +
|
|
67
|
+
'Random generation started\nGenerating ligand combinations.\n\n'+args.gui.iWtxt.toPlainText())
|
|
68
|
+
args.gui.app.processEvents()
|
|
69
|
+
if args.lig:
|
|
70
|
+
for i, li in enumerate(args.lig):
|
|
71
|
+
ligs0.append(li)
|
|
72
|
+
ligentry, emsg = lig_load(li) # check ligand
|
|
73
|
+
# update ligand
|
|
74
|
+
if ligentry:
|
|
75
|
+
args.lig[i] = ligentry.name
|
|
76
|
+
if emsg:
|
|
77
|
+
return False, emsg
|
|
78
|
+
if args.ligocc:
|
|
79
|
+
if len(args.ligocc) < i and len(args.lig) == 1:
|
|
80
|
+
args.ligocc.append(coord)
|
|
81
|
+
elif len(args.ligocc) < i:
|
|
82
|
+
args.ligocc.append(1)
|
|
83
|
+
else:
|
|
84
|
+
args.ligocc = []
|
|
85
|
+
if len(args.lig) == 1:
|
|
86
|
+
args.ligocc.append(coord)
|
|
87
|
+
else:
|
|
88
|
+
args.ligocc.append(1)
|
|
89
|
+
ligocc0.append(args.ligocc[i])
|
|
90
|
+
if args.lignum:
|
|
91
|
+
args.lignum = str(int(args.lignum) - 1)
|
|
92
|
+
# check for smiles
|
|
93
|
+
if not ligentry.denticity:
|
|
94
|
+
if args.smicat and len(args.smicat) >= i and args.smicat[i]:
|
|
95
|
+
ligentry.denticity = len(args.smicat[i])
|
|
96
|
+
else:
|
|
97
|
+
ligentry.denticity = 1
|
|
98
|
+
if coord:
|
|
99
|
+
coord -= int(args.ligocc[i])*ligentry.denticity
|
|
100
|
+
licores.pop(li, None) # remove from dictionary
|
|
101
|
+
# check for ligand groups
|
|
102
|
+
licoresnew = dict()
|
|
103
|
+
if args.liggrp and 'all' != args.liggrp.lower():
|
|
104
|
+
for key in list(licores.keys()):
|
|
105
|
+
if args.liggrp.lower() in licores[key][3]:
|
|
106
|
+
if not args.ligctg or args.ligctg.lower() == 'all':
|
|
107
|
+
licoresnew[key] = licores[key]
|
|
108
|
+
elif args.ligctg and args.ligctg.lower() in licores[key][3]:
|
|
109
|
+
licoresnew[key] = licores[key]
|
|
110
|
+
licores = licoresnew
|
|
111
|
+
# remove aminoacids
|
|
112
|
+
licoresnew = dict()
|
|
113
|
+
for key in list(licores.keys()):
|
|
114
|
+
if 'aminoacid' not in licores[key][3]:
|
|
115
|
+
licoresnew[key] = licores[key]
|
|
116
|
+
licores = licoresnew
|
|
117
|
+
# get a sample of these combinations
|
|
118
|
+
samps = getconstsample(int(args.rgen[0]), args, licores, coord)
|
|
119
|
+
if len(samps) == 0:
|
|
120
|
+
if coord == 0:
|
|
121
|
+
args.lig = [a for a in ligs0]
|
|
122
|
+
args.ligocc = [int(a) for a in ligocc0]
|
|
123
|
+
# run structure generation
|
|
124
|
+
emsg = rungen(rundir, args)
|
|
125
|
+
else:
|
|
126
|
+
if args.gui:
|
|
127
|
+
from molSimplify.Classes.mWidgets import mQDialogErr
|
|
128
|
+
qqb = mQDialogErr(
|
|
129
|
+
'Error', 'No suitable ligand sets were found for random generation. Exiting...')
|
|
130
|
+
qqb.setParent(args.gui.wmain)
|
|
131
|
+
else:
|
|
132
|
+
emsg = 'No suitable ligand sets were found for random generation. Exiting...'
|
|
133
|
+
print(
|
|
134
|
+
'No suitable ligand sets were found for random generation. Exiting...\n\n')
|
|
135
|
+
return args, emsg
|
|
136
|
+
# loop over samples
|
|
137
|
+
for combo in samps:
|
|
138
|
+
args.lig = [a for a in ligs0]
|
|
139
|
+
args.ligocc = [int(a) for a in ligocc0]
|
|
140
|
+
for cj in set(combo):
|
|
141
|
+
lcount = Counter(combo)
|
|
142
|
+
rocc = lcount[cj]
|
|
143
|
+
args.lig.append(list(licores.keys())[cj])
|
|
144
|
+
args.ligocc.append(rocc)
|
|
145
|
+
# check for keep Hydrogens
|
|
146
|
+
for iiH in range(len(ligs0), len(args.lig)):
|
|
147
|
+
opt = True if args.rkHs else False
|
|
148
|
+
if args.keepHs and len(args.keepHs) > iiH:
|
|
149
|
+
args.keepHs[iiH] = opt
|
|
150
|
+
elif args.keepHs:
|
|
151
|
+
args.keepHs.append(opt)
|
|
152
|
+
else:
|
|
153
|
+
args.keepHs = [opt]
|
|
154
|
+
emsg = rungen(rundir, args) # run structure generation
|
|
155
|
+
return args, emsg
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
# ##############################################
|
|
159
|
+
# ## get sample aggreeing to the constraints ###
|
|
160
|
+
# ##############################################
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def getconstsample(no_rgen, args, licores, coord):
|
|
164
|
+
samp = []
|
|
165
|
+
# 4 types of constraints: ligand, ligocc, coord, lignum
|
|
166
|
+
# get ligand and ligocc
|
|
167
|
+
combos = []
|
|
168
|
+
generated = 0
|
|
169
|
+
if not coord:
|
|
170
|
+
coord = 6 # default octahedral
|
|
171
|
+
# generate all combinations of ligands
|
|
172
|
+
combos += (list(itertools.combinations_with_replacement(list(range(0, len(licores))), coord)))
|
|
173
|
+
random.shuffle(combos)
|
|
174
|
+
for combo in combos:
|
|
175
|
+
# get total denticity
|
|
176
|
+
totdent = 0
|
|
177
|
+
dents = []
|
|
178
|
+
for li in combo:
|
|
179
|
+
totdent += int(len(licores[list(licores.keys())[li]][2]))
|
|
180
|
+
dents.append(int(len(licores[list(licores.keys())[li]][2])))
|
|
181
|
+
# check for multiple multidentate ligands
|
|
182
|
+
dsorted = sorted(dents)
|
|
183
|
+
if not coord or (coord and totdent == coord):
|
|
184
|
+
if not (len(dsorted) > 1 and (dsorted[-1]+dsorted[-2] > totdent)):
|
|
185
|
+
if (args.lignum and len(set(combo)) == int(args.lignum)):
|
|
186
|
+
# reorder with high denticity atoms in the beginning
|
|
187
|
+
keysl = sorted(list(range(len(dents))),
|
|
188
|
+
key=lambda k: dents[k])
|
|
189
|
+
ncombo = [combo[i] for i in keysl]
|
|
190
|
+
# add combo
|
|
191
|
+
samp.append(ncombo)
|
|
192
|
+
generated += 1
|
|
193
|
+
elif not args.lignum:
|
|
194
|
+
# reorder with high denticity atoms in the beginning
|
|
195
|
+
keysl = sorted(list(range(len(dents))),
|
|
196
|
+
key=lambda k: dents[k])
|
|
197
|
+
ncombo = [combo[i] for i in keysl]
|
|
198
|
+
# add combo
|
|
199
|
+
samp.append(ncombo)
|
|
200
|
+
generated += 1
|
|
201
|
+
if (generated >= no_rgen):
|
|
202
|
+
break
|
|
203
|
+
return samp
|
|
204
|
+
|
|
205
|
+
# Generates multiple runs for different oxidation and spin states
|
|
206
|
+
# @param rundir Run directory
|
|
207
|
+
# @param args Namespace of arguments
|
|
208
|
+
# @param globs Global variables
|
|
209
|
+
# @return Error messages
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
def multigenruns(rundir, args, write_files=True):
|
|
213
|
+
emsg = False
|
|
214
|
+
args.jid = 0 # initilize global name identifier
|
|
215
|
+
multch = False
|
|
216
|
+
multsp = False
|
|
217
|
+
charges = args.charge
|
|
218
|
+
spins = args.spin
|
|
219
|
+
# check if multiple charges specified
|
|
220
|
+
if args.charge and len(args.charge) > 1:
|
|
221
|
+
multch = True
|
|
222
|
+
# check if multiple spin states specified
|
|
223
|
+
if (args.spin and len(args.spin) > 1):
|
|
224
|
+
multsp = True
|
|
225
|
+
# iterate over all
|
|
226
|
+
if (multch and multsp):
|
|
227
|
+
for ch in charges:
|
|
228
|
+
for sp in spins:
|
|
229
|
+
args.charge = ch
|
|
230
|
+
args.spin = sp
|
|
231
|
+
if ch[0] == '-':
|
|
232
|
+
fname = 'N'+ch[1:]+'S'+sp
|
|
233
|
+
else:
|
|
234
|
+
fname = 'P'+ch+'S'+sp
|
|
235
|
+
emsg = rungen(rundir, args, fname, write_files=write_files)
|
|
236
|
+
if emsg:
|
|
237
|
+
return emsg
|
|
238
|
+
|
|
239
|
+
elif (multch):
|
|
240
|
+
for ch in charges:
|
|
241
|
+
args.charge = ch
|
|
242
|
+
if (args.spin):
|
|
243
|
+
args.spin = args.spin[0]
|
|
244
|
+
if ch[0] == '-':
|
|
245
|
+
fname = 'N'+ch[1:]
|
|
246
|
+
else:
|
|
247
|
+
fname = 'P'+ch[1:]
|
|
248
|
+
emsg = rungen(rundir, args, fname, write_files=write_files)
|
|
249
|
+
if emsg:
|
|
250
|
+
return emsg
|
|
251
|
+
elif (multsp):
|
|
252
|
+
if args.charge:
|
|
253
|
+
args.charge = args.charge[0]
|
|
254
|
+
for sp in spins:
|
|
255
|
+
args.spin = sp
|
|
256
|
+
fname = 'S'+sp
|
|
257
|
+
emsg = rungen(rundir, args, fname, write_files=write_files)
|
|
258
|
+
if emsg:
|
|
259
|
+
return emsg
|
|
260
|
+
elif args.isomers or args.stereos:
|
|
261
|
+
isomers = generateisomers(args)
|
|
262
|
+
if args.charge:
|
|
263
|
+
args.charge = args.charge[0]
|
|
264
|
+
if args.spin:
|
|
265
|
+
args.spin = args.spin[0]
|
|
266
|
+
args.ligloc = True
|
|
267
|
+
|
|
268
|
+
# store information about the overall ligand complex
|
|
269
|
+
keepHs_dict = {}
|
|
270
|
+
ligocc_dict = {}
|
|
271
|
+
for counter, i in enumerate(args.lig):
|
|
272
|
+
keepHs_dict[i] = args.keepHs[counter]
|
|
273
|
+
ligocc_dict[i] = args.ligocc[counter]
|
|
274
|
+
|
|
275
|
+
for counter, isomer in enumerate(isomers):
|
|
276
|
+
# set args for the generation of a specific isomer
|
|
277
|
+
args.lig = isomer
|
|
278
|
+
if args.stereos:
|
|
279
|
+
if (counter+1) % 2 == 0:
|
|
280
|
+
unique_name = '_stereo_'+str(int(counter/2+1))
|
|
281
|
+
else:
|
|
282
|
+
unique_name = '_isomer_'+str(int(counter/2+1))
|
|
283
|
+
else:
|
|
284
|
+
unique_name = '_isomer_'+str(counter+1)
|
|
285
|
+
args.ligocc = [1]*len(isomer)
|
|
286
|
+
args.keepHs = []
|
|
287
|
+
args.name = str(args.core)+'_ox_' + \
|
|
288
|
+
str(args.oxstate)+'_spin_'+str(args.spin)
|
|
289
|
+
for ligand in list(keepHs_dict.keys()):
|
|
290
|
+
args.name += '_'+ligand+'_'+str(ligocc_dict[ligand])
|
|
291
|
+
args.name += unique_name
|
|
292
|
+
for ligand in args.lig:
|
|
293
|
+
if ligand.endswith('_flipped'):
|
|
294
|
+
ligand = ligand[:-8]
|
|
295
|
+
args.keepHs.append(keepHs_dict[ligand])
|
|
296
|
+
|
|
297
|
+
print('**************************************************************')
|
|
298
|
+
print(('******************* Generating isomer ' +
|
|
299
|
+
str(counter+1) + '! *******************'))
|
|
300
|
+
print('**************************************************************')
|
|
301
|
+
emsg = rungen(rundir, args, write_files=write_files)
|
|
302
|
+
return emsg
|
|
303
|
+
else:
|
|
304
|
+
if args.charge:
|
|
305
|
+
args.charge = args.charge[0]
|
|
306
|
+
if args.spin:
|
|
307
|
+
args.spin = args.spin[0]
|
|
308
|
+
emsg = rungen(rundir, args, write_files=write_files)
|
|
309
|
+
return emsg
|
|
310
|
+
|
|
311
|
+
# Check for multiple ligands specified in one file
|
|
312
|
+
# @param ligs List of ligands
|
|
313
|
+
# @return Ligand list, connecting atoms, multiple ligand flag
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
def checkmultilig(ligs: List[str]) -> Tuple[List[List[str]], List[List[str]], int]:
|
|
317
|
+
mligs = []
|
|
318
|
+
tcats = []
|
|
319
|
+
multidx = -1
|
|
320
|
+
# loop over ligands
|
|
321
|
+
|
|
322
|
+
for i, lig in enumerate(ligs):
|
|
323
|
+
connatoms: List[str] = []
|
|
324
|
+
if '.smi' in lig:
|
|
325
|
+
if '~' in lig:
|
|
326
|
+
lig = lig.replace('~', os.path.expanduser("~"))
|
|
327
|
+
# read molecule
|
|
328
|
+
if glob.glob(lig):
|
|
329
|
+
print('found ligand file')
|
|
330
|
+
with open(lig, 'r') as f:
|
|
331
|
+
s = f.read().splitlines()
|
|
332
|
+
for ss in s:
|
|
333
|
+
ss = ss.replace('\t', ' ')
|
|
334
|
+
sf = [_f for _f in ss.split(' ') if _f]
|
|
335
|
+
if len(sf) > 0:
|
|
336
|
+
connatoms.append(sf[-1])
|
|
337
|
+
multidx = i
|
|
338
|
+
if len(s) > 1:
|
|
339
|
+
mligs.append(s)
|
|
340
|
+
else:
|
|
341
|
+
mligs.append([lig])
|
|
342
|
+
else:
|
|
343
|
+
mligs.append([lig])
|
|
344
|
+
else:
|
|
345
|
+
mligs.append([lig])
|
|
346
|
+
tcats.append(connatoms)
|
|
347
|
+
ligandslist = list(itertools.product(*mligs))
|
|
348
|
+
|
|
349
|
+
# convert tuple to list
|
|
350
|
+
llist = []
|
|
351
|
+
for l0 in ligandslist:
|
|
352
|
+
loclist = []
|
|
353
|
+
if len(l0) > 0:
|
|
354
|
+
for l1 in l0:
|
|
355
|
+
loclist.append(l1)
|
|
356
|
+
llist.append(loclist)
|
|
357
|
+
|
|
358
|
+
return llist, tcats, multidx
|
|
359
|
+
|
|
360
|
+
# Draw mode supervisor
|
|
361
|
+
# @param args Namespace of arguments
|
|
362
|
+
# @param rundir Run directory
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
def draw_supervisor(args: Namespace, rundir: str):
|
|
366
|
+
if args.lig:
|
|
367
|
+
print('Due to technical limitations, we will draw only the first ligand.')
|
|
368
|
+
print('To view multiple ligands at once, consider using the GUI instead.')
|
|
369
|
+
li = args.lig[0]
|
|
370
|
+
lig, emsg = lig_load(li)
|
|
371
|
+
if lig is not None:
|
|
372
|
+
lig.draw_svg(li)
|
|
373
|
+
elif args.core:
|
|
374
|
+
if len(args.core) > 1:
|
|
375
|
+
print('Due to technical limitations, we will draw only the first core.')
|
|
376
|
+
print('Drawing the core.')
|
|
377
|
+
if args.substrate:
|
|
378
|
+
print('Due to technical limitations, we can draw only one structure per run. '
|
|
379
|
+
'To draw the substrate, run the program again.')
|
|
380
|
+
cc, emsg = core_load(args.core[0])
|
|
381
|
+
if cc is not None:
|
|
382
|
+
cc.draw_svg(args.core[0])
|
|
383
|
+
elif args.substrate:
|
|
384
|
+
if len(args.substrate) > 1:
|
|
385
|
+
print('Due to technical limitations, we will draw only the first substrate.')
|
|
386
|
+
print('Drawing the substrate.')
|
|
387
|
+
print((args.substrate[0]))
|
|
388
|
+
substrate, subcatoms, emsg = substr_load(args.substrate[0], 0, args.subcatoms)
|
|
389
|
+
if substrate is not None:
|
|
390
|
+
substrate.draw_svg(args.substrate[0])
|
|
391
|
+
else:
|
|
392
|
+
print('You have not specified anything to draw. Currently supported: ligand, core, substrate')
|
|
393
|
+
|
|
394
|
+
# Normal structure generation
|
|
395
|
+
# @param rundir Run directory
|
|
396
|
+
# @param args Namespace of arguments
|
|
397
|
+
# @param chspfname Folder name for charges and spins
|
|
398
|
+
# @return Error messages
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
def rungen(rundir, args: Namespace, chspfname=None, write_files: bool = True):
|
|
402
|
+
if isinstance(args.spin, list):
|
|
403
|
+
args.spin=args.spin[0]
|
|
404
|
+
|
|
405
|
+
emsg = ''
|
|
406
|
+
globs = globalvars()
|
|
407
|
+
globs.nosmiles = 0 # reset smiles ligands for each run
|
|
408
|
+
# check for specified ligands/functionalization
|
|
409
|
+
ligocc = []
|
|
410
|
+
# check for files specified for multiple ligands
|
|
411
|
+
mligs: List[List[str]] = [[]]
|
|
412
|
+
catoms: List[List[str]] = [[]]
|
|
413
|
+
if args.lig is not None:
|
|
414
|
+
if args.lig:
|
|
415
|
+
mligs, catoms, multidx = checkmultilig(args.lig)
|
|
416
|
+
if args.debug:
|
|
417
|
+
print('after checking for multiple ligs, we found '
|
|
418
|
+
f'{multidx} ligands')
|
|
419
|
+
# save initial
|
|
420
|
+
smicat0 = [ss for ss in args.smicat] if args.smicat else []
|
|
421
|
+
# loop over ligands
|
|
422
|
+
for mcount, mlig in enumerate(mligs):
|
|
423
|
+
args.smicat = [ss for ss in smicat0] if smicat0 else []
|
|
424
|
+
args.checkdir, skip = False, False # initialize flags
|
|
425
|
+
if len(mligs) > 0 and mligs[0]:
|
|
426
|
+
args.lig = mlig # get combination
|
|
427
|
+
if multidx != -1:
|
|
428
|
+
if catoms[multidx][mcount]:
|
|
429
|
+
ssatoms = catoms[multidx][mcount].split(',')
|
|
430
|
+
lloc = [int(scat)-1 for scat in ssatoms]
|
|
431
|
+
# append connection atoms if specified in smiles
|
|
432
|
+
if args.smicat and len(args.smicat) > 0:
|
|
433
|
+
for i in range(len(args.smicat), multidx):
|
|
434
|
+
args.smicat.append([])
|
|
435
|
+
else:
|
|
436
|
+
args.smicat = [lloc]
|
|
437
|
+
args.smicat[multidx] = lloc
|
|
438
|
+
if (args.lig):
|
|
439
|
+
ligands = args.lig
|
|
440
|
+
if (args.ligocc):
|
|
441
|
+
ligocc = args.ligocc
|
|
442
|
+
else:
|
|
443
|
+
ligocc = ['1']
|
|
444
|
+
for i in range(len(ligocc), len(ligands)):
|
|
445
|
+
ligocc.append('1')
|
|
446
|
+
lig = ''
|
|
447
|
+
for i, l in enumerate(ligands):
|
|
448
|
+
ligentry, emsg = lig_load(l)
|
|
449
|
+
# update ligand
|
|
450
|
+
if ligentry:
|
|
451
|
+
ligands[i] = ligentry.name
|
|
452
|
+
args.lig[i] = ligentry.name
|
|
453
|
+
if emsg:
|
|
454
|
+
skip = True
|
|
455
|
+
break
|
|
456
|
+
if ligentry.ident == 'smi':
|
|
457
|
+
ligentry.ident += str(globs.nosmiles)
|
|
458
|
+
globs.nosmiles += 1
|
|
459
|
+
if args.sminame:
|
|
460
|
+
if len(args.sminame) > int(ligentry.ident[-1]):
|
|
461
|
+
ligentry.ident = args.sminame[globs.nosmiles-1][0:3]
|
|
462
|
+
lig += ''.join("%s%s" % (ligentry.ident, ligocc[i]))
|
|
463
|
+
else:
|
|
464
|
+
ligands = []
|
|
465
|
+
lig = ''
|
|
466
|
+
ligocc = []
|
|
467
|
+
# fetch smart name
|
|
468
|
+
fname = name_complex(rundir, args.core, args.geometry, ligands, ligocc,
|
|
469
|
+
mcount, args, nconf=False, sanity=False, bind=args.bind, bsmi=args.nambsmi)
|
|
470
|
+
if args.tsgen:
|
|
471
|
+
substrate = args.substrate
|
|
472
|
+
subcatoms = ['multiple']
|
|
473
|
+
if args.subcatoms:
|
|
474
|
+
subcatoms = args.subcatoms
|
|
475
|
+
mlig = args.mlig
|
|
476
|
+
mligcatoms = args.mligcatoms
|
|
477
|
+
fname = name_ts_complex(rundir, args.core, args.geometry, ligands, ligocc,
|
|
478
|
+
substrate, subcatoms, mlig, mligcatoms, mcount,
|
|
479
|
+
args, nconf=False, sanity=False, bind=args.bind,
|
|
480
|
+
bsmi=args.nambsmi)
|
|
481
|
+
if args.debug:
|
|
482
|
+
print(('fname is ' + str(fname)))
|
|
483
|
+
rootdir = fname
|
|
484
|
+
# check for charges/spin
|
|
485
|
+
rootcheck = ""
|
|
486
|
+
if chspfname is not None:
|
|
487
|
+
rootcheck = rootdir
|
|
488
|
+
rootdir = rootdir + '/' + chspfname
|
|
489
|
+
if (args.suff):
|
|
490
|
+
rootdir += args.suff
|
|
491
|
+
# check for mannual overwrite of
|
|
492
|
+
# directory name
|
|
493
|
+
if args.jobdir:
|
|
494
|
+
rootdir = rundir + args.jobdir
|
|
495
|
+
# check for top directory
|
|
496
|
+
if rootcheck and os.path.isdir(rootcheck) and not args.checkdirt and not skip:
|
|
497
|
+
args.checkdirt = True
|
|
498
|
+
if not args.rprompt:
|
|
499
|
+
flagdir = get_input('\nDirectory ' + rootcheck +
|
|
500
|
+
' already exists. Keep both (k), replace (r) or skip (s) k/r/s: ')
|
|
501
|
+
if 'k' in flagdir.lower():
|
|
502
|
+
flagdir = 'keep'
|
|
503
|
+
elif 's' in flagdir.lower():
|
|
504
|
+
flagdir = 'skip'
|
|
505
|
+
else:
|
|
506
|
+
flagdir = 'replace'
|
|
507
|
+
else:
|
|
508
|
+
# qqb = qBoxFolder(args.gui.wmain,'Folder exists',
|
|
509
|
+
# 'Directory '+rootcheck+' already exists. What do you want to do?')
|
|
510
|
+
# flagdir = qqb.getaction()
|
|
511
|
+
flagdir = 'replace'
|
|
512
|
+
# replace existing directory
|
|
513
|
+
if (flagdir == 'replace'):
|
|
514
|
+
shutil.rmtree(rootcheck)
|
|
515
|
+
os.mkdir(rootcheck)
|
|
516
|
+
# skip existing directory
|
|
517
|
+
elif flagdir == 'skip':
|
|
518
|
+
skip = True
|
|
519
|
+
# keep both (default)
|
|
520
|
+
else:
|
|
521
|
+
ifold = 1
|
|
522
|
+
while glob.glob(rootdir+'_'+str(ifold)):
|
|
523
|
+
ifold += 1
|
|
524
|
+
rootcheck += '_'+str(ifold)
|
|
525
|
+
os.mkdir(rootcheck)
|
|
526
|
+
elif rootcheck and (not os.path.isdir(rootcheck) or not args.checkdirt) and not skip:
|
|
527
|
+
if args.debug:
|
|
528
|
+
print(('rootcheck is ' + str(rootcheck)))
|
|
529
|
+
args.checkdirt = True
|
|
530
|
+
try:
|
|
531
|
+
os.mkdir(rootcheck)
|
|
532
|
+
except FileExistsError:
|
|
533
|
+
print(f'Directory {rootcheck} can not be created. Exiting..\n')
|
|
534
|
+
return f'Directory {rootcheck} can not be created. Exiting..'
|
|
535
|
+
# check for actual directory
|
|
536
|
+
if os.path.isdir(rootdir) and not args.checkdirb and not skip and not args.jobdir:
|
|
537
|
+
args.checkdirb = True
|
|
538
|
+
if not args.rprompt:
|
|
539
|
+
flagdir = get_input(
|
|
540
|
+
'\nDirectory '+rootdir + ' already exists. Keep both (k), replace (r) or skip (s) k/r/s: ')
|
|
541
|
+
if 'k' in flagdir.lower():
|
|
542
|
+
flagdir = 'keep'
|
|
543
|
+
elif 's' in flagdir.lower():
|
|
544
|
+
flagdir = 'skip'
|
|
545
|
+
else:
|
|
546
|
+
flagdir = 'replace'
|
|
547
|
+
else:
|
|
548
|
+
# qqb = qBoxFolder(args.gui.wmain,'Folder exists',
|
|
549
|
+
# 'Directory '+rootdir+' already exists. What do you want to do?')
|
|
550
|
+
# flagdir = qqb.getaction()
|
|
551
|
+
flagdir = 'replace'
|
|
552
|
+
# replace existing directory
|
|
553
|
+
if (flagdir == 'replace'):
|
|
554
|
+
shutil.rmtree(rootdir)
|
|
555
|
+
os.mkdir(rootdir)
|
|
556
|
+
# skip existing directory
|
|
557
|
+
elif flagdir == 'skip':
|
|
558
|
+
skip = True
|
|
559
|
+
# keep both (default)
|
|
560
|
+
else:
|
|
561
|
+
ifold = 1
|
|
562
|
+
while glob.glob(rootdir+'_'+str(ifold)):
|
|
563
|
+
ifold += 1
|
|
564
|
+
rootdir += '_'+str(ifold)
|
|
565
|
+
os.mkdir(rootdir)
|
|
566
|
+
elif not os.path.isdir(rootdir) or not args.checkdirb and not skip:
|
|
567
|
+
if not os.path.isdir(rootdir):
|
|
568
|
+
if write_files:
|
|
569
|
+
args.checkdirb = True
|
|
570
|
+
os.mkdir(rootdir)
|
|
571
|
+
|
|
572
|
+
# ###################################
|
|
573
|
+
# ########### GENERATION ############
|
|
574
|
+
# ###################################
|
|
575
|
+
if not skip:
|
|
576
|
+
# check for generate all
|
|
577
|
+
if args.genall:
|
|
578
|
+
tstrfiles = []
|
|
579
|
+
# generate xyz with FF and trained ML
|
|
580
|
+
args.ff = 'mmff94'
|
|
581
|
+
args.ffoption = 'ba'
|
|
582
|
+
args.MLbonds = False
|
|
583
|
+
strfiles, emsg, this_diag = structgen(
|
|
584
|
+
args, rootdir, ligands, ligocc, mcount, write_files=write_files)
|
|
585
|
+
for strf in strfiles:
|
|
586
|
+
tstrfiles.append(strf+'FFML')
|
|
587
|
+
os.rename(strf+'.xyz', strf+'FFML.xyz')
|
|
588
|
+
# generate xyz with FF and covalent
|
|
589
|
+
args.MLbonds = ['c' for i in range(0, len(args.lig))]
|
|
590
|
+
strfiles, emsg, this_diag = structgen(
|
|
591
|
+
args, rootdir, ligands, ligocc, mcount, write_files=write_files)
|
|
592
|
+
for strf in strfiles:
|
|
593
|
+
tstrfiles.append(strf+'FFc')
|
|
594
|
+
os.rename(strf+'.xyz', strf+'FFc.xyz')
|
|
595
|
+
args.ff = False
|
|
596
|
+
args.ffoption = False
|
|
597
|
+
args.MLbonds = False
|
|
598
|
+
# generate xyz without FF and trained ML
|
|
599
|
+
strfiles, emsg, this_diag = structgen(
|
|
600
|
+
args, rootdir, ligands, ligocc, mcount, write_files=write_files)
|
|
601
|
+
for strf in strfiles:
|
|
602
|
+
tstrfiles.append(strf+'ML')
|
|
603
|
+
os.rename(strf+'.xyz', strf+'ML.xyz')
|
|
604
|
+
args.MLbonds = ['c' for i in range(0, len(args.lig))]
|
|
605
|
+
# generate xyz without FF and covalent ML
|
|
606
|
+
strfiles, emsg, this_diag = structgen(
|
|
607
|
+
args, rootdir, ligands, ligocc, mcount, write_files=write_files)
|
|
608
|
+
for strf in strfiles:
|
|
609
|
+
tstrfiles.append(strf+'c')
|
|
610
|
+
os.rename(strf+'.xyz', strf+'c.xyz')
|
|
611
|
+
strfiles = tstrfiles
|
|
612
|
+
else:
|
|
613
|
+
# generate xyz files
|
|
614
|
+
strfiles, emsg, this_diag = structgen(
|
|
615
|
+
args, rootdir, ligands, ligocc, mcount, write_files=write_files)
|
|
616
|
+
# generate QC input files
|
|
617
|
+
if args.qccode and (not emsg) and write_files:
|
|
618
|
+
if args.charge and (isinstance(args.charge, list)):
|
|
619
|
+
args.charge = args.charge[0]
|
|
620
|
+
if args.spin and (isinstance(args.spin, list)):
|
|
621
|
+
args.spin = args.spin[0]
|
|
622
|
+
if args.qccode.lower() in 'terachem tc Terachem TeraChem TERACHEM TC':
|
|
623
|
+
jobdirs = multitcgen(args, strfiles)
|
|
624
|
+
print('TeraChem input files generated!')
|
|
625
|
+
elif 'gam' in args.qccode.lower():
|
|
626
|
+
jobdirs = multigamgen(args, strfiles)
|
|
627
|
+
print('GAMESS input files generated!')
|
|
628
|
+
elif 'qch' in args.qccode.lower():
|
|
629
|
+
jobdirs = multiqgen(args, strfiles)
|
|
630
|
+
print('QChem input files generated!')
|
|
631
|
+
elif 'orc' in args.qccode.lower():
|
|
632
|
+
jobdirs = multiogen(args, strfiles)
|
|
633
|
+
print('ORCA input files generated!')
|
|
634
|
+
elif 'molc' in args.qccode.lower():
|
|
635
|
+
jobdirs = multimolcgen(args, strfiles)
|
|
636
|
+
print('MOLCAS input files generated!')
|
|
637
|
+
else:
|
|
638
|
+
print(
|
|
639
|
+
'Only TeraChem, GAMESS, QChem, ORCA, MOLCAS are supported right now.\n')
|
|
640
|
+
# check molpac
|
|
641
|
+
if args.mopac and (not emsg) and write_files:
|
|
642
|
+
print('Generating MOPAC input')
|
|
643
|
+
if globs.debug:
|
|
644
|
+
print(strfiles)
|
|
645
|
+
jobdirs = mlpgen(args, strfiles, rootdir)
|
|
646
|
+
# generate jobscripts
|
|
647
|
+
if args.jsched and (not emsg) and (not args.reportonly) and (write_files):
|
|
648
|
+
if args.jsched in 'SBATCH SLURM slurm sbatch':
|
|
649
|
+
slurmjobgen(args, jobdirs)
|
|
650
|
+
print('SLURM jobscripts generated!')
|
|
651
|
+
elif args.jsched in 'SGE Sungrid sge':
|
|
652
|
+
sgejobgen(args, jobdirs)
|
|
653
|
+
print('SGE jobscripts generated!')
|
|
654
|
+
elif multidx != -1: # if ligand input was a list of smiles strings, write good smiles strings to separate list
|
|
655
|
+
if '.smi' in args.lig[0]:
|
|
656
|
+
ligfilename = args.lig[0].split('.')[0]
|
|
657
|
+
with open(ligfilename + '-good.smi', 'a') as f:
|
|
658
|
+
f.write(args.lig[0])
|
|
659
|
+
elif not emsg:
|
|
660
|
+
if args.gui:
|
|
661
|
+
from Classes.mWidgets import mQDialogInf
|
|
662
|
+
qq = mQDialogInf('Folder skipped', 'Folder ' +
|
|
663
|
+
rootdir+' was skipped.')
|
|
664
|
+
qq.setParent(args.gui.wmain)
|
|
665
|
+
else:
|
|
666
|
+
print(('Folder '+rootdir+' was skipped..\n'))
|
|
667
|
+
if write_files:
|
|
668
|
+
return emsg # Default behavior
|
|
669
|
+
# else:
|
|
670
|
+
return strfiles, emsg, this_diag # Assume that user wants these if they're not writing files
|