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,1673 @@
|
|
|
1
|
+
# @file inparse.py
|
|
2
|
+
# Processes inputs
|
|
3
|
+
#
|
|
4
|
+
# Written by Tim Ioannidisfor HJK Group
|
|
5
|
+
#
|
|
6
|
+
# Dpt of Chemical Engineering, MIT
|
|
7
|
+
|
|
8
|
+
import argparse
|
|
9
|
+
import os
|
|
10
|
+
import re
|
|
11
|
+
|
|
12
|
+
import yaml
|
|
13
|
+
|
|
14
|
+
from molSimplify.Classes.globalvars import (defaultspins,
|
|
15
|
+
elementsbynum,
|
|
16
|
+
globalvars,
|
|
17
|
+
metals_conv,
|
|
18
|
+
romans,
|
|
19
|
+
mtlsdlist)
|
|
20
|
+
from molSimplify.Scripts.io import (getbinds, getcores, getgeoms, getlicores,
|
|
21
|
+
getslicores, printgeoms, substr_load, getligs)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Checks input for correctness and uses defaults otherwise
|
|
25
|
+
# @param args Namespace of arguments
|
|
26
|
+
def checkinput(args, calctype="base"):
|
|
27
|
+
globs = globalvars()
|
|
28
|
+
coords, geomnames, geomshorts, geomgroups = getgeoms()
|
|
29
|
+
emsg = False
|
|
30
|
+
if calctype == "base":
|
|
31
|
+
# check core
|
|
32
|
+
if not args.core:
|
|
33
|
+
print((
|
|
34
|
+
'WARNING: No core specified. Defaulting to Fe. Available cores are: '+getcores()))
|
|
35
|
+
args.core = ['fe']
|
|
36
|
+
# convert full element name to symbol for cores:
|
|
37
|
+
if args.core[0].lower() in list(metals_conv.keys()):
|
|
38
|
+
print(('switching core from ' + str(args.core) +
|
|
39
|
+
' to ' + str(metals_conv[args.core[0].lower()])))
|
|
40
|
+
args.core = [metals_conv[args.core[0].lower()]]
|
|
41
|
+
if (args.core[0][0].upper()+args.core[0][1:].lower() in elementsbynum):
|
|
42
|
+
# convert to titlecase
|
|
43
|
+
args.core[0] = args.core[0][0].upper()+args.core[0][1:].lower()
|
|
44
|
+
# check oxidation state
|
|
45
|
+
if not args.oxstate:
|
|
46
|
+
try:
|
|
47
|
+
print(('WARNING: No oxidation state specified. Defaulting to ' +
|
|
48
|
+
globs.defaultoxstate[args.core[0].lower()]))
|
|
49
|
+
args.oxstate = globs.defaultoxstate[args.core[0].lower()]
|
|
50
|
+
except KeyError:
|
|
51
|
+
print('WARNING: No oxidation state specified. Defaulting to 2')
|
|
52
|
+
args.oxstate = '2'
|
|
53
|
+
# check spin state (doesn't work for custom cores)
|
|
54
|
+
if not args.spin:
|
|
55
|
+
if args.oxstate in list(romans.keys()):
|
|
56
|
+
oxstatenum = romans[args.oxstate]
|
|
57
|
+
else:
|
|
58
|
+
oxstatenum = args.oxstate
|
|
59
|
+
if args.core[0].lower() in mtlsdlist:
|
|
60
|
+
if mtlsdlist[args.core[0].lower()]-max(0, int(oxstatenum)-2) in defaultspins:
|
|
61
|
+
defaultspinstate = defaultspins[mtlsdlist[args.core[0].lower(
|
|
62
|
+
)]-max(0, int(oxstatenum)-2)]
|
|
63
|
+
print((
|
|
64
|
+
'WARNING: No spin multiplicity specified. Defaulting to '+defaultspinstate))
|
|
65
|
+
print(
|
|
66
|
+
'Please check this against our ANN output (where available)')
|
|
67
|
+
else:
|
|
68
|
+
print(
|
|
69
|
+
'WARNING: Oxidation state seems to be invalid. Please check. Defaulting to singlet anyway.')
|
|
70
|
+
defaultspinstate = '1'
|
|
71
|
+
else:
|
|
72
|
+
defaultspinstate = '1'
|
|
73
|
+
print(
|
|
74
|
+
'WARNING: No spin multiplicity specified. Defaulting to singlet (1)')
|
|
75
|
+
args.spin = defaultspinstate
|
|
76
|
+
|
|
77
|
+
# check coordination number and geometry from ligands if given
|
|
78
|
+
if (not args.coord) and (not args.geometry) and args.lig:
|
|
79
|
+
if not args.gui:
|
|
80
|
+
# calculate occurrences, denticities etc for all ligands
|
|
81
|
+
licores = getlicores()
|
|
82
|
+
smilesligs = 0
|
|
83
|
+
toccs = 0
|
|
84
|
+
occs0 = []
|
|
85
|
+
dentl = []
|
|
86
|
+
cats0 = []
|
|
87
|
+
ligoc = args.ligocc
|
|
88
|
+
for i, ligname in enumerate(args.lig):
|
|
89
|
+
# if not in cores -> smiles/file
|
|
90
|
+
if ligname not in list(licores.keys()):
|
|
91
|
+
if args.smicat and len(args.smicat) >= (smilesligs+1):
|
|
92
|
+
if 'pi' in args.smicat[smilesligs]:
|
|
93
|
+
cats0.append(['c'])
|
|
94
|
+
else:
|
|
95
|
+
cats0.append(args.smicat[smilesligs])
|
|
96
|
+
else:
|
|
97
|
+
cats0.append([0])
|
|
98
|
+
dent_i = len(cats0[-1])
|
|
99
|
+
smilesligs += 1
|
|
100
|
+
else:
|
|
101
|
+
cats0.append(False)
|
|
102
|
+
# otherwise get denticity from ligands dictionary
|
|
103
|
+
if 'pi' in licores[ligname][2]:
|
|
104
|
+
dent_i = 1
|
|
105
|
+
else:
|
|
106
|
+
if isinstance(licores[ligname][2], str):
|
|
107
|
+
dent_i = 1
|
|
108
|
+
else:
|
|
109
|
+
dent_i = int(len(licores[ligname][2]))
|
|
110
|
+
# get occurrence for each ligand if specified (default 1)
|
|
111
|
+
if ligoc:
|
|
112
|
+
oc_i = int(ligoc[i]) if i < len(ligoc) else 1
|
|
113
|
+
else:
|
|
114
|
+
oc_i = 1
|
|
115
|
+
occs0.append(0) # initialize occurrences list
|
|
116
|
+
dentl.append(dent_i) # append denticity to list
|
|
117
|
+
# loop over occurrence of ligand i to check for max coordination
|
|
118
|
+
for j in range(0, oc_i):
|
|
119
|
+
occs0[i] += 1
|
|
120
|
+
toccs += dent_i
|
|
121
|
+
print(
|
|
122
|
+
('WARNING: No coordination number specified. Calculating from lig, ligocc, and subcatoms and found ' + str(toccs) + '.'))
|
|
123
|
+
args.coord = toccs
|
|
124
|
+
# set default coord if nothing given
|
|
125
|
+
if (not args.coord) and (not args.geometry) and (not args.lig):
|
|
126
|
+
print(
|
|
127
|
+
'WARNING: No coord/geo is specified. Defaulting to 6-coord/octahedral')
|
|
128
|
+
args.coord = 6
|
|
129
|
+
args.geometry = 'oct'
|
|
130
|
+
# default ligand if none given
|
|
131
|
+
if not args.lig and not args.rgen:
|
|
132
|
+
if args.gui:
|
|
133
|
+
from molSimplify.Classes.mWidgets import mQDialogWarn
|
|
134
|
+
qqb = mQDialogWarn('Warning', 'You specified no ligands.')
|
|
135
|
+
qqb.setParent(args.gui.wmain)
|
|
136
|
+
else:
|
|
137
|
+
print('WARNING: No ligands specified. Defaulting to water.')
|
|
138
|
+
args.lig = ['water']
|
|
139
|
+
|
|
140
|
+
if args.coord and (not args.geometry or (args.geometry not in geomnames and args.geometry not in geomshorts)):
|
|
141
|
+
print(('WARNING: No or unknown coordination geometry specified. Defining coordination geometry based on found coordination number: ' +
|
|
142
|
+
globs.defaultgeometry[int(args.coord)][1]))
|
|
143
|
+
args.geometry = globs.defaultgeometry[int(args.coord)][0]
|
|
144
|
+
if args.geometry and not args.coord:
|
|
145
|
+
if args.geometry not in geomnames and args.geometry not in geomshorts:
|
|
146
|
+
print(
|
|
147
|
+
'You have specified an invalid geometry. Available geometries are:')
|
|
148
|
+
printgeoms()
|
|
149
|
+
print('Defaulting to octahedral (6)')
|
|
150
|
+
args.geometry = 'oct'
|
|
151
|
+
args.coord = 6
|
|
152
|
+
else:
|
|
153
|
+
try:
|
|
154
|
+
args.coord = coords[geomnames.index(args.geometry)]
|
|
155
|
+
except ValueError:
|
|
156
|
+
args.coord = coords[geomshorts.index(args.geometry)]
|
|
157
|
+
print((
|
|
158
|
+
'WARNING: No coordination number specified. Defaulting to '+str(args.coord)))
|
|
159
|
+
# check number of ligands
|
|
160
|
+
if args.coord and not args.ligocc:
|
|
161
|
+
print(('WARNING: No ligand numbers specified. Defaulting to ' +
|
|
162
|
+
str(args.coord)+' of the first ligand and 0 of all others.'))
|
|
163
|
+
args.ligocc = [args.coord]
|
|
164
|
+
for lig in args.lig[1:]:
|
|
165
|
+
args.ligocc.append(0)
|
|
166
|
+
elif calctype == "tsgen":
|
|
167
|
+
# load substrate for reference
|
|
168
|
+
print(args.substrate[0], 0, args.subcatoms)
|
|
169
|
+
sub, subcatoms, emsg = substr_load(
|
|
170
|
+
args.substrate[0], 0, args.subcatoms)
|
|
171
|
+
# check core
|
|
172
|
+
if not args.core:
|
|
173
|
+
print((
|
|
174
|
+
'WARNING: No core specified. Defaulting to Fe. \nAvailable cores are: '+getcores()))
|
|
175
|
+
args.core = ['fe']
|
|
176
|
+
if args.core[0][0].upper()+args.core[0][1:].lower() in elementsbynum:
|
|
177
|
+
# convert to titlecase
|
|
178
|
+
args.core[0] = args.core[0][0].upper()+args.core[0][1:].lower()
|
|
179
|
+
# check oxidation state
|
|
180
|
+
if not args.oxstate:
|
|
181
|
+
try:
|
|
182
|
+
print(('WARNING: No oxidation state specified. Defaulting to ' +
|
|
183
|
+
globs.defaultoxstate[args.core[0].lower()]))
|
|
184
|
+
args.oxstate = globs.defaultoxstate[args.core[0].lower()]
|
|
185
|
+
except KeyError:
|
|
186
|
+
print('WARNING: No oxidation state specified. Defaulting to 2')
|
|
187
|
+
args.oxstate = '2'
|
|
188
|
+
# check spin state (doesn't work for custom cores)
|
|
189
|
+
if not args.spin:
|
|
190
|
+
if args.oxstate in list(romans.keys()):
|
|
191
|
+
oxstatenum = romans[args.oxstate]
|
|
192
|
+
else:
|
|
193
|
+
oxstatenum = args.oxstate
|
|
194
|
+
if args.core[0].lower() in mtlsdlist:
|
|
195
|
+
if mtlsdlist[args.core[0].lower()]-max(0, int(oxstatenum)-2) in defaultspins:
|
|
196
|
+
defaultspinstate = defaultspins[mtlsdlist[args.core[0].lower(
|
|
197
|
+
)]-max(0, int(oxstatenum)-2)]
|
|
198
|
+
print((
|
|
199
|
+
'WARNING: No spin multiplicity specified. Defaulting to '+defaultspinstate))
|
|
200
|
+
print(
|
|
201
|
+
'Please check this against our ANN output (where available)')
|
|
202
|
+
else:
|
|
203
|
+
print(
|
|
204
|
+
'WARNING: Oxidation state seems to be invalid. Please check. Defaulting to singlet anyway.')
|
|
205
|
+
defaultspinstate = '1'
|
|
206
|
+
else:
|
|
207
|
+
defaultspinstate = '1'
|
|
208
|
+
print(
|
|
209
|
+
'WARNING: No spin multiplicity specified. Defaulting to singlet (1)')
|
|
210
|
+
args.spin = defaultspinstate
|
|
211
|
+
# check ligands
|
|
212
|
+
if not args.lig and not args.rgen:
|
|
213
|
+
if args.gui:
|
|
214
|
+
from molSimplify.Classes.mWidgets import mQDialogWarn
|
|
215
|
+
qqb = mQDialogWarn('Warning', 'You specified no ligands.')
|
|
216
|
+
qqb.setParent(args.gui.wmain)
|
|
217
|
+
else:
|
|
218
|
+
print('WARNING: No ligands specified. Substrate is placed to core.')
|
|
219
|
+
args.lig = ['']
|
|
220
|
+
# if True in [True for i in args.lig if i in args.substrate]:
|
|
221
|
+
# print('at least one of the ligans is present in the substrate list.')
|
|
222
|
+
# idx_list = []
|
|
223
|
+
# for i,ligand in enumerate(args.lig):
|
|
224
|
+
# if ligand in args.substrate:
|
|
225
|
+
# idx_list.append(i)
|
|
226
|
+
# for i in sorted(idx_list,reverse=True):
|
|
227
|
+
# del args.lig[i]
|
|
228
|
+
# del args.ligocc[i]
|
|
229
|
+
# if True in [True for i in args.core if i.lower() in args.mlig]:
|
|
230
|
+
# print('args.core is in args.mlig.')
|
|
231
|
+
# args.lig.append('x')
|
|
232
|
+
# args.ligocc.append(1)
|
|
233
|
+
# check coordination number and geometry
|
|
234
|
+
if not args.coord and not args.geometry:
|
|
235
|
+
if not args.gui:
|
|
236
|
+
# calculate occurrences, denticities etc for all ligands
|
|
237
|
+
licores = getlicores()
|
|
238
|
+
smilesligs = 0
|
|
239
|
+
toccs = 0
|
|
240
|
+
occs0 = []
|
|
241
|
+
dentl = []
|
|
242
|
+
cats0 = []
|
|
243
|
+
ligoc = args.ligocc
|
|
244
|
+
for i, ligname in enumerate(args.lig):
|
|
245
|
+
# if not in cores -> smiles/file
|
|
246
|
+
if ligname not in list(licores.keys()):
|
|
247
|
+
if args.smicat and len(args.smicat) >= (smilesligs+1):
|
|
248
|
+
if 'pi' in args.smicat[smilesligs]:
|
|
249
|
+
cats0.append(['c'])
|
|
250
|
+
else:
|
|
251
|
+
cats0.append(args.smicat[smilesligs])
|
|
252
|
+
else:
|
|
253
|
+
cats0.append([0])
|
|
254
|
+
dent_i = len(cats0[-1])
|
|
255
|
+
smilesligs += 1
|
|
256
|
+
else:
|
|
257
|
+
cats0.append(False)
|
|
258
|
+
# otherwise get denticity from ligands dictionary
|
|
259
|
+
if 'pi' in licores[ligname][2]:
|
|
260
|
+
dent_i = 1
|
|
261
|
+
else:
|
|
262
|
+
if isinstance(licores[ligname][2], str):
|
|
263
|
+
dent_i = 1
|
|
264
|
+
else:
|
|
265
|
+
dent_i = int(len(licores[ligname][2]))
|
|
266
|
+
# get occurrence for each ligand if specified (default 1)
|
|
267
|
+
oc_i = int(ligoc[i]) if i < len(ligoc) else 1
|
|
268
|
+
occs0.append(0) # initialize occurrences list
|
|
269
|
+
dentl.append(dent_i) # append denticity to list
|
|
270
|
+
# loop over occurrence of ligand i to check for max coordination
|
|
271
|
+
for j in range(0, oc_i):
|
|
272
|
+
occs0[i] += 1
|
|
273
|
+
toccs += dent_i
|
|
274
|
+
for i, substrate in enumerate(args.substrate):
|
|
275
|
+
# if args.core[0].lower() in args.mlig and (substrate not in [lig_i.lower() for lig_i in args.lig]):
|
|
276
|
+
if args.core[0].lower() in args.mlig:
|
|
277
|
+
suboc_i = len(
|
|
278
|
+
[core for core in args.core if core.lower() in args.mlig])
|
|
279
|
+
for j in range(suboc_i):
|
|
280
|
+
toccs += 1
|
|
281
|
+
print(
|
|
282
|
+
('WARNING: No coordination number specified. Calculating from lig, ligocc, and subcatoms and found ' + str(toccs) + '.'))
|
|
283
|
+
args.coord = toccs
|
|
284
|
+
if args.coord and (not args.geometry or (args.geometry not in geomnames and args.geometry not in geomshorts)):
|
|
285
|
+
print(('WARNING: No or unknown coordination geometry specified. Defining coordination geometry based on found coordination number: ' +
|
|
286
|
+
globs.defaultgeometry[int(args.coord)][1]))
|
|
287
|
+
args.geometry = globs.defaultgeometry[int(args.coord)][0]
|
|
288
|
+
if args.geometry and not args.coord:
|
|
289
|
+
coords, geomnames, geomshorts, geomgroups = getgeoms()
|
|
290
|
+
if args.geometry not in geomnames and args.geometry not in geomshorts:
|
|
291
|
+
print(
|
|
292
|
+
'You have specified an invalid geometry. Available geometries are:')
|
|
293
|
+
printgeoms()
|
|
294
|
+
print('Defaulting to octahedral (6)')
|
|
295
|
+
args.geometry = 'oct'
|
|
296
|
+
args.coord = 6
|
|
297
|
+
else:
|
|
298
|
+
try:
|
|
299
|
+
args.coord = coords[geomnames.index(args.geometry)]
|
|
300
|
+
except ValueError:
|
|
301
|
+
args.coord = coords[geomshorts.index(args.geometry)]
|
|
302
|
+
print((
|
|
303
|
+
'WARNING: No coordination number specified. Defaulting to '+str(args.coord)))
|
|
304
|
+
# check number of ligands
|
|
305
|
+
if args.coord and not args.ligocc:
|
|
306
|
+
print(('WARNING: No ligand numbers specified. Defaulting to ' +
|
|
307
|
+
str(args.coord)+' of the first ligand and 0 of all others.'))
|
|
308
|
+
args.ligocc = [args.coord]
|
|
309
|
+
for lig in args.lig[1:]:
|
|
310
|
+
args.ligocc.append(0)
|
|
311
|
+
# check substrate
|
|
312
|
+
if not args.substrate:
|
|
313
|
+
print('WARNING: Transition state generation is request without the specification of a substrate. Defaulting to methane.')
|
|
314
|
+
args.substrate = 'methane'
|
|
315
|
+
# check substrate connecting atom
|
|
316
|
+
if args.substrate and not args.subcatoms:
|
|
317
|
+
print(('WARNING: A substrate is specified for TS generation without the specification of a connection point in the substrate. Defaulting to the numbers stored in the dictionary: ' + str(subcatoms)))
|
|
318
|
+
args.subcatoms = subcatoms
|
|
319
|
+
# check mcomplex connecting ligand to the substrate
|
|
320
|
+
if args.substrate and not args.mlig:
|
|
321
|
+
print('WARNING: A substrate is specified for TS generation without the specification of a ligand in the metal complex to connect with. Defaulting to ligand index 0.')
|
|
322
|
+
args.mlig = args.lig[0]
|
|
323
|
+
# check mlig connecting point if the ligand has more than one atom
|
|
324
|
+
if args.mlig and not args.mligcatoms:
|
|
325
|
+
sub, subcatoms, emsg = substr_load(args.mlig[0], 0, subcatoms)
|
|
326
|
+
if sub.natoms == 1:
|
|
327
|
+
args.mligcatoms = [0]
|
|
328
|
+
else:
|
|
329
|
+
print('WARNING: A ligand in the metal complex is specified to connect with the substrate for TS generation without the specification of a connection point in the ligand. Defaulting to atom index 0.')
|
|
330
|
+
args.mligcatoms = [0]
|
|
331
|
+
elif calctype == "dbadd":
|
|
332
|
+
if args.ligadd:
|
|
333
|
+
print('ligand addition function')
|
|
334
|
+
if not args.ligname:
|
|
335
|
+
args.ligname = os.path.splitext(
|
|
336
|
+
os.path.basename(args.ligadd))[0]
|
|
337
|
+
if not args.ligcon:
|
|
338
|
+
args.ligcon = [0]
|
|
339
|
+
if not args.ligffopt:
|
|
340
|
+
args.ligffopt = "BA"
|
|
341
|
+
|
|
342
|
+
return(emsg)
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
# Check true or false
|
|
346
|
+
# @param arg String to be checked
|
|
347
|
+
# @return bool
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
def checkTrue(arg):
|
|
351
|
+
|
|
352
|
+
if 'auto' in arg.lower():
|
|
353
|
+
return 'auto'
|
|
354
|
+
elif 'y' in arg.lower() or '1' in arg.lower() or 't' in arg.lower() or arg == 1:
|
|
355
|
+
return True
|
|
356
|
+
else:
|
|
357
|
+
return False
|
|
358
|
+
|
|
359
|
+
# Check if variable is a number
|
|
360
|
+
# @param s variable to be checked
|
|
361
|
+
# @return bool
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
def is_number(s):
|
|
365
|
+
try:
|
|
366
|
+
float(s)
|
|
367
|
+
return True
|
|
368
|
+
except ValueError:
|
|
369
|
+
pass
|
|
370
|
+
try:
|
|
371
|
+
import unicodedata
|
|
372
|
+
unicodedata.numeric(s)
|
|
373
|
+
return True
|
|
374
|
+
except (TypeError, ValueError):
|
|
375
|
+
pass
|
|
376
|
+
return False
|
|
377
|
+
|
|
378
|
+
# Consolidate arguments into lists
|
|
379
|
+
# @param args Namespace of arguments
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
def cleaninput(args):
|
|
383
|
+
# check ligands
|
|
384
|
+
if args.lig:
|
|
385
|
+
ls = []
|
|
386
|
+
ligdic = getslicores()
|
|
387
|
+
for i, s in enumerate(args.lig):
|
|
388
|
+
if isinstance(s, list):
|
|
389
|
+
for ss in s:
|
|
390
|
+
if ss in list(ligdic.keys()):
|
|
391
|
+
ss = ligdic[ss][0]
|
|
392
|
+
ls.append(ss)
|
|
393
|
+
else:
|
|
394
|
+
if s in list(ligdic.keys()):
|
|
395
|
+
s = ligdic[s][0]
|
|
396
|
+
ls.append(s)
|
|
397
|
+
args.lig = ls
|
|
398
|
+
# check sminame
|
|
399
|
+
if args.sminame:
|
|
400
|
+
ls = []
|
|
401
|
+
for i, s in enumerate(args.sminame):
|
|
402
|
+
if isinstance(s, list):
|
|
403
|
+
for ss in s:
|
|
404
|
+
ls.append(ss)
|
|
405
|
+
else:
|
|
406
|
+
ls.append(s)
|
|
407
|
+
args.sminame = ls
|
|
408
|
+
# check qoption
|
|
409
|
+
if args.qoption:
|
|
410
|
+
ls = []
|
|
411
|
+
for i, s in enumerate(args.qoption):
|
|
412
|
+
if isinstance(s, list):
|
|
413
|
+
for ss in s:
|
|
414
|
+
ls.append(ss)
|
|
415
|
+
else:
|
|
416
|
+
ls.append(s)
|
|
417
|
+
args.qoption = ls
|
|
418
|
+
# check sysoption
|
|
419
|
+
if args.sysoption:
|
|
420
|
+
ls = []
|
|
421
|
+
for i, s in enumerate(args.sysoption):
|
|
422
|
+
if isinstance(s, list):
|
|
423
|
+
for ss in s:
|
|
424
|
+
ls.append(ss)
|
|
425
|
+
else:
|
|
426
|
+
ls.append(s)
|
|
427
|
+
args.sysoption = ls
|
|
428
|
+
# check ctrloption
|
|
429
|
+
if args.ctrloption:
|
|
430
|
+
ls = []
|
|
431
|
+
for i, s in enumerate(args.ctrloption):
|
|
432
|
+
if isinstance(s, list):
|
|
433
|
+
for ss in s:
|
|
434
|
+
ls.append(ss)
|
|
435
|
+
else:
|
|
436
|
+
ls.append(s)
|
|
437
|
+
args.ctrloption = ls
|
|
438
|
+
# check scfoption
|
|
439
|
+
if args.scfoption:
|
|
440
|
+
ls = []
|
|
441
|
+
for i, s in enumerate(args.scfoption):
|
|
442
|
+
if isinstance(s, list):
|
|
443
|
+
for ss in s:
|
|
444
|
+
ls.append(ss)
|
|
445
|
+
else:
|
|
446
|
+
ls.append(s)
|
|
447
|
+
args.scfoption = ls
|
|
448
|
+
# check statoption
|
|
449
|
+
if args.statoption:
|
|
450
|
+
ls = []
|
|
451
|
+
for i, s in enumerate(args.statoption):
|
|
452
|
+
if isinstance(s, list):
|
|
453
|
+
for ss in s:
|
|
454
|
+
ls.append(ss)
|
|
455
|
+
else:
|
|
456
|
+
ls.append(s)
|
|
457
|
+
args.statoption = ls
|
|
458
|
+
# check remoption
|
|
459
|
+
if args.remoption:
|
|
460
|
+
ls = []
|
|
461
|
+
for i, s in enumerate(args.remoption):
|
|
462
|
+
if isinstance(s, list):
|
|
463
|
+
for ss in s:
|
|
464
|
+
ls.append(ss)
|
|
465
|
+
else:
|
|
466
|
+
ls.append(s)
|
|
467
|
+
args.remoption = ls
|
|
468
|
+
# convert keepHs to boolean and fill in missing values with default
|
|
469
|
+
keepHs_default = 'auto'
|
|
470
|
+
if not args.keepHs:
|
|
471
|
+
args.keepHs = [keepHs_default]
|
|
472
|
+
if args.keepHs and args.lig:
|
|
473
|
+
while len(args.keepHs) < len(args.lig): # user should specify as many booleans for keepHs as there are kinds of ligands if she wants to avoid default assignment
|
|
474
|
+
args.keepHs.append(keepHs_default)
|
|
475
|
+
for i, s in enumerate(args.keepHs):
|
|
476
|
+
if args.keepHs[i].lower() != 'auto':
|
|
477
|
+
args.keepHs[i] = checkTrue(s)
|
|
478
|
+
# parse FF settings:
|
|
479
|
+
# if no FF opt is requested, turn off
|
|
480
|
+
if args.ffoption[0].lower() in ['n', 'no']:
|
|
481
|
+
args.ff = False
|
|
482
|
+
# if FF opt is desired, parse FF choice
|
|
483
|
+
else:
|
|
484
|
+
opts = args.ffoption
|
|
485
|
+
if 'ba' in opts[0].lower():
|
|
486
|
+
args.ffoption = 'ba'
|
|
487
|
+
elif 'no' in opts[0].lower() or 'n' in opts[0].lower():
|
|
488
|
+
args.ffoption = 'no'
|
|
489
|
+
elif 'l' in opts[0].lower():
|
|
490
|
+
args.ffoption = 'l' # ligands.dict control
|
|
491
|
+
else:
|
|
492
|
+
args.ffoption = ''
|
|
493
|
+
for op in opts:
|
|
494
|
+
op = op.strip(' ')
|
|
495
|
+
if op[0].lower() == 'b':
|
|
496
|
+
args.ffoption += 'b'
|
|
497
|
+
if op[0].lower() == 'a':
|
|
498
|
+
args.ffoption += 'a'
|
|
499
|
+
|
|
500
|
+
# Generates input file from command line input
|
|
501
|
+
# @param args Namespace of arguments
|
|
502
|
+
# @return CLIinput.inp (file name)
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
def parseCLI(args):
|
|
506
|
+
cliargs = ' '.join(args)
|
|
507
|
+
cliargs = ' ' + cliargs
|
|
508
|
+
s = [_f for _f in cliargs.split(' -') if _f]
|
|
509
|
+
# fname = args.core[0] + '.inp'
|
|
510
|
+
fname = 'CLIinput.inp'
|
|
511
|
+
with open(fname, 'w') as f:
|
|
512
|
+
f.write('# molSimplify input file generated from CLI input\n')
|
|
513
|
+
for line in s:
|
|
514
|
+
f.write('-'+line+'\n')
|
|
515
|
+
return fname
|
|
516
|
+
|
|
517
|
+
# Parses input file
|
|
518
|
+
# @param args Namespace of arguments
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
def parseinputfile(args, inputfile_str=None):
|
|
522
|
+
# arguments that don't match with inparse name and
|
|
523
|
+
# are not automatically initialized go here:
|
|
524
|
+
args.skipANN = False
|
|
525
|
+
args.oldANN = False
|
|
526
|
+
args.dbvdent = False
|
|
527
|
+
args.dbvconns = False
|
|
528
|
+
args.dbvhyb = False
|
|
529
|
+
args.dbvlinks = False
|
|
530
|
+
args.rprompt = False
|
|
531
|
+
set_rundir = False
|
|
532
|
+
|
|
533
|
+
# (we should remove these where posible)
|
|
534
|
+
# THIS NEEDS CLEANING UP TO MINIMIZE DUPLICATION WITH parsecommandline
|
|
535
|
+
if inputfile_str:
|
|
536
|
+
inputfile_lines = inputfile_str.split('\n')
|
|
537
|
+
else:
|
|
538
|
+
with open(args.i) as f:
|
|
539
|
+
inputfile_lines = f.readlines()
|
|
540
|
+
|
|
541
|
+
for line in inputfile_lines:
|
|
542
|
+
# For arguments that cannot accept smiles as args, split possible comments
|
|
543
|
+
if '-lig' not in line and '-core' not in line and '-bind' not in line and '-dbsmarts' not in line:
|
|
544
|
+
line = line.split('#')[0] # remove comments
|
|
545
|
+
li = line.strip()
|
|
546
|
+
li = li.replace('\n', '')
|
|
547
|
+
line = line.replace('\n', '')
|
|
548
|
+
if not li.startswith("#") and len(li) > 0: # ignore comments/empty lines
|
|
549
|
+
# split arguments on whitespace, commas (this breaks smarts)
|
|
550
|
+
l = [_f for _f in re.split(' |\t|,|&', li) if _f] # noqa: E741
|
|
551
|
+
# parse general arguments
|
|
552
|
+
if (l[0] == '-core' and len(l[1:]) > 0):
|
|
553
|
+
args.core = [ll for ll in l[1:]]
|
|
554
|
+
if (l[0] == '-ccatoms' and len(l[1:]) > 0):
|
|
555
|
+
args.ccatoms = []
|
|
556
|
+
l = line.split('ccatoms', 1)[1] # noqa: E741
|
|
557
|
+
l = l.strip(' ') # noqa: E741
|
|
558
|
+
l = l.split(',') # noqa: E741
|
|
559
|
+
args.ccatoms = [int(ll)-1 for ll in l]
|
|
560
|
+
if (l[0] == '-rundir'):
|
|
561
|
+
set_rundir = True
|
|
562
|
+
args.rundir = line.split("#")[0].strip('\n')
|
|
563
|
+
args.rundir = args.rundir.split('-rundir')[1]
|
|
564
|
+
args.rundir = args.rundir.lstrip(' ')
|
|
565
|
+
args.rundir = args.rundir.rstrip(' ')
|
|
566
|
+
print(('The directory for this calculation is: '+str(args.rundir)))
|
|
567
|
+
|
|
568
|
+
if (args.rundir[-1] == '/'):
|
|
569
|
+
args.rundir = args.rundir[:-1]
|
|
570
|
+
if (l[0] == '-custom_data_dir'):
|
|
571
|
+
args.custom_data_dir = l[1]
|
|
572
|
+
if (l[0] == '-suff'):
|
|
573
|
+
args.suff = l[1].strip('\n')
|
|
574
|
+
if (l[0] == '-name'):
|
|
575
|
+
args.name = l[1]
|
|
576
|
+
if (l[0] == '-skipANN'):
|
|
577
|
+
args.skipANN = True
|
|
578
|
+
if (l[0] == '-oldANN'):
|
|
579
|
+
args.oldANN = True
|
|
580
|
+
if (l[0] == '-jobdir'):
|
|
581
|
+
if (len(l) > 1):
|
|
582
|
+
args.jobdir = l[1]
|
|
583
|
+
else:
|
|
584
|
+
args.jobdirblank = True
|
|
585
|
+
### parse structure generation arguments ###
|
|
586
|
+
if (l[0] == '-bind' and len(l[1:]) > 0):
|
|
587
|
+
l = [_f for _f in re.split(' |,|\t', line) if _f] # noqa: E741
|
|
588
|
+
# discard comments
|
|
589
|
+
for ibind, lbind in enumerate(l):
|
|
590
|
+
if lbind == '#':
|
|
591
|
+
l = l[:ibind] # noqa: E741
|
|
592
|
+
break
|
|
593
|
+
args.bind = l[1]
|
|
594
|
+
if (l[0] == '-nbind' and len(l[1:]) > 0):
|
|
595
|
+
args.bindnum = l[1]
|
|
596
|
+
if (l[0] == '-bcharge' and len(l[1:]) > 0): # parse charge for binding species
|
|
597
|
+
args.bcharge = l[1]
|
|
598
|
+
if (l[0] == '-btheta' and len(l[1:]) > 0):
|
|
599
|
+
args.btheta = l[1]
|
|
600
|
+
if (l[0] == '-bphi' and len(l[1:]) > 0):
|
|
601
|
+
args.bphi = l[1]
|
|
602
|
+
if (l[0] == '-bsep' and len(l[1:]) > 0):
|
|
603
|
+
args.bsep = l[1]
|
|
604
|
+
if (l[0] == '-bref' and len(l[1:]) > 0):
|
|
605
|
+
args.bref = l[1:]
|
|
606
|
+
if (l[0] == '-nambsmi' and len(l[1:]) > 0):
|
|
607
|
+
args.nambsmi = l[1]
|
|
608
|
+
if (l[0] == '-maxd' and len(l[1:]) > 0):
|
|
609
|
+
args.maxd = l[1]
|
|
610
|
+
if (l[0] == '-mind' and len(l[1:]) > 0):
|
|
611
|
+
args.mind = l[1]
|
|
612
|
+
if (l[0] == '-oxstate' and len(l[1:]) > 0):
|
|
613
|
+
args.oxstate = l[1]
|
|
614
|
+
if (l[0] == '-coord' and len(l[1:]) > 0):
|
|
615
|
+
args.coord = l[1]
|
|
616
|
+
if (l[0] == '-geometry' and len(l[1:]) > 0):
|
|
617
|
+
args.geometry = l[1].lower()
|
|
618
|
+
if (l[0] == '-geo' and len(l[1:]) > 0):
|
|
619
|
+
args.geometry = l[1].lower()
|
|
620
|
+
# parse ligands
|
|
621
|
+
if (l[0] == '-lig') and len(l[1:]):
|
|
622
|
+
args.lig = l[1:]
|
|
623
|
+
if (l[0] == '-lignum' and len(l[1:]) > 0):
|
|
624
|
+
args.lignum = l[1]
|
|
625
|
+
if (l[0] == '-liggrp' and len(l[1:]) > 0):
|
|
626
|
+
args.liggrp = l[1]
|
|
627
|
+
if (l[0] == '-ligctg' and len(l[1:]) > 0):
|
|
628
|
+
args.ligctg = l[1]
|
|
629
|
+
if (l[0] == '-ligocc' and len(l[1:]) > 0):
|
|
630
|
+
args.ligocc = l[1:]
|
|
631
|
+
if (l[0] == '-rkHs'):
|
|
632
|
+
args.rkHs = checkTrue(l[1])
|
|
633
|
+
if (l[0] == '-stripHs'):
|
|
634
|
+
args.stripHs = True
|
|
635
|
+
if (l[0] == '-ligloc'):
|
|
636
|
+
args.ligloc = checkTrue(l[1])
|
|
637
|
+
if (l[0] == '-ligalign'):
|
|
638
|
+
args.ligalign = checkTrue(l[1])
|
|
639
|
+
if (l[0] == '-replig'):
|
|
640
|
+
args.replig = checkTrue(l[1])
|
|
641
|
+
if (l[0] == '-genall'):
|
|
642
|
+
args.genall = checkTrue(l[1])
|
|
643
|
+
if (l[0] == '-isomers'):
|
|
644
|
+
args.isomers = checkTrue(l[1])
|
|
645
|
+
if (l[0] == '-antigeoisomer'):
|
|
646
|
+
args.antigeoisomer = checkTrue(l[1])
|
|
647
|
+
if (l[0] == '-reportonly'):
|
|
648
|
+
args.reportonly = checkTrue(l[1])
|
|
649
|
+
if (l[0] == '-stereos'):
|
|
650
|
+
args.stereos = checkTrue(l[1])
|
|
651
|
+
if (l[0] == '-MLbonds' and len(l[1:]) > 0):
|
|
652
|
+
args.MLbonds = l[1:]
|
|
653
|
+
if (l[0] == '-distort' and len(l[1:]) > 0):
|
|
654
|
+
args.distort = l[1]
|
|
655
|
+
if (l[0] == '-rgen' and len(l[1:]) > 0):
|
|
656
|
+
args.rgen = l[1:]
|
|
657
|
+
if (l[0] == '-keepHs' and len(l[1:]) > 0):
|
|
658
|
+
args.keepHs = l[1:]
|
|
659
|
+
if (l[0] == '-ff'):
|
|
660
|
+
args.ff = l[1].lower()
|
|
661
|
+
if (l[0] == '-ffoption' and len(l[1:]) > 0):
|
|
662
|
+
args.ffoption = l[1:]
|
|
663
|
+
# print('setting ffoption ' + str(args.ffoption))
|
|
664
|
+
if (l[0] == '-ff_final_opt' and len(l[1:]) > 0):
|
|
665
|
+
args.ff_final_opt = l[1].lower()
|
|
666
|
+
if (l[0] == '-place' and len(l[1:]) > 0):
|
|
667
|
+
args.place = l[1]
|
|
668
|
+
if (l[0] == '-sminame' and len(l[1:]) > 0):
|
|
669
|
+
if args.sminame:
|
|
670
|
+
args.sminame.append(l[1:])
|
|
671
|
+
else:
|
|
672
|
+
args.sminame = l[1:]
|
|
673
|
+
if '-smicat' in line:
|
|
674
|
+
args.smicat = []
|
|
675
|
+
l = line.split('smicat', 1)[1] # noqa: E741
|
|
676
|
+
l = l.replace(' ', '') # noqa: E741
|
|
677
|
+
l = l.split('],[') # noqa: E741
|
|
678
|
+
for smicats in l:
|
|
679
|
+
smicats = smicats.strip('[]')
|
|
680
|
+
smicats = smicats.split(',')
|
|
681
|
+
lloc = list()
|
|
682
|
+
for ll in smicats:
|
|
683
|
+
try:
|
|
684
|
+
if ll.lower() != 'pi':
|
|
685
|
+
lloc.append(int(ll)-1)
|
|
686
|
+
else:
|
|
687
|
+
lloc.append(ll.lower())
|
|
688
|
+
except ValueError:
|
|
689
|
+
print(('ERROR: smicat processing failed at ' + str(ll)))
|
|
690
|
+
print(
|
|
691
|
+
'Please use integers or "pi" and divide by smiles ligand using [],[]')
|
|
692
|
+
args.smicat.append(lloc)
|
|
693
|
+
|
|
694
|
+
print(('final smicat set to ' + str(args.smicat)))
|
|
695
|
+
if (l[0] == '-nconfs' and len(l[1:]) > 0):
|
|
696
|
+
args.nconfs = l[1]
|
|
697
|
+
# if (l[0]=='-maxconfs' and len(l[1:]) > 0):
|
|
698
|
+
# args.maxconfs = l[1]
|
|
699
|
+
if (l[0] == '-scoreconfs'):
|
|
700
|
+
args.scoreconfs = True
|
|
701
|
+
if '-pangles' in line:
|
|
702
|
+
args.pangles = []
|
|
703
|
+
l = [_f for _f in line.split('pangles', 1)[1] if _f] # noqa: E741
|
|
704
|
+
l = l.replace(' ', '') # noqa: E741
|
|
705
|
+
l = re.split(',|\t|&|\n', l) # noqa: E741
|
|
706
|
+
for ll in l:
|
|
707
|
+
args.pangles.append(
|
|
708
|
+
ll) if ll != '' else args.pangles.append(False)
|
|
709
|
+
if (l[0] == '-decoration' and len(l[1:]) > 0):
|
|
710
|
+
list_to_parse = (line.strip().split(' ')[1:])
|
|
711
|
+
list_to_add = list()
|
|
712
|
+
local_list = list()
|
|
713
|
+
if not isinstance(list_to_parse, str):
|
|
714
|
+
for decor in list_to_parse:
|
|
715
|
+
decor = str(decor).strip().strip('[]').split(',')
|
|
716
|
+
local_list = local_list + [str(i) for i in decor]
|
|
717
|
+
list_to_add.append([str(i) for i in decor])
|
|
718
|
+
else:
|
|
719
|
+
list_to_add = [list_to_parse]
|
|
720
|
+
args.decoration = list_to_add
|
|
721
|
+
if (l[0] == '-decoration_index' and len(l[1:]) > 0):
|
|
722
|
+
list_to_parse = (line.strip().split(' ')[1:])
|
|
723
|
+
list_to_add = list()
|
|
724
|
+
local_list = list()
|
|
725
|
+
if not isinstance(list_to_parse, str):
|
|
726
|
+
for decor in list_to_parse:
|
|
727
|
+
# print('correcting string')
|
|
728
|
+
decor = str(decor).strip().strip('[]').split(',')
|
|
729
|
+
# print(decor)
|
|
730
|
+
local_list = local_list + [str(i) for i in decor]
|
|
731
|
+
# print(local_list)
|
|
732
|
+
# correct for 0 index
|
|
733
|
+
list_to_add.append(
|
|
734
|
+
[int(i.strip('[]'))-1 for i in decor])
|
|
735
|
+
else:
|
|
736
|
+
# correct for 0 index
|
|
737
|
+
list_to_add = [int(list_to_parse.strip('[]'))-1]
|
|
738
|
+
args.decoration_index = list_to_add
|
|
739
|
+
print((args.decoration_index))
|
|
740
|
+
# parse qc arguments
|
|
741
|
+
if (l[0] == '-qccode' and len(l[1:]) > 0):
|
|
742
|
+
args.qccode = l[1]
|
|
743
|
+
if (l[0] == '-calccharge'):
|
|
744
|
+
args.calccharge = checkTrue(l[1])
|
|
745
|
+
if (l[0] == '-charge' and len(l[1:]) > 0):
|
|
746
|
+
args.charge = l[1:]
|
|
747
|
+
if (l[0] == '-spin' and len(l[1:]) > 0):
|
|
748
|
+
args.spin = l[1:]
|
|
749
|
+
if (l[0] == '-spinmultiplicity' and len(l[1:]) > 0):
|
|
750
|
+
args.spin = l[1:]
|
|
751
|
+
if (l[0] == '-multiplicity' and len(l[1:]) > 0):
|
|
752
|
+
args.spin = l[1:]
|
|
753
|
+
if (l[0] == '-runtyp' and len(l[1:]) > 0):
|
|
754
|
+
args.runtyp = l[1]
|
|
755
|
+
if (l[0] == '-method' and len(l[1:]) > 0):
|
|
756
|
+
args.method = l[1:]
|
|
757
|
+
# parse terachem arguments
|
|
758
|
+
if (l[0] == '-basis'):
|
|
759
|
+
args.basis = l[1]
|
|
760
|
+
if (l[0] == '-dispersion'):
|
|
761
|
+
args.dispersion = l[1].strip('\n').lower()
|
|
762
|
+
if (l[0] == '-qoption'):
|
|
763
|
+
if args.qoption:
|
|
764
|
+
args.qoption.append(l[1:])
|
|
765
|
+
else:
|
|
766
|
+
args.qoption = l[1:]
|
|
767
|
+
# parse qchem arguments
|
|
768
|
+
if (l[0] == '-exchange'):
|
|
769
|
+
args.exchange = l[1]
|
|
770
|
+
if (l[0] == '-correlation'):
|
|
771
|
+
args.correlation = l[1]
|
|
772
|
+
if (l[0] == '-unrestricted'):
|
|
773
|
+
args.unrestricted = checkTrue(l[1])
|
|
774
|
+
if (l[0] == '-remoption'):
|
|
775
|
+
if args.remoption:
|
|
776
|
+
args.remoption.append(l[1:])
|
|
777
|
+
else:
|
|
778
|
+
args.remoption = l[1:]
|
|
779
|
+
# parse gamess arguments
|
|
780
|
+
if (l[0] == '-gbasis'):
|
|
781
|
+
args.gbasis = l[1]
|
|
782
|
+
if (l[0] == '-ngauss'):
|
|
783
|
+
args.ngauss = l[1]
|
|
784
|
+
if (l[0] == '-npfunc'):
|
|
785
|
+
args.npfunc = l[1]
|
|
786
|
+
if (l[0] == '-ndfunc'):
|
|
787
|
+
args.ndfunc = l[1]
|
|
788
|
+
if (l[0] == '-sysoption'):
|
|
789
|
+
if args.sysoption:
|
|
790
|
+
args.sysoption.append(l[1:])
|
|
791
|
+
else:
|
|
792
|
+
args.sysoption = l[1:]
|
|
793
|
+
if (l[0] == '-ctrloption'):
|
|
794
|
+
if args.ctrloption:
|
|
795
|
+
args.ctrloption.append(l[1:])
|
|
796
|
+
else:
|
|
797
|
+
args.ctrloption = l[1:]
|
|
798
|
+
if (l[0] == '-scfoption'):
|
|
799
|
+
if args.scfoption:
|
|
800
|
+
args.scfoption.append(l[1:])
|
|
801
|
+
else:
|
|
802
|
+
args.scfoption = l[1:]
|
|
803
|
+
if (l[0] == '-statoption'):
|
|
804
|
+
if args.statoption:
|
|
805
|
+
args.statoption.append(l[1:])
|
|
806
|
+
else:
|
|
807
|
+
args.statoption = l[1:]
|
|
808
|
+
# parse MOLPAC generation routines
|
|
809
|
+
if (l[0] == '-mopac'):
|
|
810
|
+
args.mopac = True
|
|
811
|
+
|
|
812
|
+
# parse jobscript arguments
|
|
813
|
+
if (l[0] == '-jsched'):
|
|
814
|
+
args.jsched = l[1]
|
|
815
|
+
if (l[0] == '-jname'):
|
|
816
|
+
args.jname = l[1]
|
|
817
|
+
if (l[0] == '-memory'):
|
|
818
|
+
args.memory = l[1]
|
|
819
|
+
if (l[0] == '-wtime'):
|
|
820
|
+
args.wtime = l[1]
|
|
821
|
+
if (l[0] == '-queue'):
|
|
822
|
+
args.queue = l[1]
|
|
823
|
+
if (l[0] == '-gpus'):
|
|
824
|
+
args.gpus = l[1]
|
|
825
|
+
if (l[0] == '-cpus'):
|
|
826
|
+
args.cpus = l[1]
|
|
827
|
+
if (l[0] == '-modules'):
|
|
828
|
+
args.modules = l[1:]
|
|
829
|
+
if (l[0] == '-joption'):
|
|
830
|
+
if not args.joption:
|
|
831
|
+
args.joption = []
|
|
832
|
+
opts = ''
|
|
833
|
+
for ll in l[1:]:
|
|
834
|
+
opts += ll+' '
|
|
835
|
+
args.joption.append(opts)
|
|
836
|
+
if (l[0] == '-jcommand'):
|
|
837
|
+
if not args.jcommand:
|
|
838
|
+
args.jcommand = []
|
|
839
|
+
opts = ''
|
|
840
|
+
for ll in l[1:]:
|
|
841
|
+
opts += ll+' '
|
|
842
|
+
args.jcommand.append(opts)
|
|
843
|
+
# parse database arguments
|
|
844
|
+
if (l[0] == '-dbsim'):
|
|
845
|
+
args.dbsearch = True
|
|
846
|
+
args.dbsim = l[1]
|
|
847
|
+
if (l[0] == '-dbsearch'):
|
|
848
|
+
args.dbsearch = True
|
|
849
|
+
if (l[0] == '-dbresults'):
|
|
850
|
+
args.dbresults = l[1]
|
|
851
|
+
if (l[0] == '-dbdissim'):
|
|
852
|
+
args.dbsearch = True
|
|
853
|
+
args.dbdissim = l[1]
|
|
854
|
+
if (l[0] == '-dboutputf'):
|
|
855
|
+
args.dboutputf = l[1]
|
|
856
|
+
if (l[0] == '-dbbase'):
|
|
857
|
+
args.dbbase = l[1]
|
|
858
|
+
if (l[0] == '-dbsmarts'):
|
|
859
|
+
# Needs to not have been split on commas
|
|
860
|
+
args.dbsearch = True
|
|
861
|
+
args.dbsmarts = li.split()[1]
|
|
862
|
+
if (l[0] == '-dbcatoms'):
|
|
863
|
+
args.dbcatoms = l[1:]
|
|
864
|
+
if (l[0] == '-dbfinger'):
|
|
865
|
+
args.dbfinger = l[1]
|
|
866
|
+
if (l[0] == '-dbatoms'):
|
|
867
|
+
args.dbatoms = l[1]
|
|
868
|
+
if (l[0] == '-dbbonds'):
|
|
869
|
+
args.dbbonds = l[1]
|
|
870
|
+
if (l[0] == '-dbarbonds'):
|
|
871
|
+
args.dbarbonds = l[1]
|
|
872
|
+
if (l[0] == '-dbsbonds'):
|
|
873
|
+
args.dbsbonds = l[1]
|
|
874
|
+
if (l[0] == '-dbmw'):
|
|
875
|
+
args.dbmw = l[1]
|
|
876
|
+
if (l[0] == '-dbnsearch'):
|
|
877
|
+
args.dbnsearch = l[1]
|
|
878
|
+
if (l[0] == '-drawmode'):
|
|
879
|
+
args.drawmode = True
|
|
880
|
+
else:
|
|
881
|
+
args.drawmode = False
|
|
882
|
+
if (l[0] == '-dballowedels'):
|
|
883
|
+
args.dballowedels = l[1:]
|
|
884
|
+
if (l[0] == '-dbfname'):
|
|
885
|
+
args.dbfname = l[1]
|
|
886
|
+
if (l[0] == '-dbmaxsmartsmatches'):
|
|
887
|
+
args.dbmaxsmartsmatches = l[1]
|
|
888
|
+
if (l[0] == '-dbhuman'):
|
|
889
|
+
args.dbsearch = True
|
|
890
|
+
args.dbhuman = True
|
|
891
|
+
if (l[0] == '-dbvdent'):
|
|
892
|
+
args.dbvdent = l[1]
|
|
893
|
+
if (l[0] == '-dbvconns'):
|
|
894
|
+
ll = [x for x in l[1:]]
|
|
895
|
+
# ll = filter(None,re.split(' |,|\t',l[1]))
|
|
896
|
+
args.dbvconns = ll
|
|
897
|
+
if (l[0] == '-dbvhyb'):
|
|
898
|
+
ll = [x for x in l[1:]]
|
|
899
|
+
# ll = filter(None,re.split(' |,|\t',l[1]))
|
|
900
|
+
args.dbvhyb = ll
|
|
901
|
+
if (l[0] == '-dbvlinks'):
|
|
902
|
+
args.dbvlinks = l[1]
|
|
903
|
+
if (l[0] == '-dbfs'):
|
|
904
|
+
args.dbfs = True
|
|
905
|
+
if (l[0] == '-ligadd'):
|
|
906
|
+
print('adding a ligand')
|
|
907
|
+
args.ligadd = l[1]
|
|
908
|
+
if (l[0] == '-ligname'):
|
|
909
|
+
args.ligname = l[1]
|
|
910
|
+
if (l[0] == '-ligcon'):
|
|
911
|
+
list_to_parse = (line.strip().split(' ')[1:])
|
|
912
|
+
list_to_add = list()
|
|
913
|
+
local_list = list()
|
|
914
|
+
if not isinstance(list_to_parse, str):
|
|
915
|
+
for decor in list_to_parse:
|
|
916
|
+
print('correcting string')
|
|
917
|
+
decor = str(decor).strip().strip('[]').split(',')
|
|
918
|
+
# print(decor)
|
|
919
|
+
local_list = local_list + [str(i) for i in decor]
|
|
920
|
+
# print(local_list)
|
|
921
|
+
# correct for 0 index
|
|
922
|
+
list_to_add.append([int(i.strip('[]')) for i in decor])
|
|
923
|
+
|
|
924
|
+
else:
|
|
925
|
+
# correct for 0 index
|
|
926
|
+
list_to_add = [int(list_to_parse.strip('[]'))-1]
|
|
927
|
+
args.decoration_index = list_to_add
|
|
928
|
+
args.ligcon = list_to_add[0]
|
|
929
|
+
if (l[0] == '-ligffopt'):
|
|
930
|
+
args.ffopt = l[1]
|
|
931
|
+
# parse postprocessing arguments
|
|
932
|
+
if (l[0] == '-postp'):
|
|
933
|
+
args.postp = True
|
|
934
|
+
if (l[0] == '-postqc'):
|
|
935
|
+
args.postqc = l[1]
|
|
936
|
+
if (l[0] == '-postdir'):
|
|
937
|
+
args.postdir = line.split("#")[0].strip('\n')
|
|
938
|
+
args.postdir = args.postdir.split('-postdir')[1]
|
|
939
|
+
args.postdir = args.postdir.lstrip(' ')
|
|
940
|
+
if (l[0] == '-pres'):
|
|
941
|
+
args.pres = True
|
|
942
|
+
if (l[0] == '-pwfninfo'):
|
|
943
|
+
args.pwfninfo = True
|
|
944
|
+
if (l[0] == '-pcharge'):
|
|
945
|
+
args.pcharge = True
|
|
946
|
+
if (l[0] == '-pgencubes'):
|
|
947
|
+
args.pgencubes = True
|
|
948
|
+
if (l[0] == '-porbinfo'):
|
|
949
|
+
args.porbinfo = True
|
|
950
|
+
if (l[0] == '-pdeloc'):
|
|
951
|
+
args.pdeloc = True
|
|
952
|
+
# if (l[0]=='-pdorbs'):
|
|
953
|
+
# args.pdorbs = True
|
|
954
|
+
if (l[0] == '-pnbo'):
|
|
955
|
+
args.pnbo = True
|
|
956
|
+
# parse slab building arguments
|
|
957
|
+
if (l[0] == '-slab_gen'): # 0
|
|
958
|
+
print('slab gen')
|
|
959
|
+
args.slab_gen = True
|
|
960
|
+
if (l[0] == '-unit_cell'): # 1
|
|
961
|
+
args.unit_cell = l[1]
|
|
962
|
+
if (l[0] == '-cell_vector'): # 2
|
|
963
|
+
temp = [float(i.strip('(){}<>[],.'))
|
|
964
|
+
for i in l[1:]] # list-of-lists
|
|
965
|
+
|
|
966
|
+
args.cell_vector = [[temp[i] for i in [0, 1, 2]], [
|
|
967
|
+
temp[i] for i in [3, 4, 5]], [temp[i] for i in [6, 7, 8]]]
|
|
968
|
+
|
|
969
|
+
if (l[0] == '-cif_path'): # 3
|
|
970
|
+
args.cif_path = l[1]
|
|
971
|
+
if (l[0] == '-duplication_vector'): # 4
|
|
972
|
+
args.duplication_vector = [
|
|
973
|
+
int(i.strip('(){}<>[],.')) for i in l[1:]]
|
|
974
|
+
if (l[0] == '-slab_size'): # 5
|
|
975
|
+
args.slab_size = [float(i.strip('(){}<>[],.')) for i in l[1:]]
|
|
976
|
+
if (l[0] == '-miller_index'): # 6
|
|
977
|
+
args.miller_index = [int(i.strip('(){}<>[],.')) for i in l[1:]]
|
|
978
|
+
if (l[0] == '-freeze'): # 7
|
|
979
|
+
try:
|
|
980
|
+
args.freeze = int(l[1].strip('(){}<>[],.'))
|
|
981
|
+
except ValueError:
|
|
982
|
+
args.freeze = True
|
|
983
|
+
if (l[0] == '-debug'): # 8
|
|
984
|
+
args.debug = True
|
|
985
|
+
if (l[0] == '-expose_type'): # 9
|
|
986
|
+
args.expose_type = l[1]
|
|
987
|
+
if (l[0] == '-shave_extra_layers'): # 9
|
|
988
|
+
args.shave_extra_layers = int(l[1])
|
|
989
|
+
# TS generation routine
|
|
990
|
+
if (l[0] == '-tsgen'):
|
|
991
|
+
args.tsgen = True
|
|
992
|
+
if (l[0] == '-substrate'):
|
|
993
|
+
args.substrate = l[1:]
|
|
994
|
+
if (l[0] == '-subcatoms'):
|
|
995
|
+
args.subcatoms = l[1:]
|
|
996
|
+
if (l[0] == '-mlig'):
|
|
997
|
+
args.mlig = l[1:]
|
|
998
|
+
if (l[0] == '-mligcatoms'):
|
|
999
|
+
args.mligcatoms = l[1:]
|
|
1000
|
+
# cdxml import routine
|
|
1001
|
+
if (l[0] == '-cdxml'):
|
|
1002
|
+
args.cdxml = l[1:]
|
|
1003
|
+
# conformers
|
|
1004
|
+
if (l[0] == '-conformer'):
|
|
1005
|
+
args.conformer = True
|
|
1006
|
+
# parse place on slab options
|
|
1007
|
+
if (l[0] == '-place_on_slab'): # 0
|
|
1008
|
+
args.place_on_slab = True
|
|
1009
|
+
if (l[0] == '-target_molecule'): # 1
|
|
1010
|
+
args.target_molecule = l[1]
|
|
1011
|
+
if (l[0] == '-align_distance_method'): # 2
|
|
1012
|
+
args.align_distance_method = l[1]
|
|
1013
|
+
if (l[0] == '-align_dist'): # 3
|
|
1014
|
+
args.align_dist = float(l[1].strip('(){}<>[],.'))
|
|
1015
|
+
if (l[0] == '-align_method'): # 4
|
|
1016
|
+
args.align_method = l[1]
|
|
1017
|
+
if (l[0] == '-object_align'): # 5
|
|
1018
|
+
globs = globalvars()
|
|
1019
|
+
elements = globs.elementsbynum()
|
|
1020
|
+
if l[1] in elements:
|
|
1021
|
+
args.object_align = l[1]
|
|
1022
|
+
else:
|
|
1023
|
+
args.object_align = [
|
|
1024
|
+
int(i.strip('(){}<>[],.')) for i in l[1:]]
|
|
1025
|
+
if (l[0] == '-surface_atom_type'): # 6
|
|
1026
|
+
args.surface_atom_type = l[1]
|
|
1027
|
+
if (l[0] == '-num_surface_atoms'): # 7
|
|
1028
|
+
args.num_surface_atoms = int(l[1].strip('()[]<>.'))
|
|
1029
|
+
if (l[0] == '-num_placements'): # 8
|
|
1030
|
+
args.num_placements = int(l[1].strip('()[]<>.'))
|
|
1031
|
+
if (l[0] == '-coverage'): # 9
|
|
1032
|
+
args.coverage = float(l[1].strip('()[]<>.'))
|
|
1033
|
+
if (l[0] == '-multi_placement_centering'): # 10
|
|
1034
|
+
args.multi_placement_centering = float(l[1].strip('()[]<>.'))
|
|
1035
|
+
if (l[0] == '-control_angle'): # 11
|
|
1036
|
+
args.control_angle = float(l[1].strip('()[]<>.'))
|
|
1037
|
+
if (l[0] == '-angle_control_partner'): # 12
|
|
1038
|
+
args.angle_control_partner = int(l[1].strip('()[]<>.'))
|
|
1039
|
+
if (l[0] == '-angle_surface_axis'): # 13
|
|
1040
|
+
args.angle_surface_axis = [
|
|
1041
|
+
float(i.strip('(){}<>[],.')) for i in l[1:]]
|
|
1042
|
+
if (l[0] == '-duplicate'): # 14
|
|
1043
|
+
args.duplicate = l[1]
|
|
1044
|
+
if (l[0] == '-surface_atom_ind'): # 6
|
|
1045
|
+
args.surface_atom_ind = [
|
|
1046
|
+
int(i.strip('(){}<>[],.')) for i in l[1:]]
|
|
1047
|
+
# control GUI prompt
|
|
1048
|
+
if (l[0] == '-rprompt'):
|
|
1049
|
+
args.rprompt = True
|
|
1050
|
+
# parse chain-builder arguments
|
|
1051
|
+
if (l[0] == '-chain'):
|
|
1052
|
+
print('chain true')
|
|
1053
|
+
args.chain = l[1]
|
|
1054
|
+
if (l[0] == '-chain_units'):
|
|
1055
|
+
args.chain_units = l[1]
|
|
1056
|
+
if (l[0] == '-chain_head'):
|
|
1057
|
+
args.chain_head = l[1]
|
|
1058
|
+
# parse analysis arguments
|
|
1059
|
+
if (l[0] == '-correlate'):
|
|
1060
|
+
args.correlate = l[1]
|
|
1061
|
+
if (l[0] == '-lig_only'):
|
|
1062
|
+
args.lig_only = True
|
|
1063
|
+
if (l[0] == '-simple'):
|
|
1064
|
+
args.simple = True
|
|
1065
|
+
if (l[0] == '-max_descriptors'):
|
|
1066
|
+
args.max_descriptors = [str(i) for i in l[1:]]
|
|
1067
|
+
if not set_rundir:
|
|
1068
|
+
args.rundir = os.path.join(os.path.abspath('.'), 'Runs')
|
|
1069
|
+
# Parses command line arguments and prints help information
|
|
1070
|
+
# @param parser Parser object
|
|
1071
|
+
# @return Namespace of arguments
|
|
1072
|
+
|
|
1073
|
+
|
|
1074
|
+
def parseall(parser):
|
|
1075
|
+
parser.add_argument("-i", help="input file")
|
|
1076
|
+
# hidden (non-user) arguments for GUI
|
|
1077
|
+
parser.add_argument("-rprompt", help=argparse.SUPPRESS,
|
|
1078
|
+
action="store_true")
|
|
1079
|
+
parser.add_argument("-gui", help=argparse.SUPPRESS,
|
|
1080
|
+
action="store_true") # gui placeholder
|
|
1081
|
+
parser.add_argument(
|
|
1082
|
+
"-checkdirb", help="CLI only: automatically ignore warning to replace existing folder", action="store_true")
|
|
1083
|
+
# directory removal check flag (what does this actually do?)
|
|
1084
|
+
parser.add_argument("-checkdirt", action="store_true")
|
|
1085
|
+
args = parser.parse_args()
|
|
1086
|
+
parseinputs_basic(parser, args)
|
|
1087
|
+
parseinputs_advanced(parser, args)
|
|
1088
|
+
parseinputs_slabgen(parser, args)
|
|
1089
|
+
parseinputs_autocorr(parser, args)
|
|
1090
|
+
parseinputs_chainb(parser, args)
|
|
1091
|
+
parseinputs_db(parser, args)
|
|
1092
|
+
parseinputs_inputgen(parser, args)
|
|
1093
|
+
parseinputs_postproc(parser, args)
|
|
1094
|
+
parseinputs_random(parser, args)
|
|
1095
|
+
parseinputs_binding(parser, args)
|
|
1096
|
+
# parseinputs_tsgen(parser,args)
|
|
1097
|
+
parseinputs_tsgen(parser, args)
|
|
1098
|
+
parseinputs_customcore(parser, args)
|
|
1099
|
+
parseinputs_naming(parser, args)
|
|
1100
|
+
return args
|
|
1101
|
+
|
|
1102
|
+
# Parses basic input options and prints help
|
|
1103
|
+
# @param *p Parser pointer
|
|
1104
|
+
|
|
1105
|
+
|
|
1106
|
+
def parseinputs_basic(*p):
|
|
1107
|
+
parser = p[0]
|
|
1108
|
+
parser.add_argument(
|
|
1109
|
+
"-core", help="core structure with currently available: "+getcores())
|
|
1110
|
+
# specified in cleaninput
|
|
1111
|
+
parser.add_argument("-oxstate", help="oxidation state of the metal")
|
|
1112
|
+
parser.add_argument(
|
|
1113
|
+
"-coord", help="coordination such as 4,5,6", action="store_true")
|
|
1114
|
+
parser.add_argument("-geometry", help=f"geometry; currently available ones are {', '.join(getgeoms()[2])} which correspond to {', '.join(getgeoms()[1])}", action="store_true")
|
|
1115
|
+
parser.add_argument("-geo", help=f"geometry; currently available ones are {', '.join(getgeoms()[2])} which correspond to {', '.join(getgeoms()[1])}", action="store_true")
|
|
1116
|
+
parser.add_argument("-lig", help="ligands to be included in complex; ligands.dict options display with command `molsimplify -h liganddict`")
|
|
1117
|
+
parser.add_argument(
|
|
1118
|
+
"-ligocc", help="number of corresponding ligands", action="store_true") # e.g. 1,2,1
|
|
1119
|
+
parser.add_argument("-spin", help="Spin multiplicity (e.g., 1 for singlet)")
|
|
1120
|
+
parser.add_argument("-spinmultiplicity", help="Spin multiplicity (e.g., 1 for singlet)")
|
|
1121
|
+
parser.add_argument("-multiplicity", help="Spin multiplicity (e.g., 1 for singlet)")
|
|
1122
|
+
# specified in cleaninput
|
|
1123
|
+
parser.add_argument(
|
|
1124
|
+
"-keepHs", help="force keep hydrogens, default auto for each ligand")
|
|
1125
|
+
parser.add_argument("-skipANN", help="skip attempting ANN predictions")
|
|
1126
|
+
parser.add_argument(
|
|
1127
|
+
"-rundir", help="directory for jobs, default ~/Runs", action="store_true")
|
|
1128
|
+
parser.add_argument(
|
|
1129
|
+
"-custom_data_dir", help="optional custom data directory to override the path in ~/.molSimplify"
|
|
1130
|
+
)
|
|
1131
|
+
parser.add_argument(
|
|
1132
|
+
"-smicat", help="connecting atoms corresponding to smiles. Indexing starts at 1 which is the default value as well. Use [] for multiple SMILES ligands, e.g. [1],[2]", action="store_true")
|
|
1133
|
+
parser.add_argument(
|
|
1134
|
+
"-ligloc", help="force location of ligands in the structure generation (default False)", default=False)
|
|
1135
|
+
parser.add_argument(
|
|
1136
|
+
"-ff", help="select force field for FF optimization. Available: (default) MMFF94, UFF, GAFF, Ghemical, XTB, GFNFF", default='uff')
|
|
1137
|
+
parser.add_argument(
|
|
1138
|
+
"-ffoption", help="select when to perform FF optimization. Options: B(Before), A(After), BA(Before and after), N(default, no force field), L(ligands.dict controlled)", default='N')
|
|
1139
|
+
parser.add_argument(
|
|
1140
|
+
"-ff_final_opt", help="optionally select different force field for "
|
|
1141
|
+
"final FF optimization after structure generation (defaults to option"
|
|
1142
|
+
" used in -ff). Available: MMFF94, UFF, GAFF, Ghemical, XTB, GFNFF",
|
|
1143
|
+
default=None)
|
|
1144
|
+
if len(p) == 1: # only one input, printing help only
|
|
1145
|
+
args = parser.parse_args()
|
|
1146
|
+
return args
|
|
1147
|
+
elif len(p) == 2: # two inputs, normal parsing
|
|
1148
|
+
args = p[1]
|
|
1149
|
+
parser.parse_args(namespace=args)
|
|
1150
|
+
return 0
|
|
1151
|
+
|
|
1152
|
+
# Parses advanced input options and prints help
|
|
1153
|
+
# @param *p Parser pointer
|
|
1154
|
+
|
|
1155
|
+
|
|
1156
|
+
def parseinputs_advanced(*p):
|
|
1157
|
+
parser = p[0]
|
|
1158
|
+
# advanced structure generation options
|
|
1159
|
+
parser.add_argument(
|
|
1160
|
+
"-nconfs", help="Number of conformers to generate for multidentate smiles ligands. Default 1.", default='1')
|
|
1161
|
+
parser.add_argument(
|
|
1162
|
+
"-scoreconfs", help="Attempt to filter out identical conformers and rank them by rmsd to the desired template, default false", default=False)
|
|
1163
|
+
# parser.add_argument("-maxconfs", help="Stop generation after maxconfs unique conformers or nconfs conformers have been generated, whichever comes first, default infinite", default=10000)
|
|
1164
|
+
parser.add_argument(
|
|
1165
|
+
"-charge", help="Net complex charge. Recommended NOT to specify, by default this is calculated from the metal oxidation state and ligand charges.")
|
|
1166
|
+
parser.add_argument(
|
|
1167
|
+
"-calccharge", help="Automatically calculate net complex charge. By default this is ON.", default=True)
|
|
1168
|
+
parser.add_argument(
|
|
1169
|
+
"-genall", help="Generate complex both with and without FF opt, default False", action="store_true") # geometry
|
|
1170
|
+
parser.add_argument("-decoration_index", help="list of indicies on each ligand to decorate",
|
|
1171
|
+
action="store_true") # decoration indexes, one list per ligand
|
|
1172
|
+
parser.add_argument("-decoration", help="list of SMILES for each decoratation",
|
|
1173
|
+
action="store_true") # decoration, one list ligand
|
|
1174
|
+
parser.add_argument(
|
|
1175
|
+
"-ligalign", help="smart alignment of ligands in the structure generation (default False)", default=False)
|
|
1176
|
+
parser.add_argument(
|
|
1177
|
+
"-MLbonds", help="custom M-L bond length (Ang) for corresponding ligand", action="store_true")
|
|
1178
|
+
parser.add_argument(
|
|
1179
|
+
"-distort", help="randomly distort backbone. Ranges from 0 (no distortion) to 100. e.g. 20", default='0')
|
|
1180
|
+
parser.add_argument(
|
|
1181
|
+
"-langles", help="custom angles (polar theta, azimuthal phi) for corresponding ligand in degrees separated by '/' e.g. 20/30,10/20", action="store_true")
|
|
1182
|
+
parser.add_argument(
|
|
1183
|
+
"-pangles", help="custom angles (polar theta, azimuthal phi) for corresponding connectino points in degrees separated by '/' e.g. 20/30,10/20", action="store_true")
|
|
1184
|
+
parser.add_argument("-oldANN", help=" use old (MCDL-25) ANN predictions")
|
|
1185
|
+
parser.add_argument(
|
|
1186
|
+
"-isomers", help='generates all possible isomers of a complex, support oct, thd, and sqp geometries')
|
|
1187
|
+
parser.add_argument(
|
|
1188
|
+
"-antigeoisomer", help='for tetradentate structures with geometric isomers, allows generation of the anti isomer (as opposed to the syn, used by default)')
|
|
1189
|
+
parser.add_argument(
|
|
1190
|
+
"-stereos", help='works in combination with -isomers. generates a mirror image of each isomer complex')
|
|
1191
|
+
parser.add_argument(
|
|
1192
|
+
"-reportonly", help='add this flag if you just want the report, without actual structure generation. Currently does not support pentadentates.')
|
|
1193
|
+
if len(p) == 1: # only one input, printing help only
|
|
1194
|
+
args = parser.parse_args()
|
|
1195
|
+
return args
|
|
1196
|
+
elif len(p) == 2: # two inputs, normal parsing
|
|
1197
|
+
args = p[1]
|
|
1198
|
+
parser.parse_args(namespace=args)
|
|
1199
|
+
return 0
|
|
1200
|
+
|
|
1201
|
+
# Parses slab builder options and prints help
|
|
1202
|
+
# @param *p Parser pointer
|
|
1203
|
+
|
|
1204
|
+
|
|
1205
|
+
def parseinputs_slabgen(*p):
|
|
1206
|
+
parser = p[0]
|
|
1207
|
+
# slab builder input: controli
|
|
1208
|
+
parser.add_argument(
|
|
1209
|
+
"-slab_gen", help="enables slab generation/periodic extension", action="store_true") # 0
|
|
1210
|
+
# slab builder input: required
|
|
1211
|
+
parser.add_argument(
|
|
1212
|
+
"-unit_cell", help="unit cell: path to xyz or instructions, see manual for details") # 1
|
|
1213
|
+
parser.add_argument(
|
|
1214
|
+
"-cell_vector", help="unit cell lattice vector, list of 3 list of float (Ang)") # 2
|
|
1215
|
+
parser.add_argument("-cif_path", help="path to cif file") # 3
|
|
1216
|
+
parser.add_argument("-duplication_vector",
|
|
1217
|
+
help="lattice vector repeats, list of 3 ints") # 4
|
|
1218
|
+
parser.add_argument(
|
|
1219
|
+
"-slab_size", help="slab size, list of 3 floats (Ang)") # 5
|
|
1220
|
+
# slab builder: optional
|
|
1221
|
+
parser.add_argument(
|
|
1222
|
+
"-miller_index", help="list of 3 int, miller indices") # 6
|
|
1223
|
+
parser.add_argument(
|
|
1224
|
+
"-freeze", help="bool or int, bottom layers of cell to freeze") # 7
|
|
1225
|
+
parser.add_argument(
|
|
1226
|
+
"-expose_type", help="str, symbol of atom type to expose (eg 'O')") # 9
|
|
1227
|
+
parser.add_argument("-shave_extra_layers",
|
|
1228
|
+
help="int, number of extra layers to shave") # 10
|
|
1229
|
+
parser.add_argument(
|
|
1230
|
+
"-debug", help="debug feature to print stepwise slabs", action="store_true") # 10
|
|
1231
|
+
# placement input: control
|
|
1232
|
+
parser.add_argument(
|
|
1233
|
+
"-place_on_slab", help="enables placement on slab", action="store_true") # 0
|
|
1234
|
+
# placemnt input: required
|
|
1235
|
+
parser.add_argument("-target_molecule",
|
|
1236
|
+
help="path to target molecule") # 1
|
|
1237
|
+
parser.add_argument("-align_distance_method", help="align distance method",
|
|
1238
|
+
choices=['chemisorption', 'physisorption', 'custom']) # 2
|
|
1239
|
+
parser.add_argument("-align_dist", help="align distance, float") # 3
|
|
1240
|
+
# placement input: optional
|
|
1241
|
+
parser.add_argument("-align_method", help="align method ",
|
|
1242
|
+
choices=['center', 'staggered', 'alignpair']) # 4
|
|
1243
|
+
parser.add_argument(
|
|
1244
|
+
"-object_align", help="atom symbol or index for alignment partner in placed object") # 5
|
|
1245
|
+
parser.add_argument("-surface_atom_type",
|
|
1246
|
+
help="atom symbol for surface aligment partner") # 6
|
|
1247
|
+
parser.add_argument(
|
|
1248
|
+
"-num_surface_atoms", help="number of surface sites to attach per adsorbate") # 7
|
|
1249
|
+
parser.add_argument("-num_placements",
|
|
1250
|
+
help="number of copies of object to place.") # 8
|
|
1251
|
+
parser.add_argument(
|
|
1252
|
+
"-coverage", help="coverage fraction, float between 0 and 1") # 9
|
|
1253
|
+
parser.add_argument("-multi_placement_centering",
|
|
1254
|
+
help="float between 0 and 1, controls centering of placement. Recommend leaving as default") # 10
|
|
1255
|
+
parser.add_argument(
|
|
1256
|
+
"-control_angle", help="angle in degrees to rotate object axis to surface") # 11
|
|
1257
|
+
parser.add_argument("-angle_control_partner",
|
|
1258
|
+
help='atom index, int. Controls angle between object_align and this atom') # 12
|
|
1259
|
+
parser.add_argument('-angle_surface_axis',
|
|
1260
|
+
help='list of two floats, vector in surface plane to control angle relative to') # 13
|
|
1261
|
+
parser.add_argument(
|
|
1262
|
+
'-duplicate', help="bool, duplicate asorbate above and below slab", action="store_true") # 14
|
|
1263
|
+
parser.add_argument('-surface_atom_ind',
|
|
1264
|
+
help="list of int, surface atoms to use by index") # 15
|
|
1265
|
+
if len(p) == 1: # only one input, printing help only
|
|
1266
|
+
args = parser.parse_args()
|
|
1267
|
+
return args
|
|
1268
|
+
elif len(p) == 2: # two inputs, normal parsing
|
|
1269
|
+
args = p[1]
|
|
1270
|
+
parser.parse_args(namespace=args)
|
|
1271
|
+
return 0
|
|
1272
|
+
|
|
1273
|
+
# Parses automated correlation analysis options and prints help
|
|
1274
|
+
# @param *p Parser pointer
|
|
1275
|
+
|
|
1276
|
+
|
|
1277
|
+
def parseinputs_autocorr(*p):
|
|
1278
|
+
parser = p[0]
|
|
1279
|
+
parser.add_argument(
|
|
1280
|
+
'-correlate',help="path to file for analysis, should contain name,value,folder where name.xyz geo is located on each line") # 0
|
|
1281
|
+
parser.add_argument(
|
|
1282
|
+
'-lig_only', action="store_true",
|
|
1283
|
+
help="set to true to force only whole ligand descriptors (if metal is constant etc)") # 1
|
|
1284
|
+
parser.add_argument(
|
|
1285
|
+
'-simple', help="set to true to force only simple default autocorrelations") # 1
|
|
1286
|
+
parser.add_argument(
|
|
1287
|
+
'-max_descriptors', help="maxium number of descriptors to to use, not reccomended. The algorithm chooses the most representative set and removing some of these can degrade the model") # 0
|
|
1288
|
+
if len(p) == 1: # only one input, printing help only
|
|
1289
|
+
args = parser.parse_args()
|
|
1290
|
+
return args
|
|
1291
|
+
elif len(p) == 2: # two inputs, normal parsing
|
|
1292
|
+
args = p[1]
|
|
1293
|
+
parser.parse_args(namespace=args)
|
|
1294
|
+
return 0
|
|
1295
|
+
|
|
1296
|
+
# Parses chain builder options and prints help
|
|
1297
|
+
# @param *p Parser pointer
|
|
1298
|
+
|
|
1299
|
+
|
|
1300
|
+
def parseinputs_chainb(*p):
|
|
1301
|
+
parser = p[0]
|
|
1302
|
+
parser.add_argument(
|
|
1303
|
+
'-chain', help="SMILES string of monomer", action="store_true") # 0
|
|
1304
|
+
parser.add_argument('-chain_units', help="int, number of monomers") # 0
|
|
1305
|
+
parser.add_argument('-chain_head', help="SMILEs of chain terminator") # 0
|
|
1306
|
+
if len(p) == 1: # only one input, printing help only
|
|
1307
|
+
args = parser.parse_args()
|
|
1308
|
+
return args
|
|
1309
|
+
elif len(p) == 2: # two inputs, normal parsing
|
|
1310
|
+
args = p[1]
|
|
1311
|
+
parser.parse_args(namespace=args)
|
|
1312
|
+
return 0
|
|
1313
|
+
|
|
1314
|
+
# Parses database search options and prints help
|
|
1315
|
+
# @param *p Parser pointer
|
|
1316
|
+
|
|
1317
|
+
|
|
1318
|
+
def parseinputs_db(*p):
|
|
1319
|
+
parser = p[0]
|
|
1320
|
+
parser.add_argument(
|
|
1321
|
+
"-dbsearch", help="flag enabling db search", action="store_true")
|
|
1322
|
+
parser.add_argument(
|
|
1323
|
+
"-dbsim", help="deprecated, please use dbsmarts instead", action="store_true")
|
|
1324
|
+
parser.add_argument(
|
|
1325
|
+
"-dbcatoms", help="connection atoms for similarity search", action="store_true")
|
|
1326
|
+
parser.add_argument(
|
|
1327
|
+
"-dbresults", help="how many results for similary search or screening", action="store_true")
|
|
1328
|
+
parser.add_argument(
|
|
1329
|
+
"-dbfname", help="filename for database search, default is simres.smi", action="store_true")
|
|
1330
|
+
parser.add_argument(
|
|
1331
|
+
"-dbbase", help="database for search", action="store_true")
|
|
1332
|
+
parser.add_argument(
|
|
1333
|
+
"-dbsmarts", help="SMARTS string for substructure search", action="store_true")
|
|
1334
|
+
parser.add_argument(
|
|
1335
|
+
"-dbfinger", help="fingerprint for similarity search", action="store_true")
|
|
1336
|
+
parser.add_argument(
|
|
1337
|
+
"-dbatoms", help="number of atoms to be used in screening", action="store_true")
|
|
1338
|
+
parser.add_argument(
|
|
1339
|
+
"-dbbonds", help="number of bonds to be used in screening", action="store_true")
|
|
1340
|
+
parser.add_argument(
|
|
1341
|
+
"-dbarbonds", help="Number of aromatic bonds to be used in screening", action="store_true")
|
|
1342
|
+
parser.add_argument(
|
|
1343
|
+
"-dbsbonds", help="number of single bonds to be used in screening", action="store_true")
|
|
1344
|
+
parser.add_argument(
|
|
1345
|
+
"-dbmw", help="molecular weight to be used in screening", action="store_true")
|
|
1346
|
+
parser.add_argument(
|
|
1347
|
+
"-dbdissim", help="number of dissimilar results", action="store_true")
|
|
1348
|
+
parser.add_argument(
|
|
1349
|
+
"-dbnsearch", help="number of database entries to be searched, only for fastsearch", action="store_true")
|
|
1350
|
+
parser.add_argument(
|
|
1351
|
+
"-dballowedels", help="elements allowed in search, default all", action="store_true")
|
|
1352
|
+
parser.add_argument("-dbmaxsmartsmatches",
|
|
1353
|
+
help="maximum instances of SMARTS pattern permitted, default unlimited", action="store_true")
|
|
1354
|
+
parser.add_argument(
|
|
1355
|
+
"-dbhuman", help="human-readable alternative to SMARTS/SMILES strings", action="store_true")
|
|
1356
|
+
parser.add_argument(
|
|
1357
|
+
"-dbdent", help="ligand denticity (requires -dbhuman)", action="store_true")
|
|
1358
|
+
parser.add_argument(
|
|
1359
|
+
"-dbconns", help="ligand coordinating elements (requires dbhuman)", action="store_true")
|
|
1360
|
+
parser.add_argument(
|
|
1361
|
+
"-dbhyb", help="hybridization (sp^n) of ligand coordinating elements (requires dbhuman)", action="store_true")
|
|
1362
|
+
parser.add_argument(
|
|
1363
|
+
"-dblinks", help="number of linking atoms (requires dbhuman)", action="store_true")
|
|
1364
|
+
parser.add_argument(
|
|
1365
|
+
"-dbfs", help="use fastsearch database if present", action="store_true")
|
|
1366
|
+
# add to DB commands
|
|
1367
|
+
parser.add_argument(
|
|
1368
|
+
"-ligadd", help=" add file/SMILES string to ligands available database ", action="store_true")
|
|
1369
|
+
parser.add_argument(
|
|
1370
|
+
"-ligname", help="name of ligand to be added", action="store_true")
|
|
1371
|
+
parser.add_argument(
|
|
1372
|
+
"-ligcon", help="list of connecting atoms for ligand to be added", action="store_true")
|
|
1373
|
+
parser.add_argument(
|
|
1374
|
+
"-ligffopt", action="store_true",
|
|
1375
|
+
help="so we ff optimize the ligand before or (B), after (A) placement, never (N) or both (BA)")
|
|
1376
|
+
if len(p) == 1: # only one input, printing help only
|
|
1377
|
+
args = parser.parse_args()
|
|
1378
|
+
return args
|
|
1379
|
+
elif len(p) == 2: # two inputs, normal parsing
|
|
1380
|
+
args = p[1]
|
|
1381
|
+
parser.parse_args(namespace=args)
|
|
1382
|
+
return 0
|
|
1383
|
+
|
|
1384
|
+
# Parses input file generation options and prints help
|
|
1385
|
+
# @param *p Parser pointer
|
|
1386
|
+
|
|
1387
|
+
|
|
1388
|
+
def parseinputs_inputgen(*p):
|
|
1389
|
+
parser = p[0]
|
|
1390
|
+
parser.add_argument(
|
|
1391
|
+
"-qccode", help="Code to use, only terachem (default), GAMESS and qchem are currently supported", default='terachem')
|
|
1392
|
+
parser.add_argument(
|
|
1393
|
+
"-runtyp", help="Run type (energy - default, minimize)", default='energy')
|
|
1394
|
+
parser.add_argument(
|
|
1395
|
+
"-method", help="Terachem method (e.g. b3lyp - default)", default=['b3lyp'])
|
|
1396
|
+
parser.add_argument(
|
|
1397
|
+
"-tc_fix_dihedral", help="Constrain sqp dihedrals (terachem only)?", action="store_true")
|
|
1398
|
+
parser.add_argument(
|
|
1399
|
+
"-mopac", help="Generate MOPAC (semiempirical) files?", action="store_true")
|
|
1400
|
+
parser.add_argument(
|
|
1401
|
+
"-basis", help="basis set for terachem or qchem job (default: LACVP*)", default='lacvps_ecp')
|
|
1402
|
+
parser.add_argument(
|
|
1403
|
+
"-dispersion", help="dispersion forces. Default: no e.g. d2,d3", action="store_true")
|
|
1404
|
+
parser.add_argument(
|
|
1405
|
+
"-qoption", help="extra arguments for TeraChem in syntax keyword value, e.g. maxit 100", action="store_true")
|
|
1406
|
+
parser.add_argument(
|
|
1407
|
+
"-exchange", help="exchange in qchem job (default b3lyp)", action="store_true")
|
|
1408
|
+
parser.add_argument(
|
|
1409
|
+
"-correlation", help="correlation in qchem job (default none)", action="store_true")
|
|
1410
|
+
parser.add_argument(
|
|
1411
|
+
"-remoption", help="extra arguments for qchem $rem block in syntax keyword value, e.g. INCFOCK 0", action="store_true")
|
|
1412
|
+
parser.add_argument(
|
|
1413
|
+
"-unrestricted", help="unrestricted calculation, default true", action="store_true")
|
|
1414
|
+
parser.add_argument(
|
|
1415
|
+
"-gbasis", help="GBASIS option in GAMESS e.g. CCT", action="store_true")
|
|
1416
|
+
parser.add_argument(
|
|
1417
|
+
"-ngauss", help="NGAUSS option in GAMESS e.g. N31", action="store_true")
|
|
1418
|
+
parser.add_argument(
|
|
1419
|
+
"-npfunc", help="NPFUNC option for diffuse functions in GAMESS e.g. 2", action="store_true")
|
|
1420
|
+
parser.add_argument(
|
|
1421
|
+
"-ndfunc", help="NDFUNC option for diffuse functions in GAMESS e.g. 1", action="store_true")
|
|
1422
|
+
parser.add_argument(
|
|
1423
|
+
"-sysoption", action="store_true",
|
|
1424
|
+
help="extra arguments for $SYSTEM GAMESS block in syntax keyword value, e.g. MWORDS 20")
|
|
1425
|
+
parser.add_argument(
|
|
1426
|
+
"-ctrloption", action="store_true",
|
|
1427
|
+
help="extra arguments for $CONTRL GAMESS block in syntax keyword value, e.g. ISPHER 1")
|
|
1428
|
+
parser.add_argument(
|
|
1429
|
+
"-scfoption", action="store_true",
|
|
1430
|
+
help="extra arguments for $SCF GAMESS block in syntax keyword value, e.g. DIIS .TRUE.")
|
|
1431
|
+
parser.add_argument(
|
|
1432
|
+
"-statoption", action="store_true",
|
|
1433
|
+
help="extra arguments for $STATPT GAMESS block in syntax keyword value, e.g. NSTEP 100")
|
|
1434
|
+
parser.add_argument(
|
|
1435
|
+
"-jsched", help="job scheduling system. Choices: SLURM or SGE", default='sge')
|
|
1436
|
+
parser.add_argument(
|
|
1437
|
+
"-jname", help="jobs main identifier", action="store_true")
|
|
1438
|
+
parser.add_argument(
|
|
1439
|
+
"-memory", help="memory reserved per thread for job file in G(default: 2G)e.g.2", action="store_true")
|
|
1440
|
+
parser.add_argument(
|
|
1441
|
+
"-wtime", help="wall time requested in hours for queueing system (default: 168hrs) e.g. 8", action="store_true")
|
|
1442
|
+
parser.add_argument(
|
|
1443
|
+
"-queue", help="queue name e.g gpus", action="store_true")
|
|
1444
|
+
parser.add_argument(
|
|
1445
|
+
"-gpus", help="number of GPUS (default: 1)", action="store_true")
|
|
1446
|
+
parser.add_argument(
|
|
1447
|
+
"-cpus", help="number of CPUs (default: 1)", action="store_true")
|
|
1448
|
+
parser.add_argument(
|
|
1449
|
+
"-modules", help="modules to be loaded for the calculation", action="store_true")
|
|
1450
|
+
parser.add_argument(
|
|
1451
|
+
"-joption", help="additional options for jobscript", action="store_true")
|
|
1452
|
+
parser.add_argument(
|
|
1453
|
+
"-jcommand", help="additional commands for jobscript", action="store_true")
|
|
1454
|
+
parser.add_argument(
|
|
1455
|
+
"-jobdir", help="custom directory name for this job", action="store_true")
|
|
1456
|
+
# does this still do anything?
|
|
1457
|
+
parser.add_argument("-jid", help="job ID", action="store_true")
|
|
1458
|
+
if len(p) == 1: # only one input, printing help only
|
|
1459
|
+
args = parser.parse_args()
|
|
1460
|
+
return args
|
|
1461
|
+
elif len(p) == 2: # two inputs, normal parsing
|
|
1462
|
+
args = p[1]
|
|
1463
|
+
parser.parse_args(namespace=args)
|
|
1464
|
+
return 0
|
|
1465
|
+
|
|
1466
|
+
# Parses postprocessing options and prints help
|
|
1467
|
+
# @param *p Parser pointer
|
|
1468
|
+
|
|
1469
|
+
|
|
1470
|
+
def parseinputs_postproc(*p):
|
|
1471
|
+
parser = p[0]
|
|
1472
|
+
parser.add_argument(
|
|
1473
|
+
"-postp", help="post process results", action="store_true")
|
|
1474
|
+
parser.add_argument(
|
|
1475
|
+
"-postqc", help="quantum chemistry code used. Choices: TeraChem or GAMESS", action="store_true")
|
|
1476
|
+
parser.add_argument(
|
|
1477
|
+
"-postdir", help="directory with results", action="store_true")
|
|
1478
|
+
parser.add_argument(
|
|
1479
|
+
"-pres", help="generate calculations summary", action="store_true")
|
|
1480
|
+
parser.add_argument(
|
|
1481
|
+
"-pdeninfo", help="calculate average properties for electron density", action="store_true")
|
|
1482
|
+
parser.add_argument(
|
|
1483
|
+
"-pcharge", help="calculate charges", action="store_true")
|
|
1484
|
+
parser.add_argument(
|
|
1485
|
+
"-pgencubes", help="generate cubefiles", action="store_true")
|
|
1486
|
+
parser.add_argument(
|
|
1487
|
+
"-pwfninfo", help="get information about wavefunction", action="store_true")
|
|
1488
|
+
parser.add_argument(
|
|
1489
|
+
"-pdeloc", help="get delocalization and localization indices", action="store_true")
|
|
1490
|
+
parser.add_argument(
|
|
1491
|
+
"-porbinfo", help="get information about MO", action="store_true")
|
|
1492
|
+
parser.add_argument(
|
|
1493
|
+
"-pnbo", help="post process nbo analysis", action="store_true")
|
|
1494
|
+
parser.add_argument(
|
|
1495
|
+
"-pdorbs", help="get information on metal d orbitals", action="store_true")
|
|
1496
|
+
if len(p) == 1: # only one input, printing help only
|
|
1497
|
+
args = parser.parse_args()
|
|
1498
|
+
return args
|
|
1499
|
+
elif len(p) == 2: # two inputs, normal parsing
|
|
1500
|
+
args = p[1]
|
|
1501
|
+
parser.parse_args(namespace=args)
|
|
1502
|
+
return 0
|
|
1503
|
+
|
|
1504
|
+
# Parses random generation options and prints help
|
|
1505
|
+
# @param *p Parser pointer
|
|
1506
|
+
|
|
1507
|
+
|
|
1508
|
+
def parseinputs_random(*p):
|
|
1509
|
+
parser = p[0]
|
|
1510
|
+
parser.add_argument("-liggrp", "--liggrp",
|
|
1511
|
+
help="ligand group for random generation ", action="store_true")
|
|
1512
|
+
parser.add_argument("-ligctg", "--ligctg",
|
|
1513
|
+
help="ligand category for random generation", action="store_true")
|
|
1514
|
+
parser.add_argument(
|
|
1515
|
+
"-rkHs", "--rkHs", help="keep Hydrogens for random generation", action="store_true")
|
|
1516
|
+
parser.add_argument(
|
|
1517
|
+
"-rgen", "--rgen", help="number of random generated molecules", action="store_true")
|
|
1518
|
+
parser.add_argument(
|
|
1519
|
+
"-lignum", help="number of ligands for random generation", action="store_true")
|
|
1520
|
+
if len(p) == 1: # only one input, printing help only
|
|
1521
|
+
args = parser.parse_args()
|
|
1522
|
+
return args
|
|
1523
|
+
elif len(p) == 2: # two inputs, normal parsing
|
|
1524
|
+
args = p[1]
|
|
1525
|
+
parser.parse_args(namespace=args)
|
|
1526
|
+
return 0
|
|
1527
|
+
|
|
1528
|
+
# Parses binding species placement options and prints help
|
|
1529
|
+
# @param *p Parser pointer
|
|
1530
|
+
|
|
1531
|
+
|
|
1532
|
+
def parseinputs_binding(*p):
|
|
1533
|
+
parser = p[0]
|
|
1534
|
+
parser.add_argument(
|
|
1535
|
+
"-bind", help="binding species, currently available: "+getbinds(), action="store_true")
|
|
1536
|
+
parser.add_argument("-bindnum", help="number of binding species copies for random placement",
|
|
1537
|
+
action="store_true") # different geometric arrangements for calculating binding energy
|
|
1538
|
+
parser.add_argument(
|
|
1539
|
+
"-nambsmi", help="name of SMILES string for binding species e.g. carbonmonoxide", action="store_true")
|
|
1540
|
+
parser.add_argument(
|
|
1541
|
+
"-maxd", help="maximum distance above cluster size for molecules placement maxdist=size1+size2+maxd",
|
|
1542
|
+
action="store_true")
|
|
1543
|
+
parser.add_argument(
|
|
1544
|
+
"-mind", help="minimum distance above cluster size for molecules placement mindist=size1+size2+mind",
|
|
1545
|
+
action="store_true")
|
|
1546
|
+
parser.add_argument(
|
|
1547
|
+
"-place", help="place binding species relative to core. Takes either angle (0-360) or ax/s for axial side",
|
|
1548
|
+
action="store_true")
|
|
1549
|
+
parser.add_argument(
|
|
1550
|
+
"-bcharge", "--bcharge", default='0', action="store_true",
|
|
1551
|
+
help="binding species charge, default 0")
|
|
1552
|
+
parser.add_argument(
|
|
1553
|
+
"-bphi", "--bphi", action="store_true",
|
|
1554
|
+
help="azimuthal angle phi for binding species, default random between 0 and 180")
|
|
1555
|
+
parser.add_argument(
|
|
1556
|
+
"-bref", "--bref", action="store_true",
|
|
1557
|
+
help="reference atoms for placement of extra molecules, default COM (center of mass). e.g. 1,5 or 1-5, Fe, COM")
|
|
1558
|
+
parser.add_argument(
|
|
1559
|
+
"-bsep", "--bsep", action="store_true",
|
|
1560
|
+
help="flag for separating extra molecule in input or xyz file")
|
|
1561
|
+
parser.add_argument(
|
|
1562
|
+
"-btheta", "--btheta", action="store_true",
|
|
1563
|
+
help="polar angle theta for binding species, default random between 0 and 360")
|
|
1564
|
+
if len(p) == 1: # only one input, printing help only
|
|
1565
|
+
args = parser.parse_args()
|
|
1566
|
+
return args
|
|
1567
|
+
elif len(p) == 2: # two inputs, normal parsing
|
|
1568
|
+
args = p[1]
|
|
1569
|
+
parser.parse_args(namespace=args)
|
|
1570
|
+
return 0
|
|
1571
|
+
|
|
1572
|
+
# Parses transition state building version 2 options and prints help
|
|
1573
|
+
# @param *p Parser pointer
|
|
1574
|
+
|
|
1575
|
+
|
|
1576
|
+
def parseinputs_tsgen(*p):
|
|
1577
|
+
parser = p[0]
|
|
1578
|
+
parser.add_argument("-tsgen", help="flag for enabling TS generation mode",
|
|
1579
|
+
action="store_true", default=False)
|
|
1580
|
+
parser.add_argument("-substrate", help="small molecule substrate")
|
|
1581
|
+
parser.add_argument(
|
|
1582
|
+
"-subcatoms", help="index of the connecting atom in substrate")
|
|
1583
|
+
parser.add_argument(
|
|
1584
|
+
"-mlig", help="ligand name in the metal complex that the substrate connects with")
|
|
1585
|
+
parser.add_argument(
|
|
1586
|
+
"-mligcatoms", help="index of the connecting atom in the specified ligand in the metal complex", action="store_true")
|
|
1587
|
+
parser.add_argument("-cdxml", help="cdxml file name", action="store_true")
|
|
1588
|
+
parser.add_argument(
|
|
1589
|
+
"-conformers", help="flag for requesting metal-substrate TS conformation search", action="store_true")
|
|
1590
|
+
if len(p) == 1: # only one input, printing help only
|
|
1591
|
+
args = parser.parse_args()
|
|
1592
|
+
return args
|
|
1593
|
+
elif len(p) == 2: # two inputs, normal parsing
|
|
1594
|
+
args = p[1]
|
|
1595
|
+
parser.parse_args(namespace=args)
|
|
1596
|
+
return 0
|
|
1597
|
+
|
|
1598
|
+
# Parses ligand replacement options and prints help
|
|
1599
|
+
# @param *p Parser pointer
|
|
1600
|
+
|
|
1601
|
+
|
|
1602
|
+
def parseinputs_customcore(*p):
|
|
1603
|
+
parser = p[0]
|
|
1604
|
+
parser.add_argument(
|
|
1605
|
+
"-replig", help="flag for replacing ligand at specified connection point", action="store_true")
|
|
1606
|
+
parser.add_argument(
|
|
1607
|
+
"-ccatoms", help="core connection atoms indices, indexing starting from 1")
|
|
1608
|
+
if len(p) == 1: # only one input, printing help only
|
|
1609
|
+
args = parser.parse_args()
|
|
1610
|
+
return args
|
|
1611
|
+
elif len(p) == 2: # two inputs, normal parsing
|
|
1612
|
+
args = p[1]
|
|
1613
|
+
parser.parse_args(namespace=args)
|
|
1614
|
+
return 0
|
|
1615
|
+
|
|
1616
|
+
# Parses file naming options and prints help
|
|
1617
|
+
# @param *p Parser pointer
|
|
1618
|
+
|
|
1619
|
+
|
|
1620
|
+
def parseinputs_naming(*p):
|
|
1621
|
+
parser = p[0]
|
|
1622
|
+
parser.add_argument(
|
|
1623
|
+
"-name", help="custom name for complex", action="store_true")
|
|
1624
|
+
parser.add_argument(
|
|
1625
|
+
"-suff", help="additional suffix for jobs folder names", action="store_true")
|
|
1626
|
+
parser.add_argument(
|
|
1627
|
+
"-sminame", help="name for smiles species used in the folder naming. e.g. amm", action="store_true")
|
|
1628
|
+
if len(p) == 1: # only one input, printing help only
|
|
1629
|
+
args = parser.parse_args()
|
|
1630
|
+
return args
|
|
1631
|
+
elif len(p) == 2: # two inputs, normal parsing
|
|
1632
|
+
args = p[1]
|
|
1633
|
+
parser.parse_args(namespace=args)
|
|
1634
|
+
return 0
|
|
1635
|
+
|
|
1636
|
+
|
|
1637
|
+
# Prints ligands in ligands.dict
|
|
1638
|
+
# @param *p Parser pointer
|
|
1639
|
+
|
|
1640
|
+
|
|
1641
|
+
def parseinputs_ligdict(*p):
|
|
1642
|
+
parser = p[0]
|
|
1643
|
+
|
|
1644
|
+
available_ligands = getligs().split(' ')
|
|
1645
|
+
available_ligands.sort() # Sorting the ligands in alphabetical order
|
|
1646
|
+
available_ligands = "\n".join(available_ligands) # Converting back from a list to a string
|
|
1647
|
+
available_ligands = "ligands to be included in complex; available ligands in the ligands dictionary at molSimplify/molSimplify/Ligands/ligands.dict are: \n%s}" % available_ligands
|
|
1648
|
+
|
|
1649
|
+
parser.add_argument(
|
|
1650
|
+
"-lig LIG", help=available_ligands, action="store_true")
|
|
1651
|
+
if len(p) == 1: # only one input, printing help only
|
|
1652
|
+
args = parser.parse_args()
|
|
1653
|
+
return args
|
|
1654
|
+
elif len(p) == 2: # two inputs, normal parsing
|
|
1655
|
+
args = p[1]
|
|
1656
|
+
parser.parse_args(namespace=args)
|
|
1657
|
+
return 0
|
|
1658
|
+
|
|
1659
|
+
|
|
1660
|
+
def deserialize_json(filein):
|
|
1661
|
+
with open(filein, "r") as fo:
|
|
1662
|
+
args_dict = yaml.safe_load(fo)
|
|
1663
|
+
return args_dict
|
|
1664
|
+
|
|
1665
|
+
|
|
1666
|
+
def args_parser_retrain():
|
|
1667
|
+
parser = argparse.ArgumentParser()
|
|
1668
|
+
parser.add_argument('-user')
|
|
1669
|
+
parser.add_argument('-pwd')
|
|
1670
|
+
parser.add_argument('-retrain')
|
|
1671
|
+
parser.add_argument('-infile')
|
|
1672
|
+
args = parser.parse_args()
|
|
1673
|
+
return args
|