You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* added opls_lj function; pre-commit fails for (1) eps._value call, perhaps this is fine? and (2) usused eps14 variable (need to check that eps == eps14)
* eps14 is not the correct value, off by 0.5 and eps should be used instead; solution: comment out eps14 line to match original ligpargen code
* initial commit to implementing opls_lj with error checking for proper 14 interaction scale values (i.e., 0.5); changed create_system_from_xml to create_ff_from_xml to enable generate_openmm_interchange to have access to combination rules only available via the forcefield...still experiencing NoneType error when creating OpenMMInterchange object which prohibits inspection of OpenMMInterchange in generate_openmm_interchange
* the use of io.StringIO is seemingly a bug? works fine without needing to convert xml to string, leaving this commented for now before checking other cases
* added try/except to handle io.StringIO failure
* added 1-4 scaling conditional statement; fized opls nonbonded method to cutoff; incorporated diffusedxml to follow linter guidelines
* try/except failure should specify selenium or webdriver_manager packages missing
* added generate_opls_xml function with placeholder for ligpargen commands
* fixed shutil.copy to shutil.move to avoid redundant files in tmpdir
* fixed linter issues (namely, subprocess.run(...shell=True) was unsafe and solution was to .split() command into a list of strings
* completed OPLS Docker documentation + except for shifter issues, generate_opls_xml(...) is complete
* completed boss->ligpargen->docker->podman-hpc->subprocess pipeline to generate OPLS .xml files
* minor typo in docs
* updated tests for download_ and generate_opls_xml functions
* removed defusedxml dependency
* removed textwrap dependency
* replaced tag-based opls flag to ff_kwargs for opls
* added names_params documentation
* test_create_ff_from_xml
* pre-commit
* ff_kwargs is not None
* all new tests pass pytest
* added monkeypatching env variables
* fixed docker and/or podman-hpc edge case
* removed rogue file
<summary>Learn to generate OPLS Forcefield Parameters</summary>
453
+
454
+
The OpenFF Force Fields provide a powerful starting point to simulate a variety of organic materials using general forcefields like [Parsley](https://doi.org/10.1021/acs.jctc.1c00571) and [Sage](https://pubs.acs.org/doi/10.1021/acs.jctc.3c00039). Just as is done through the OpenFF Toolkit and Interchange machinery, one can automate force field generation for custom force fields. For instance, LigParGen is an automatic OPLS-AA parameter generator for small organic molecules with both a [online server](https://traken.chem.yale.edu/ligpargen/) and open-source [repository](https://traken.chem.yale.edu/ligpargen/). You will see that for any custom parameter generation tool, one can create a container environment as a wrapper to plug into the workflow described up until now.
455
+
456
+
To do so, you will use the `generate_opls_xml(...)` function in `atomate2/openmm/utils`. This function runs a subprocess to call an image of the LigParGen repository (and all of its respective dependencies). Thus, this requires a local installation of [Docker](https://docs.docker.com/get-started/get-docker/) (otherwise, `download_opls_xml` can be run via the LigParGen website server instead). Once you have docker installed locally, `generate_opls_xml(...)` can be unlocked in three steps:
457
+
458
+
#### 1. Create a Private LigParGen Image
459
+
460
+
You will need to install [BOSS](https://zarbi.chem.yale.edu/software.html)--once you receive the email, follow the instructions, LICENSE guidelines, and save the `boss` directory in the same directory as the following `Dockerfile`:
461
+
462
+
```bash
463
+
FROM ubuntu:20.04
464
+
465
+
LABEL org.opencontainers.image.version="20.04"
466
+
LABEL org.opencontainers.image.ref.name="ubuntu"
467
+
468
+
ARG LAUNCHPAD_BUILD_ARCH
469
+
ARG RELEASE
470
+
471
+
RUN dpkg --add-architecture i386 && \
472
+
apt-get update && \
473
+
apt-get install -y \
474
+
libc6:i386 \
475
+
libncurses5:i386 \
476
+
libstdc++6:i386 \
477
+
zlib1g:i386 \
478
+
gcc-multilib \
479
+
g++-multilib \
480
+
binutils \
481
+
git \
482
+
curl \
483
+
libxrender1 \
484
+
csh && \
485
+
apt-get clean
486
+
487
+
RUN curl -L -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
RUN git clone https://github.com/Isra3l/ligpargen.git /opt/ligpargen && \
499
+
cd /opt/ligpargen && \
500
+
/opt/conda/envs/ligpargen/bin/pip install -e .
501
+
502
+
COPY ./boss /opt/BOSSdir
503
+
504
+
RUN chmod +x /opt/BOSSdir/*
505
+
506
+
ENV BOSSdir="/opt/BOSSdir"
507
+
508
+
WORKDIR /opt/output
509
+
510
+
RUN echo "source activate ligpargen" > ~/.bashrc
511
+
512
+
SHELL ["/bin/bash", "-c"]
513
+
514
+
CMD ["/bin/bash"]
515
+
```
516
+
517
+
It will help to have an account either via [DockerHub](https://hub.docker.com/) or the [NERSC registry](https://registry.nersc.gov/account/sign-in?redirect_url=%2Fharbor%2Fprojects) to *privately* upload your image. Next, follow the docker commands to upload an image to your registry of choice:
518
+
519
+
```bash
520
+
docker build -t USERNAME/ligpargen .
521
+
docker login
522
+
docker push USERNAME/ligpargen
523
+
```
524
+
Note: Be sure to check that on DockerHub, the image `Visibility` is set to `Private`.
525
+
526
+
Now, you can simply pull your image to which ever HPC cluster environment you choose to proceed with,
527
+
528
+
```bash
529
+
docker pull USERNAME/ligpargen:latest
530
+
```
531
+
532
+
On NERSC, users have the option of using [Shifter](https://docs.nersc.gov/development/containers/shifter/how-to-use/) or [Podman](https://docs.nersc.gov/development/containers/podman-hpc/overview/). We recommend Podman in this case to circumvent additional user-level permission requirements. The following Podman commands will work:
Now, just like before, you can create an `Interchange` object. Be sure to include `opls` as an `ff_kwargs` so the correct [geometric combination rules](https://traken.chem.yale.edu/ligpargen/openMM_tutorial.html) for OPLS force fields are invoked,
See that this general process can work transferably for *any* parameter generation software given you (1) create an image, (2) set the image name as an environment variable, and (3) minimally modify `generate_opls_xml(...)` to your own requirements. In future work, we'll improve this black-box type functionality to support wider parameter generation methods.
584
+
585
+
</details>
586
+
449
587
## Analysis with Emmet
450
588
451
589
For now, you'll need to make sure you have a particular emmet branch installed.
0 commit comments