diff --git a/autosolvate/__main__.py b/autosolvate/__main__.py index 79b4ec9..8070dce 100644 --- a/autosolvate/__main__.py +++ b/autosolvate/__main__.py @@ -42,7 +42,7 @@ def main(args=None): startmd(args[1:]) elif args[0] == 'clustergen': print('AutoSolvate is starting in command line mode!') - print('Running the module to extract solvated cluster (sphere) from MD trajectories of solvent box.') + print('Running the module to extract microsolvated clusters from MD trajectories with solvent box.') startclustergen(args[1:]) else: print('Invalid syntax for AutoSolvate command line interface.') diff --git a/autosolvate/generatetrajs.py b/autosolvate/generatetrajs.py index 9140d09..0f2ca50 100644 --- a/autosolvate/generatetrajs.py +++ b/autosolvate/generatetrajs.py @@ -287,8 +287,7 @@ def writeQMMMMinInput(stepsqmmmmin=250): f.write("gpr QMMM Min\n") f.write(" &cntrl\n") f.write(" imin = 1,\n") - f.write(" maxcyc = 2000,\n") - f.write(" ncyc = 1000,\n") + f.write(" maxcyc = "+str(stepsqmmmmin)+",\n") f.write(" irest = 0, ! 0- new simulation 1- restart\n") f.write(" ntx = 1, ! 1-read in coordinates, but not velocity, 5-both\n") f.write(" cut = 8.0,\n") @@ -342,8 +341,11 @@ def writeQMMMInput(temperature=300, charge=0, stepsqmmm=250, infilename='qmmmhea f.write("gpr QMMM "+infilename+"\n") f.write(" &cntrl\n") f.write(" imin = 0,\n") - f.write(" irest = 1, ! 0- new simulation 1- restart\n") - f.write(" ntx = 5, ! 1-read in coordinates, but not velocity, 5-both\n") + if infilename=='qmmmheat.in': + f.write(" ntx = 1, ! 1-read in coordinates, but not velocity, 5-both\n") + else: + f.write(" ntx = 5, ! 1-read in coordinates, but not velocity, 5-both\n") + f.write(" irest = 1, ! 0- new simulation 1- restart\n") f.write(" cut = 8.0,\n") f.write(" ig = -1, !random seed\n") f.write(" ntc = 2, ntf = 2, !Shake is used for solvent\n") diff --git a/docs/_data/naphthalene_radical.xyz b/docs/_data/naphthalene_radical.xyz new file mode 100644 index 0000000..eb87fa0 --- /dev/null +++ b/docs/_data/naphthalene_radical.xyz @@ -0,0 +1,20 @@ +18 +naphthalene radical +C 2.4584929186 -0.6980401434 0.0000208854 +C 2.4584830542 0.6980208281 0.0000273558 +C 1.2392834454 1.4064616303 0.0000201346 +C -0.0000127820 0.7187236077 0.0000072068 +C -1.2393189424 1.4064428097 0.0000009527 +C -2.4585398474 0.6980627613 -0.0000119130 +C -2.4584830245 -0.6980052848 -0.0000182990 +C -1.2392726206 -1.4064393494 -0.0000121035 +C 0.0000166810 -0.7186826023 0.0000005670 +C 1.2392855074 -1.4064696461 0.0000073561 +H 1.2470800358 -2.4919577916 0.0000018617 +H -1.2470920207 -2.4919275393 -0.0000168975 +H -3.3951566422 -1.2429180456 -0.0000277271 +H -3.3952681112 1.2428765068 -0.0000168560 +H -1.2469606339 2.4919363439 0.0000063915 +H 1.2471333000 2.4919523490 0.0000239494 +H 3.3951743890 1.2429028846 0.0000376679 +H 3.3951863936 -1.2429173191 0.0000261673 diff --git a/docs/_data/water_solvated-cutoutn-0.xyz b/docs/_data/water_solvated-cutoutn-0.xyz new file mode 100644 index 0000000..3f8f567 --- /dev/null +++ b/docs/_data/water_solvated-cutoutn-0.xyz @@ -0,0 +1,296 @@ +294 +Created with MDTraj 1.9.7, 2022-02-22 + C 33.391 31.775 32.503 + C 33.369 32.604 31.316 + C 32.288 32.531 30.482 + C 31.211 31.613 30.687 + C 30.004 31.595 29.878 + C 28.953 30.859 30.252 + C 29.020 30.063 31.428 + C 30.118 29.988 32.225 + C 31.214 30.863 31.870 + C 32.426 30.881 32.696 + H 32.376 30.193 33.584 + H 30.074 29.336 33.126 + H 28.125 29.482 31.708 + H 27.955 30.779 29.738 + H 30.044 32.230 28.982 + H 32.354 33.233 29.660 + H 34.166 33.376 31.094 + H 34.257 31.931 33.166 + O 37.140 34.854 37.029 + H 37.288 35.702 36.611 + H 37.249 35.026 37.965 + O 30.929 37.829 32.265 + H 31.237 38.718 32.438 + H 31.434 37.279 32.863 + O 31.686 33.976 33.654 + H 31.166 33.260 34.019 + H 32.328 33.544 33.091 + O 32.840 26.985 34.074 + H 33.032 27.164 33.153 + H 33.174 27.750 34.541 + O 32.317 36.470 34.471 + H 32.968 36.148 35.094 + H 32.047 35.692 33.983 + O 35.624 37.642 35.473 + H 36.026 38.414 35.871 + H 35.182 37.977 34.693 + O 36.183 32.504 28.766 + H 36.146 32.317 29.704 + H 36.538 33.391 28.712 + O 38.611 36.000 32.624 + H 37.686 35.897 32.844 + H 38.665 36.865 32.217 + O 34.374 35.247 36.059 + H 35.135 34.693 35.884 + H 34.720 36.140 36.048 + O 35.847 35.340 32.863 + H 35.969 34.484 32.453 + H 35.250 35.804 32.277 + O 38.956 36.881 29.304 + H 39.348 37.695 28.988 + H 38.035 37.099 29.448 + O 34.430 36.226 30.688 + H 33.631 36.171 30.164 + H 35.121 36.411 30.053 + O 38.034 34.183 25.988 + H 38.247 33.949 26.892 + H 37.371 33.544 25.726 + O 39.995 30.602 32.025 + H 40.285 31.094 32.793 + H 40.764 30.098 31.759 + O 38.041 30.975 27.557 + H 37.340 31.564 27.836 + H 38.819 31.295 28.014 + O 37.312 30.645 32.768 + H 38.235 30.854 32.626 + H 37.232 29.727 32.509 + O 36.226 37.379 29.050 + H 36.326 37.406 28.098 + H 35.887 38.244 29.280 + O 34.523 38.763 32.325 + H 33.626 39.061 32.477 + H 34.426 37.972 31.796 + O 30.902 37.818 29.488 + H 30.643 37.864 30.408 + H 30.685 38.681 29.134 + O 35.769 32.740 25.738 + H 36.070 31.850 25.551 + H 35.213 32.647 26.511 + O 38.780 32.857 35.567 + H 38.437 33.148 36.411 + H 38.424 33.482 34.935 + O 34.472 36.297 26.697 + H 33.986 36.589 25.926 + H 35.368 36.596 26.542 + O 30.681 35.301 24.496 + H 31.498 35.798 24.466 + H 30.333 35.464 25.373 + O 38.672 33.784 28.664 + H 38.769 34.661 29.036 + H 39.227 33.229 29.212 + O 27.237 28.432 24.566 + H 27.598 28.627 23.702 + H 28.004 28.332 25.130 + O 34.794 34.515 23.629 + H 35.055 34.149 24.474 + H 34.930 33.800 23.007 + O 27.729 29.105 35.771 + H 28.244 29.858 35.481 + H 27.549 28.614 34.969 + O 28.454 27.465 37.823 + H 29.404 27.399 37.916 + H 28.319 28.255 37.300 + O 30.132 29.985 39.152 + H 30.631 29.618 39.883 + H 29.578 30.655 39.553 + O 35.703 26.202 36.470 + H 35.399 27.005 36.894 + H 35.530 25.513 37.112 + O 36.466 32.015 37.334 + H 35.538 31.810 37.444 + H 36.496 32.971 37.284 + O 39.252 27.810 33.387 + H 39.022 28.361 32.639 + H 38.497 27.233 33.500 + O 34.014 28.990 35.453 + H 34.874 29.404 35.391 + H 33.994 28.609 36.332 + O 31.816 30.638 23.695 + H 32.324 29.908 23.340 + H 31.851 31.308 23.013 + O 24.461 24.884 32.906 + H 25.172 24.575 33.466 + H 24.163 25.693 33.322 + O 39.723 33.752 31.435 + H 40.151 33.489 32.249 + H 39.468 34.663 31.582 + O 34.051 28.895 29.119 + H 34.941 28.573 28.971 + H 33.970 29.652 28.540 + O 34.215 28.213 38.162 + H 34.901 27.743 38.635 + H 34.249 29.103 38.512 + O 31.268 25.185 36.068 + H 32.092 25.095 35.589 + H 31.418 25.917 36.666 + O 27.699 26.245 30.909 + H 27.497 26.959 31.514 + H 27.445 26.581 30.050 + O 36.687 29.644 35.347 + H 36.796 30.293 36.043 + H 37.095 30.046 34.580 + O 29.445 28.271 26.030 + H 29.974 29.018 26.310 + H 30.065 27.690 25.589 + O 36.861 32.898 31.435 + H 37.816 32.966 31.409 + H 36.690 32.123 31.971 + O 36.747 26.596 33.938 + H 36.408 26.509 34.829 + H 36.107 27.151 33.492 + O 33.826 31.238 27.583 + H 34.489 31.696 28.100 + H 33.085 31.843 27.554 + O 26.268 24.006 30.873 + H 25.706 24.201 31.623 + H 26.882 24.740 30.836 + O 37.614 28.364 31.053 + H 37.292 28.770 30.248 + H 37.780 27.453 30.812 + O 32.436 33.566 27.014 + H 32.628 33.949 26.158 + H 32.464 34.307 27.620 + O 31.948 27.861 30.438 + H 32.555 28.292 29.837 + H 31.303 28.535 30.651 + O 32.316 25.155 30.771 + H 32.162 26.084 30.602 + H 33.269 25.074 30.815 + O 35.054 26.004 30.333 + H 36.007 25.958 30.407 + H 34.877 25.847 29.405 + O 35.531 30.002 25.502 + H 35.668 29.197 26.001 + H 34.663 30.305 25.769 + O 27.159 34.579 33.493 + H 26.791 34.278 34.324 + H 26.416 34.578 32.889 + O 25.022 34.818 31.623 + H 24.271 34.745 31.034 + H 25.710 34.306 31.199 + O 25.858 32.718 36.384 + H 25.616 32.271 35.573 + H 26.266 32.038 36.919 + O 32.266 34.194 37.289 + H 33.014 34.425 36.738 + H 31.523 34.165 36.685 + O 30.648 30.200 36.417 + H 31.226 29.447 36.540 + H 30.338 30.410 37.298 + O 34.000 31.365 38.273 + H 33.969 32.191 38.756 + H 33.159 31.321 37.819 + O 25.001 29.862 32.323 + H 25.458 29.747 31.490 + H 25.136 29.036 32.787 + O 24.429 31.537 29.045 + H 25.029 31.963 28.433 + H 23.710 31.223 28.497 + O 27.430 36.884 26.697 + H 28.355 36.640 26.679 + H 27.156 36.720 27.599 + O 24.022 33.873 26.407 + H 23.605 33.991 27.261 + H 24.885 34.273 26.505 + O 32.615 35.764 28.572 + H 33.209 36.132 27.918 + H 32.054 36.497 28.826 + O 29.109 32.422 26.301 + H 29.099 32.481 25.346 + H 29.977 32.080 26.511 + O 26.685 36.104 29.260 + H 27.344 36.191 29.948 + H 26.575 35.159 29.152 + O 30.105 36.485 26.886 + H 30.509 37.331 26.694 + H 30.521 36.199 27.699 + O 26.891 33.434 29.828 + H 27.712 33.286 30.298 + H 26.976 32.914 29.028 + O 28.263 36.366 31.594 + H 28.036 35.708 32.252 + H 28.920 36.915 32.021 + O 30.131 32.689 35.569 + H 30.416 31.869 35.973 + H 29.322 32.462 35.110 + O 27.660 27.239 27.972 + H 28.244 27.566 27.288 + H 27.030 26.689 27.506 + O 29.283 33.110 23.622 + H 29.988 32.708 23.114 + H 29.699 33.852 24.062 + O 26.532 30.532 37.987 + H 26.910 29.884 37.393 + H 25.641 30.222 38.146 + O 25.134 31.850 33.974 + H 24.958 31.300 33.211 + H 24.447 32.517 33.953 + O 31.570 27.344 38.048 + H 31.500 27.357 39.002 + H 32.453 27.665 37.868 + O 29.035 25.919 34.312 + H 29.118 25.551 35.192 + H 29.877 25.736 33.896 + O 27.032 25.335 36.462 + H 27.275 26.196 36.802 + H 26.081 25.296 36.567 + O 34.507 28.128 32.200 + H 34.424 27.518 31.467 + H 34.328 28.987 31.819 + O 23.233 33.812 29.767 + H 22.595 33.353 30.314 + H 23.868 33.138 29.524 + O 23.833 27.194 27.549 + H 23.621 26.789 28.390 + H 24.306 26.514 27.069 + O 36.693 28.821 28.381 + H 37.178 29.589 28.080 + H 37.277 28.083 28.204 + O 25.950 29.583 26.607 + H 26.338 29.359 25.761 + H 25.404 28.829 26.827 + O 24.117 27.312 34.132 + H 23.228 26.998 33.963 + H 23.994 28.175 34.527 + O 26.846 31.780 27.701 + H 27.642 31.972 27.205 + H 26.545 30.940 27.356 + O 27.924 31.462 33.921 + H 28.213 31.469 33.008 + H 26.969 31.498 33.870 + O 29.841 24.912 29.666 + H 29.162 25.349 30.180 + H 30.647 25.060 30.160 + O 27.043 27.522 33.440 + H 26.337 27.180 33.988 + H 27.786 26.946 33.619 + O 26.064 29.131 29.951 + H 26.615 28.820 29.233 + H 25.584 29.872 29.582 + O 22.370 28.606 29.443 + H 22.637 27.884 30.011 + H 22.762 28.400 28.594 + O 23.358 26.229 30.281 + H 23.252 25.347 29.927 + H 23.953 26.119 31.023 + O 33.043 24.123 33.983 + H 33.907 24.039 33.581 + H 32.792 25.033 33.827 + O 31.129 30.616 26.274 + H 32.022 30.548 26.611 + H 31.223 30.529 25.326 + O 23.457 29.842 35.127 + H 22.619 30.146 34.779 + H 24.087 30.507 34.851 diff --git a/docs/_data/water_solvated-qmmmheat.netcdf b/docs/_data/water_solvated-qmmmheat.netcdf new file mode 100644 index 0000000..af2a72a Binary files /dev/null and b/docs/_data/water_solvated-qmmmheat.netcdf differ diff --git a/docs/_data/water_solvated-qmmmnvt.netcdf b/docs/_data/water_solvated-qmmmnvt.netcdf index db9ca6b..41a7861 100644 Binary files a/docs/_data/water_solvated-qmmmnvt.netcdf and b/docs/_data/water_solvated-qmmmnvt.netcdf differ diff --git a/docs/_data/water_solvated.prmtop b/docs/_data/water_solvated.prmtop index 65704e7..06cb348 100644 --- a/docs/_data/water_solvated.prmtop +++ b/docs/_data/water_solvated.prmtop @@ -1,11 +1,11 @@ -%VERSION VERSION_STAMP = V0001.000 DATE = 01/01/22 15:59:46 +%VERSION VERSION_STAMP = V0001.000 DATE = 02/19/22 11:39:06 %FLAG TITLE %FORMAT(20a4) SLU %FLAG POINTERS %FORMAT(10I8) 24003 4 23993 11 16 14 34 20 0 0 - 32069 7996 11 14 20 4 2 2 4 1 + 32069 7996 11 14 20 4 2 2 4 0 0 0 0 0 0 0 0 1 18 0 0 %FLAG ATOM_NAME @@ -18029,7 +18029,7 @@ O H1 H2 %FLAG NONBONDED_PARM_INDEX %FORMAT(10I8) 1 2 4 7 2 3 5 8 4 5 - 6 -1 7 8 -1 10 + 6 9 7 8 9 10 %FLAG RESIDUE_LABEL %FORMAT(20a4) SLU WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT @@ -29737,13 +29737,13 @@ WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT WAT 0 23999 24000 24000 0 24002 24003 24003 0 %FLAG HBOND_ACOEF %FORMAT(5E16.8) - 0.00000000E+00 + %FLAG HBOND_BCOEF %FORMAT(5E16.8) - 0.00000000E+00 + %FLAG HBCUT %FORMAT(5E16.8) - 0.00000000E+00 + %FLAG AMBER_ATOM_TYPE %FORMAT(20a4) ca ca ca ca ca ca ca ca ca ca ha ha ha ha ha ha ha ha OW HW diff --git a/docs/tutorial.rst b/docs/tutorial.rst index b1b7c28..bf7baa0 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -57,6 +57,16 @@ Once you have AutoSolvate and all dependencies installed you will need the solut H 3.3951743890 1.2429028846 0.0000376679 H 3.3951863936 -1.2429173191 0.0000261673 + +.. note:: + + You can download both xyz files here: + + :download:`naphthalene_neutral.xyz <_data/naphthalene_neutral.xyz>` + + :download:`naphthalene_radical.xyz <_data/naphthalene_radical.xyz>` + + Now that you have the structures, make a directory for each example. We will start with the neutral molecule. Example 1: Naphthalene in Water @@ -309,7 +319,7 @@ To extract the cluster from the final QMMM results, use the following command: If you were not able to run the QMMM simulation above, you can download the QM/MM trajectory here: - :download:`water_solvated-qmmmnvt <_data/water_solvated-qmmmnvt.netcdf>` + :download:`water_solvated-qmmmnvt.netcdf <_data/water_solvated-qmmmnvt.netcdf>` The .prmtop and .netcdf filenames are required, but Autosolvate will use the default values of 0 for the starting frame, 100 for the extraction interval, and a cutout size of 4 Å. @@ -333,14 +343,21 @@ The output of this command will be the cartesian coordinates of the microsolvate .. image:: _images/tutorial4_3.jpg :width: 400 -Running the above command only generates one xyz file because we only did 10 steps of the QMMM NVT in our example mdrun, and we asked for a cluster from every ten frames. However, if we extract every step (with option `-i 1`), then we will get 10 coordinate files. +Running the above command only generates one xyz file because we only did 100 steps of the QMMM NVT in our example mdrun, and we asked for a cluster from every hundred frames. However, if we extract every 10 steps (with option `-i 10`), then we will get 10 coordinate files. We can increase the solvent shell size to 6 Å with `-s 6`. -``autosolvate clustergen -f water_solvated.prmtop -t water_solvated-qmmmnvt.netcdf -a 0 -i 1 -s 4`` +``autosolvate clustergen -f water_solvated.prmtop -t water_solvated-qmmmnvt.netcdf -a 0 -i 10 -s 6`` As Autosolvate is running, you will notice this line now includes the list of the 10 frames that the clusters will be extracted from:: extracting from frames: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90] +.. note:: + + If you were not able to run the clustergen command above, you can download one of the microsolvated clusters with 6 Å solvent shell size here: + + :download:`water_solvated-cutoutn-0.xyz <_data/water_solvated-cutoutn-0.xyz>` + + .. warning:: The naming of the microsolvated clusters is based on the name of the .prmtop file, not the trajectory file, so the names will not change between runs. This means that if you run the clustergen command twice, *the new coordinates will overwrite the old ones* (if the frame number is the same). Therefore, if you want to extract clusters from multiple MD steps (like QMMM heat and QMMM NVT), you need to either move or rename the files before you run the command again.