├── .coveragerc
├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── devtools
└── travis-ci
│ └── install.sh
├── docs
├── Makefile
├── _build
│ ├── doctrees
│ │ ├── environment.pickle
│ │ ├── index.doctree
│ │ ├── installation.doctree
│ │ ├── modules.doctree
│ │ ├── msibi.doctree
│ │ ├── msibi.utils.doctree
│ │ └── tutorials
│ │ │ └── tutorials.doctree
│ └── html
│ │ ├── .buildinfo
│ │ ├── _modules
│ │ ├── index.html
│ │ ├── msibi.html
│ │ └── msibi
│ │ │ ├── optimize.html
│ │ │ ├── pair.html
│ │ │ ├── potentials.html
│ │ │ ├── state.html
│ │ │ ├── utils
│ │ │ ├── error_calculation.html
│ │ │ ├── exceptions.html
│ │ │ └── general.html
│ │ │ └── workers.html
│ │ ├── _sources
│ │ ├── index.txt
│ │ ├── installation.txt
│ │ ├── modules.txt
│ │ ├── msibi.txt
│ │ ├── msibi.utils.txt
│ │ └── tutorials
│ │ │ └── tutorials.txt
│ │ ├── _static
│ │ ├── ajax-loader.gif
│ │ ├── basic.css
│ │ ├── comment-bright.png
│ │ ├── comment-close.png
│ │ ├── comment.png
│ │ ├── css
│ │ │ ├── badge_only.css
│ │ │ └── theme.css
│ │ ├── default.css
│ │ ├── doctools.js
│ │ ├── down-pressed.png
│ │ ├── down.png
│ │ ├── file.png
│ │ ├── fonts
│ │ │ ├── fontawesome-webfont.eot
│ │ │ ├── fontawesome-webfont.svg
│ │ │ ├── fontawesome-webfont.ttf
│ │ │ └── fontawesome-webfont.woff
│ │ ├── jquery.js
│ │ ├── js
│ │ │ └── theme.js
│ │ ├── minus.png
│ │ ├── plus.png
│ │ ├── pygments.css
│ │ ├── searchtools.js
│ │ ├── sidebar.js
│ │ ├── underscore.js
│ │ ├── up-pressed.png
│ │ ├── up.png
│ │ └── websupport.js
│ │ ├── genindex.html
│ │ ├── index.html
│ │ ├── installation.html
│ │ ├── modules.html
│ │ ├── msibi.html
│ │ ├── msibi.utils.html
│ │ ├── objects.inv
│ │ ├── py-modindex.html
│ │ ├── search.html
│ │ ├── searchindex.js
│ │ └── tutorials
│ │ └── tutorials.html
├── conf.py
├── index.rst
├── installation.rst
├── make.bat
├── modules.rst
├── msibi.rst
├── msibi.utils.rst
└── tutorials
│ └── tutorials.rst
├── environment.yml
├── msibi
├── __init__.py
├── optimize.py
├── pair.py
├── potentials.py
├── state.py
├── tests
│ ├── __init__.py
│ ├── test_error_calculation.py
│ ├── test_msibi.py
│ ├── test_pair.py
│ ├── test_potentials.py
│ ├── test_select_pairs.py
│ ├── test_state.py
│ ├── test_utils.py
│ └── test_workers.py
├── tutorials
│ ├── README
│ ├── lj
│ │ ├── opt.py
│ │ ├── rdfs
│ │ │ ├── rdf.target0.t1t1.txt
│ │ │ ├── rdf.target1.t1t1.txt
│ │ │ └── rdf.target2.t1t1.txt
│ │ ├── state0
│ │ │ ├── hoomd_run_template.py
│ │ │ └── start.hoomdxml
│ │ ├── state1
│ │ │ ├── hoomd_run_template.py
│ │ │ └── start.hoomdxml
│ │ └── state2
│ │ │ ├── hoomd_run_template.py
│ │ │ └── start.hoomdxml
│ └── propane
│ │ ├── .gitignore
│ │ ├── opt.py
│ │ ├── plot.py
│ │ ├── propane.ipynb
│ │ ├── rdfs
│ │ ├── C3-C3-state_A.txt
│ │ ├── C3-C3-state_B.txt
│ │ └── C3-C3-state_C.txt
│ │ ├── state_A
│ │ ├── hoomd_run_template.py
│ │ └── start.hoomdxml
│ │ ├── state_B
│ │ ├── hoomd_run_template.py
│ │ └── start.hoomdxml
│ │ └── state_C
│ │ ├── hoomd_run_template.py
│ │ └── start.hoomdxml
├── utils
│ ├── __init__.py
│ ├── error_calculation.py
│ ├── exceptions.py
│ ├── find_exclusions.py
│ ├── general.py
│ ├── reference
│ │ ├── 2chains.hoomdxml
│ │ ├── final.hoomdxml
│ │ ├── state0
│ │ │ ├── err.txt
│ │ │ ├── hoomd_run_template.py
│ │ │ ├── log.txt
│ │ │ ├── query.dcd
│ │ │ ├── sys.hoomdxml
│ │ │ └── target-rdf.txt
│ │ └── state1
│ │ │ ├── hoomd_run_template.py
│ │ │ ├── query.dcd
│ │ │ ├── sys.hoomdxml
│ │ │ └── target-rdf.txt
│ └── smoothing.py
└── workers.py
├── requirements.txt
└── setup.py
/.coveragerc:
--------------------------------------------------------------------------------
1 | [report]
2 | omit = */tutorials/*
3 | exclude_lines =
4 | pragma: no cover
5 |
6 | # Don't complain if non-runnable code isn't run:
7 | if 0:
8 | if __name__ == .__main__.:
9 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Default files
2 | *.pyc
3 | *.dcd
4 | .DS_Store
5 | *.egg-info
6 |
7 | # Byte-compiled / optimized / DLL files
8 | __pycache__/
9 | *.py[cod]
10 | *$py.class
11 |
12 | # C extensions
13 | *.so
14 |
15 | # Distribution / packaging
16 | .Python
17 | build/
18 | develop-eggs/
19 | dist/
20 | downloads/
21 | eggs/
22 | .eggs/
23 | lib/
24 | lib64/
25 | parts/
26 | sdist/
27 | var/
28 | wheels/
29 | *.egg-info/
30 | .installed.cfg
31 | *.egg
32 |
33 | # PyInstaller
34 | # Usually these files are written by a python script from a template
35 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
36 | *.manifest
37 | *.spec
38 |
39 | # Installer logs
40 | pip-log.txt
41 | pip-delete-this-directory.txt
42 |
43 | # Unit test / coverage reports
44 | htmlcov/
45 | .tox/
46 | .coverage
47 | .coverage.*
48 | .cache
49 | nosetests.xml
50 | coverage.xml
51 | *.cover
52 | .hypothesis/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 |
62 | # Flask stuff:
63 | instance/
64 | .webassets-cache
65 |
66 | # Scrapy stuff:
67 | .scrapy
68 |
69 | # Sphinx documentation
70 | docs/_build/
71 |
72 | # PyBuilder
73 | target/
74 |
75 | # Jupyter Notebook
76 | .ipynb_checkpoints
77 |
78 | # pyenv
79 | .python-version
80 |
81 | # celery beat schedule file
82 | celerybeat-schedule
83 |
84 | # SageMath parsed files
85 | *.sage.py
86 |
87 | # Environments
88 | .env
89 | .venv
90 | env/
91 | venv/
92 | ENV/
93 |
94 | # Spyder project settings
95 | .spyderproject
96 | .spyproject
97 |
98 | # Rope project settings
99 | .ropeproject
100 |
101 | # mkdocs documentation
102 | /site
103 |
104 | # mypy
105 | .mypy_cache/
106 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: generic
2 |
3 | sudo: false
4 |
5 | matrix:
6 | include:
7 | - { os: linux, env: PYTHON_VERSION=2.7 }
8 | - { os: linux, env: PYTHON_VERSION=3.5 }
9 | - { os: linux, env: PYTHON_VERSION=3.6 }
10 | - { os: osx, env: PYTHON_VERSION=2.7 }
11 | - { os: osx, env: PYTHON_VERSION=3.5 }
12 |
13 | install:
14 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install md5sha1sum; fi
15 | - source devtools/travis-ci/install.sh
16 | - conda config --set always_yes yes --set changeps1 no
17 | - conda env create -n test-environment python=$PYTHON_VERSION -f environment.yml
18 | - source activate test-environment
19 | - pip install -e .
20 |
21 | script:
22 | - pytest -v --cov=msibi --cov-report= --pyargs msibi
23 |
24 | after_success:
25 | - coveralls
26 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Christoph Klein and Timothy C. Moore
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | MultiState Iterative Boltzmann Inversion
2 | ----------------------------------------
3 | [](https://travis-ci.org/mosdef-hub/msibi)
4 | [](https://coveralls.io/r/ctk3b/msibi?branch=master)
5 |
6 | A package to help you manage and run pair potential optimizations using
7 | multistate iterative Boltzmann inversion.
8 |
9 | Install from source:
10 | ```python
11 | git clone https://github.com/mosdef-hub/msibi.git
12 | cd msibi
13 | pip install .
14 | ```
15 |
16 |
17 | #### Citation [](http://dx.doi.org/10.1063/1.4880555)
18 | Details of the underlying method and its validation can be found [here](http://dx.doi.org/10.1063/1.4880555).
19 |
20 | If you use this package, please cite the above paper. The BibTeX reference is
21 | ```
22 | @article{Moore2014,
23 | author = "Moore, Timothy C. and Iacovella, Christopher R. and McCabe, Clare",
24 | title = "Derivation of coarse-grained potentials via multistate iterative Boltzmann inversion",
25 | journal = "The Journal of Chemical Physics",
26 | year = "2014",
27 | volume = "140",
28 | number = "22",
29 | doi = "http://dx.doi.org/10.1063/1.4880555"
30 | }
31 | ```
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/devtools/travis-ci/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then MINICONDA=Miniconda3-latest-MacOSX-x86_64.sh; fi
4 | if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then MINICONDA=Miniconda3-latest-Linux-x86_64.sh; fi
5 |
6 | MINICONDA_MD5=$(curl -s https://repo.continuum.io/miniconda/ | grep -A3 $MINICONDA | sed -n '4p' | sed -n 's/ *
\(.*\)<\/td> */\1/p')
7 | wget https://repo.continuum.io/miniconda/$MINICONDA
8 | if [[ $MINICONDA_MD5 != $(md5sum $MINICONDA | cut -d ' ' -f 1) ]]; then
9 | echo "Miniconda MD5 mismatch"
10 | exit 1
11 | fi
12 | bash $MINICONDA -b
13 | rm -f $MINICONDA
14 |
15 | export PATH=$HOME/miniconda3/bin:$PATH
16 |
17 | conda update -yq conda
18 |
--------------------------------------------------------------------------------
/docs/Makefile:
--------------------------------------------------------------------------------
1 | # Makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line.
5 | SPHINXOPTS =
6 | SPHINXBUILD = sphinx-build
7 | PAPER =
8 | BUILDDIR = _build
9 |
10 | # User-friendly check for sphinx-build
11 | ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
12 | $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
13 | endif
14 |
15 | # Internal variables.
16 | PAPEROPT_a4 = -D latex_paper_size=a4
17 | PAPEROPT_letter = -D latex_paper_size=letter
18 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
19 | # the i18n builder cannot share the environment and doctrees with the others
20 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
21 |
22 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
23 |
24 | help:
25 | @echo "Please use \`make ' where is one of"
26 | @echo " html to make standalone HTML files"
27 | @echo " dirhtml to make HTML files named index.html in directories"
28 | @echo " singlehtml to make a single large HTML file"
29 | @echo " pickle to make pickle files"
30 | @echo " json to make JSON files"
31 | @echo " htmlhelp to make HTML files and a HTML help project"
32 | @echo " qthelp to make HTML files and a qthelp project"
33 | @echo " devhelp to make HTML files and a Devhelp project"
34 | @echo " epub to make an epub"
35 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
36 | @echo " latexpdf to make LaTeX files and run them through pdflatex"
37 | @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
38 | @echo " text to make text files"
39 | @echo " man to make manual pages"
40 | @echo " texinfo to make Texinfo files"
41 | @echo " info to make Texinfo files and run them through makeinfo"
42 | @echo " gettext to make PO message catalogs"
43 | @echo " changes to make an overview of all changed/added/deprecated items"
44 | @echo " xml to make Docutils-native XML files"
45 | @echo " pseudoxml to make pseudoxml-XML files for display purposes"
46 | @echo " linkcheck to check all external links for integrity"
47 | @echo " doctest to run all doctests embedded in the documentation (if enabled)"
48 |
49 | clean:
50 | rm -rf $(BUILDDIR)/*
51 |
52 | html:
53 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
54 | @echo
55 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
56 |
57 | dirhtml:
58 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
59 | @echo
60 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
61 |
62 | singlehtml:
63 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
64 | @echo
65 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
66 |
67 | pickle:
68 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
69 | @echo
70 | @echo "Build finished; now you can process the pickle files."
71 |
72 | json:
73 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
74 | @echo
75 | @echo "Build finished; now you can process the JSON files."
76 |
77 | htmlhelp:
78 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
79 | @echo
80 | @echo "Build finished; now you can run HTML Help Workshop with the" \
81 | ".hhp project file in $(BUILDDIR)/htmlhelp."
82 |
83 | qthelp:
84 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
85 | @echo
86 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \
87 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
88 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/msibi.qhcp"
89 | @echo "To view the help file:"
90 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/msibi.qhc"
91 |
92 | devhelp:
93 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
94 | @echo
95 | @echo "Build finished."
96 | @echo "To view the help file:"
97 | @echo "# mkdir -p $$HOME/.local/share/devhelp/msibi"
98 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/msibi"
99 | @echo "# devhelp"
100 |
101 | epub:
102 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
103 | @echo
104 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
105 |
106 | latex:
107 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
108 | @echo
109 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
110 | @echo "Run \`make' in that directory to run these through (pdf)latex" \
111 | "(use \`make latexpdf' here to do that automatically)."
112 |
113 | latexpdf:
114 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
115 | @echo "Running LaTeX files through pdflatex..."
116 | $(MAKE) -C $(BUILDDIR)/latex all-pdf
117 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
118 |
119 | latexpdfja:
120 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
121 | @echo "Running LaTeX files through platex and dvipdfmx..."
122 | $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
123 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
124 |
125 | text:
126 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
127 | @echo
128 | @echo "Build finished. The text files are in $(BUILDDIR)/text."
129 |
130 | man:
131 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
132 | @echo
133 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
134 |
135 | texinfo:
136 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
137 | @echo
138 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
139 | @echo "Run \`make' in that directory to run these through makeinfo" \
140 | "(use \`make info' here to do that automatically)."
141 |
142 | info:
143 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
144 | @echo "Running Texinfo files through makeinfo..."
145 | make -C $(BUILDDIR)/texinfo info
146 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
147 |
148 | gettext:
149 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
150 | @echo
151 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
152 |
153 | changes:
154 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
155 | @echo
156 | @echo "The overview file is in $(BUILDDIR)/changes."
157 |
158 | linkcheck:
159 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
160 | @echo
161 | @echo "Link check complete; look for any errors in the above output " \
162 | "or in $(BUILDDIR)/linkcheck/output.txt."
163 |
164 | doctest:
165 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
166 | @echo "Testing of doctests in the sources finished, look at the " \
167 | "results in $(BUILDDIR)/doctest/output.txt."
168 |
169 | xml:
170 | $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
171 | @echo
172 | @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
173 |
174 | pseudoxml:
175 | $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
176 | @echo
177 | @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
178 |
--------------------------------------------------------------------------------
/docs/_build/doctrees/environment.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/doctrees/environment.pickle
--------------------------------------------------------------------------------
/docs/_build/doctrees/index.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/doctrees/index.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/installation.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/doctrees/installation.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/modules.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/doctrees/modules.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/msibi.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/doctrees/msibi.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/msibi.utils.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/doctrees/msibi.utils.doctree
--------------------------------------------------------------------------------
/docs/_build/doctrees/tutorials/tutorials.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/doctrees/tutorials/tutorials.doctree
--------------------------------------------------------------------------------
/docs/_build/html/.buildinfo:
--------------------------------------------------------------------------------
1 | # Sphinx build info version 1
2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3 | config: 6d96a8f08570e594df26c7bcfa08ca67
4 | tags: 645f666f9bcd5a90fca523b33c5a78b7
5 |
--------------------------------------------------------------------------------
/docs/_build/html/_modules/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Overview: module code — Multistate Iterative Boltzmann Inversion 0.1 documentation
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
59 |
60 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | Multistate Iterative Boltzmann Inversion
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 | Docs »
119 |
120 | Overview: module code
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
All modules for which code is available
130 |
140 |
141 |
142 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
195 |
196 |
197 |
198 |
--------------------------------------------------------------------------------
/docs/_build/html/_modules/msibi.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | msibi — Multistate Iterative Boltzmann Inversion 0.1 documentation
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
60 |
61 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | Multistate Iterative Boltzmann Inversion
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 | Docs »
120 |
121 | Module code »
122 |
123 | msibi
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
Source code for msibi
133 | from msibi.optimize import MSIBI
134 | from msibi.pair import Pair
135 | from msibi.potentials import *
136 | from msibi.state import State
137 |
138 | __all__ = [ 'MSIBI' , 'Pair' , 'State' ,
139 |
140 | # Potentials.
141 | 'mie' , 'morse' ]
142 |
143 |
144 |
145 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
198 |
199 |
200 |
201 |
--------------------------------------------------------------------------------
/docs/_build/html/_modules/msibi/utils/error_calculation.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | msibi.utils.error_calculation — Multistate Iterative Boltzmann Inversion 0.1 documentation
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
60 |
61 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | Multistate Iterative Boltzmann Inversion
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 | Docs »
120 |
121 | Module code »
122 |
123 | msibi »
124 |
125 | msibi.utils.error_calculation
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
Source code for msibi.utils.error_calculation
135 | import numpy as np
136 |
137 |
138 | [docs] def calc_similarity ( arr1 , arr2 ):
139 |
f_fit = np . sum ( np . absolute ( arr1 - arr2 ))
140 |
f_fit /= np . sum (( np . absolute ( arr1 ) + np . absolute ( arr2 )))
141 |
return 1.0 - f_fit
142 |
143 |
144 |
145 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
198 |
199 |
200 |
201 |
--------------------------------------------------------------------------------
/docs/_build/html/_modules/msibi/utils/exceptions.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | msibi.utils.exceptions — Multistate Iterative Boltzmann Inversion 0.1 documentation
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
60 |
61 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 | Multistate Iterative Boltzmann Inversion
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 | Docs »
120 |
121 | Module code »
122 |
123 | msibi »
124 |
125 | msibi.utils.exceptions
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
Source code for msibi.utils.exceptions
135 | SUPPORTED_ENGINES = [ 'hoomd' ]
136 |
137 |
138 | [docs] class UnsupportedEngine ( Exception ):
139 |
def __init__ ( self , engine ):
140 |
message = 'Unsupported engine: "{0}". Supported engines are: {1}' . format (
141 |
engine , ', ' . join ( SUPPORTED_ENGINES ))
142 |
super ( UnsupportedEngine , self ) . __init__ ( message )
143 |
144 |
145 |
146 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
199 |
200 |
201 |
202 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/index.txt:
--------------------------------------------------------------------------------
1 | .. Multistate Iterative Boltzmann Inversion documentation master file, created by
2 | sphinx-quickstart on Mon Mar 30 14:37:56 2015.
3 | You can adapt this file completely to your liking, but it should at least
4 | contain the root `toctree` directive.
5 |
6 | MultiState Iterative Boltzmann Inversion
7 | ----------------------------------------
8 |
9 | A package to help you manage and run pair potential optimizations using the
10 | multistate iterative Boltzmann inversion procedure.
11 |
12 | Installation
13 | ------------
14 | .. toctree::
15 | installation
16 |
17 | Tutorials
18 | ---------
19 | .. toctree::
20 | tutorials/tutorials
21 |
22 | Citation
23 | --------
24 | Details of the underlying method and its validation can be found here |citation|
25 |
26 | If you use this package please cite the above paper. The BibTeX reference is::
27 |
28 | @article{Moore2014,
29 | author = "Moore, Timothy C. and Iacovella, Christopher R. and McCabe, Clare",
30 | title = "Derivation of coarse-grained potentials via multistate iterative Boltzmann inversion",
31 | journal = "The Journal of Chemical Physics",
32 | year = "2014",
33 | volume = "140",
34 | number = "22",
35 | doi = "http://dx.doi.org/10.1063/1.4880555"
36 | }
37 |
38 | API Reference
39 | -------------
40 | .. toctree::
41 | msibi
42 | msibi.utils
43 |
44 | Indices and tables
45 | ==================
46 |
47 | * :ref:`genindex`
48 | * :ref:`modindex`
49 | * :ref:`search`
50 |
51 | .. |citation| image:: https://img.shields.io/badge/DOI-10.1063%2F1.4880555-blue.svg
52 | :target: http://dx.doi.org/10.1063/1.4880555
53 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/installation.txt:
--------------------------------------------------------------------------------
1 | ============
2 | Installation
3 | ============
4 |
5 | Install with pip
6 | ----------------
7 | Coming soon!
8 |
9 | Install from source
10 | -------------------
11 | ::
12 |
13 | $ git clone https://github.com/ctk3b/msibi
14 | $ cd msibi
15 | $ python setup.py install
16 |
17 | Dependencies
18 | ------------
19 | To use mbuild, the following libraries and software will need to be installed.
20 |
21 | Linux, Mac OS X or Windows operating system
22 | We develop mainly on 64-bit OS X Yosemite and Windows 7 machines.
23 | TravisCI is currently only set up to perform testing on Ubuntu 12.04
24 | LTS Server Edition 64 bit
25 |
26 | `Python `_ = 2.7 or 3.3+
27 | TravisCI currently tests on 2.7, 3.3 and 3.4.
28 |
29 | `MDTraj `_ >=1.0.0
30 | MDTraj is a Python library for reading, writing and analyizing
31 | molecular dynamics trajectories. mBuild uses MDTraj as an entry and
32 | exit point for several types of molecule data formats. See their
33 | installation instructions
34 | `here `_.
35 |
36 | To make your life easier, we recommend that you use a pre-packaged Python
37 | distribution like `Continuum's Anaconda `_
38 | in order to get all of the dependencies.
39 |
40 | Testing your installation
41 | -------------------------
42 |
43 | mBuild uses `py.test` for unit testing. To run them simply type run the
44 | following while in the base directory::
45 |
46 | $ pip install pytest
47 | $ py.test
48 |
49 | We need a LOT more tests so any help here is especially welcome!
50 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/modules.txt:
--------------------------------------------------------------------------------
1 | msibi
2 | =====
3 |
4 | .. toctree::
5 | :maxdepth: 4
6 |
7 | msibi
8 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/msibi.txt:
--------------------------------------------------------------------------------
1 | msibi package
2 | =============
3 |
4 | Subpackages
5 | -----------
6 |
7 | .. toctree::
8 |
9 | msibi.utils
10 |
11 | Submodules
12 | ----------
13 |
14 | msibi.optimize module
15 | ---------------------
16 |
17 | .. automodule:: msibi.optimize
18 | :members:
19 | :undoc-members:
20 | :show-inheritance:
21 |
22 | msibi.pair module
23 | -----------------
24 |
25 | .. automodule:: msibi.pair
26 | :members:
27 | :undoc-members:
28 | :show-inheritance:
29 |
30 | msibi.potentials module
31 | -----------------------
32 |
33 | .. automodule:: msibi.potentials
34 | :members:
35 | :undoc-members:
36 | :show-inheritance:
37 |
38 | msibi.state module
39 | ------------------
40 |
41 | .. automodule:: msibi.state
42 | :members:
43 | :undoc-members:
44 | :show-inheritance:
45 |
46 | msibi.workers module
47 | --------------------
48 |
49 | .. automodule:: msibi.workers
50 | :members:
51 | :undoc-members:
52 | :show-inheritance:
53 |
54 |
55 | Module contents
56 | ---------------
57 |
58 | .. automodule:: msibi
59 | :members:
60 | :undoc-members:
61 | :show-inheritance:
62 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/msibi.utils.txt:
--------------------------------------------------------------------------------
1 | msibi.utils package
2 | ===================
3 |
4 | Submodules
5 | ----------
6 |
7 | msibi.utils.error_calculation module
8 | ------------------------------------
9 |
10 | .. automodule:: msibi.utils.error_calculation
11 | :members:
12 | :undoc-members:
13 | :show-inheritance:
14 |
15 | msibi.utils.exceptions module
16 | -----------------------------
17 |
18 | .. automodule:: msibi.utils.exceptions
19 | :members:
20 | :undoc-members:
21 | :show-inheritance:
22 |
23 | msibi.utils.general module
24 | --------------------------
25 |
26 | .. automodule:: msibi.utils.general
27 | :members:
28 | :undoc-members:
29 | :show-inheritance:
30 |
31 |
32 | Module contents
33 | ---------------
34 |
35 | .. automodule:: msibi.utils
36 | :members:
37 | :undoc-members:
38 | :show-inheritance:
39 |
--------------------------------------------------------------------------------
/docs/_build/html/_sources/tutorials/tutorials.txt:
--------------------------------------------------------------------------------
1 | Tutorials
2 | ---------
3 | Coming soon!
4 |
--------------------------------------------------------------------------------
/docs/_build/html/_static/ajax-loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/html/_static/ajax-loader.gif
--------------------------------------------------------------------------------
/docs/_build/html/_static/comment-bright.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/html/_static/comment-bright.png
--------------------------------------------------------------------------------
/docs/_build/html/_static/comment-close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/html/_static/comment-close.png
--------------------------------------------------------------------------------
/docs/_build/html/_static/comment.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/html/_static/comment.png
--------------------------------------------------------------------------------
/docs/_build/html/_static/css/badge_only.css:
--------------------------------------------------------------------------------
1 | .fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../font/fontawesome_webfont.eot");src:url("../font/fontawesome_webfont.eot?#iefix") format("embedded-opentype"),url("../font/fontawesome_webfont.woff") format("woff"),url("../font/fontawesome_webfont.ttf") format("truetype"),url("../font/fontawesome_webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:0.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;border-top:solid 10px #343131;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}img{width:100%;height:auto}}
2 | /*# sourceMappingURL=badge_only.css.map */
3 |
--------------------------------------------------------------------------------
/docs/_build/html/_static/default.css:
--------------------------------------------------------------------------------
1 | /*
2 | * default.css_t
3 | * ~~~~~~~~~~~~~
4 | *
5 | * Sphinx stylesheet -- default theme.
6 | *
7 | * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
8 | * :license: BSD, see LICENSE for details.
9 | *
10 | */
11 |
12 | @import url("basic.css");
13 |
14 | /* -- page layout ----------------------------------------------------------- */
15 |
16 | body {
17 | font-family: sans-serif;
18 | font-size: 100%;
19 | background-color: #11303d;
20 | color: #000;
21 | margin: 0;
22 | padding: 0;
23 | }
24 |
25 | div.document {
26 | background-color: #1c4e63;
27 | }
28 |
29 | div.documentwrapper {
30 | float: left;
31 | width: 100%;
32 | }
33 |
34 | div.bodywrapper {
35 | margin: 0 0 0 230px;
36 | }
37 |
38 | div.body {
39 | background-color: #ffffff;
40 | color: #000000;
41 | padding: 0 20px 30px 20px;
42 | }
43 |
44 | div.footer {
45 | color: #ffffff;
46 | width: 100%;
47 | padding: 9px 0 9px 0;
48 | text-align: center;
49 | font-size: 75%;
50 | }
51 |
52 | div.footer a {
53 | color: #ffffff;
54 | text-decoration: underline;
55 | }
56 |
57 | div.related {
58 | background-color: #133f52;
59 | line-height: 30px;
60 | color: #ffffff;
61 | }
62 |
63 | div.related a {
64 | color: #ffffff;
65 | }
66 |
67 | div.sphinxsidebar {
68 | }
69 |
70 | div.sphinxsidebar h3 {
71 | font-family: 'Trebuchet MS', sans-serif;
72 | color: #ffffff;
73 | font-size: 1.4em;
74 | font-weight: normal;
75 | margin: 0;
76 | padding: 0;
77 | }
78 |
79 | div.sphinxsidebar h3 a {
80 | color: #ffffff;
81 | }
82 |
83 | div.sphinxsidebar h4 {
84 | font-family: 'Trebuchet MS', sans-serif;
85 | color: #ffffff;
86 | font-size: 1.3em;
87 | font-weight: normal;
88 | margin: 5px 0 0 0;
89 | padding: 0;
90 | }
91 |
92 | div.sphinxsidebar p {
93 | color: #ffffff;
94 | }
95 |
96 | div.sphinxsidebar p.topless {
97 | margin: 5px 10px 10px 10px;
98 | }
99 |
100 | div.sphinxsidebar ul {
101 | margin: 10px;
102 | padding: 0;
103 | color: #ffffff;
104 | }
105 |
106 | div.sphinxsidebar a {
107 | color: #98dbcc;
108 | }
109 |
110 | div.sphinxsidebar input {
111 | border: 1px solid #98dbcc;
112 | font-family: sans-serif;
113 | font-size: 1em;
114 | }
115 |
116 |
117 |
118 | /* -- hyperlink styles ------------------------------------------------------ */
119 |
120 | a {
121 | color: #355f7c;
122 | text-decoration: none;
123 | }
124 |
125 | a:visited {
126 | color: #355f7c;
127 | text-decoration: none;
128 | }
129 |
130 | a:hover {
131 | text-decoration: underline;
132 | }
133 |
134 |
135 |
136 | /* -- body styles ----------------------------------------------------------- */
137 |
138 | div.body h1,
139 | div.body h2,
140 | div.body h3,
141 | div.body h4,
142 | div.body h5,
143 | div.body h6 {
144 | font-family: 'Trebuchet MS', sans-serif;
145 | background-color: #f2f2f2;
146 | font-weight: normal;
147 | color: #20435c;
148 | border-bottom: 1px solid #ccc;
149 | margin: 20px -20px 10px -20px;
150 | padding: 3px 0 3px 10px;
151 | }
152 |
153 | div.body h1 { margin-top: 0; font-size: 200%; }
154 | div.body h2 { font-size: 160%; }
155 | div.body h3 { font-size: 140%; }
156 | div.body h4 { font-size: 120%; }
157 | div.body h5 { font-size: 110%; }
158 | div.body h6 { font-size: 100%; }
159 |
160 | a.headerlink {
161 | color: #c60f0f;
162 | font-size: 0.8em;
163 | padding: 0 4px 0 4px;
164 | text-decoration: none;
165 | }
166 |
167 | a.headerlink:hover {
168 | background-color: #c60f0f;
169 | color: white;
170 | }
171 |
172 | div.body p, div.body dd, div.body li {
173 | text-align: justify;
174 | line-height: 130%;
175 | }
176 |
177 | div.admonition p.admonition-title + p {
178 | display: inline;
179 | }
180 |
181 | div.admonition p {
182 | margin-bottom: 5px;
183 | }
184 |
185 | div.admonition pre {
186 | margin-bottom: 5px;
187 | }
188 |
189 | div.admonition ul, div.admonition ol {
190 | margin-bottom: 5px;
191 | }
192 |
193 | div.note {
194 | background-color: #eee;
195 | border: 1px solid #ccc;
196 | }
197 |
198 | div.seealso {
199 | background-color: #ffc;
200 | border: 1px solid #ff6;
201 | }
202 |
203 | div.topic {
204 | background-color: #eee;
205 | }
206 |
207 | div.warning {
208 | background-color: #ffe4e4;
209 | border: 1px solid #f66;
210 | }
211 |
212 | p.admonition-title {
213 | display: inline;
214 | }
215 |
216 | p.admonition-title:after {
217 | content: ":";
218 | }
219 |
220 | pre {
221 | padding: 5px;
222 | background-color: #eeffcc;
223 | color: #333333;
224 | line-height: 120%;
225 | border: 1px solid #ac9;
226 | border-left: none;
227 | border-right: none;
228 | }
229 |
230 | tt {
231 | background-color: #ecf0f3;
232 | padding: 0 1px 0 1px;
233 | font-size: 0.95em;
234 | }
235 |
236 | th {
237 | background-color: #ede;
238 | }
239 |
240 | .warning tt {
241 | background: #efc2c2;
242 | }
243 |
244 | .note tt {
245 | background: #d6d6d6;
246 | }
247 |
248 | .viewcode-back {
249 | font-family: sans-serif;
250 | }
251 |
252 | div.viewcode-block:target {
253 | background-color: #f4debf;
254 | border-top: 1px solid #ac9;
255 | border-bottom: 1px solid #ac9;
256 | }
--------------------------------------------------------------------------------
/docs/_build/html/_static/doctools.js:
--------------------------------------------------------------------------------
1 | /*
2 | * doctools.js
3 | * ~~~~~~~~~~~
4 | *
5 | * Sphinx JavaScript utilities for all documentation.
6 | *
7 | * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
8 | * :license: BSD, see LICENSE for details.
9 | *
10 | */
11 |
12 | /**
13 | * select a different prefix for underscore
14 | */
15 | $u = _.noConflict();
16 |
17 | /**
18 | * make the code below compatible with browsers without
19 | * an installed firebug like debugger
20 | if (!window.console || !console.firebug) {
21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
23 | "profile", "profileEnd"];
24 | window.console = {};
25 | for (var i = 0; i < names.length; ++i)
26 | window.console[names[i]] = function() {};
27 | }
28 | */
29 |
30 | /**
31 | * small helper function to urldecode strings
32 | */
33 | jQuery.urldecode = function(x) {
34 | return decodeURIComponent(x).replace(/\+/g, ' ');
35 | };
36 |
37 | /**
38 | * small helper function to urlencode strings
39 | */
40 | jQuery.urlencode = encodeURIComponent;
41 |
42 | /**
43 | * This function returns the parsed url parameters of the
44 | * current request. Multiple values per key are supported,
45 | * it will always return arrays of strings for the value parts.
46 | */
47 | jQuery.getQueryParameters = function(s) {
48 | if (typeof s == 'undefined')
49 | s = document.location.search;
50 | var parts = s.substr(s.indexOf('?') + 1).split('&');
51 | var result = {};
52 | for (var i = 0; i < parts.length; i++) {
53 | var tmp = parts[i].split('=', 2);
54 | var key = jQuery.urldecode(tmp[0]);
55 | var value = jQuery.urldecode(tmp[1]);
56 | if (key in result)
57 | result[key].push(value);
58 | else
59 | result[key] = [value];
60 | }
61 | return result;
62 | };
63 |
64 | /**
65 | * highlight a given string on a jquery object by wrapping it in
66 | * span elements with the given class name.
67 | */
68 | jQuery.fn.highlightText = function(text, className) {
69 | function highlight(node) {
70 | if (node.nodeType == 3) {
71 | var val = node.nodeValue;
72 | var pos = val.toLowerCase().indexOf(text);
73 | if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
74 | var span = document.createElement("span");
75 | span.className = className;
76 | span.appendChild(document.createTextNode(val.substr(pos, text.length)));
77 | node.parentNode.insertBefore(span, node.parentNode.insertBefore(
78 | document.createTextNode(val.substr(pos + text.length)),
79 | node.nextSibling));
80 | node.nodeValue = val.substr(0, pos);
81 | }
82 | }
83 | else if (!jQuery(node).is("button, select, textarea")) {
84 | jQuery.each(node.childNodes, function() {
85 | highlight(this);
86 | });
87 | }
88 | }
89 | return this.each(function() {
90 | highlight(this);
91 | });
92 | };
93 |
94 | /**
95 | * Small JavaScript module for the documentation.
96 | */
97 | var Documentation = {
98 |
99 | init : function() {
100 | this.fixFirefoxAnchorBug();
101 | this.highlightSearchWords();
102 | this.initIndexTable();
103 | },
104 |
105 | /**
106 | * i18n support
107 | */
108 | TRANSLATIONS : {},
109 | PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; },
110 | LOCALE : 'unknown',
111 |
112 | // gettext and ngettext don't access this so that the functions
113 | // can safely bound to a different name (_ = Documentation.gettext)
114 | gettext : function(string) {
115 | var translated = Documentation.TRANSLATIONS[string];
116 | if (typeof translated == 'undefined')
117 | return string;
118 | return (typeof translated == 'string') ? translated : translated[0];
119 | },
120 |
121 | ngettext : function(singular, plural, n) {
122 | var translated = Documentation.TRANSLATIONS[singular];
123 | if (typeof translated == 'undefined')
124 | return (n == 1) ? singular : plural;
125 | return translated[Documentation.PLURALEXPR(n)];
126 | },
127 |
128 | addTranslations : function(catalog) {
129 | for (var key in catalog.messages)
130 | this.TRANSLATIONS[key] = catalog.messages[key];
131 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
132 | this.LOCALE = catalog.locale;
133 | },
134 |
135 | /**
136 | * add context elements like header anchor links
137 | */
138 | addContextElements : function() {
139 | $('div[id] > :header:first').each(function() {
140 | $('').
141 | attr('href', '#' + this.id).
142 | attr('title', _('Permalink to this headline')).
143 | appendTo(this);
144 | });
145 | $('dt[id]').each(function() {
146 | $('').
147 | attr('href', '#' + this.id).
148 | attr('title', _('Permalink to this definition')).
149 | appendTo(this);
150 | });
151 | },
152 |
153 | /**
154 | * workaround a firefox stupidity
155 | */
156 | fixFirefoxAnchorBug : function() {
157 | if (document.location.hash && $.browser.mozilla)
158 | window.setTimeout(function() {
159 | document.location.href += '';
160 | }, 10);
161 | },
162 |
163 | /**
164 | * highlight the search words provided in the url in the text
165 | */
166 | highlightSearchWords : function() {
167 | var params = $.getQueryParameters();
168 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
169 | if (terms.length) {
170 | var body = $('div.body');
171 | if (!body.length) {
172 | body = $('body');
173 | }
174 | window.setTimeout(function() {
175 | $.each(terms, function() {
176 | body.highlightText(this.toLowerCase(), 'highlighted');
177 | });
178 | }, 10);
179 | $('' + _('Hide Search Matches') + '
')
181 | .appendTo($('#searchbox'));
182 | }
183 | },
184 |
185 | /**
186 | * init the domain index toggle buttons
187 | */
188 | initIndexTable : function() {
189 | var togglers = $('img.toggler').click(function() {
190 | var src = $(this).attr('src');
191 | var idnum = $(this).attr('id').substr(7);
192 | $('tr.cg-' + idnum).toggle();
193 | if (src.substr(-9) == 'minus.png')
194 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
195 | else
196 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
197 | }).css('display', '');
198 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
199 | togglers.click();
200 | }
201 | },
202 |
203 | /**
204 | * helper function to hide the search marks again
205 | */
206 | hideSearchWords : function() {
207 | $('#searchbox .highlight-link').fadeOut(300);
208 | $('span.highlighted').removeClass('highlighted');
209 | },
210 |
211 | /**
212 | * make the url absolute
213 | */
214 | makeURL : function(relativeURL) {
215 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
216 | },
217 |
218 | /**
219 | * get the current relative url
220 | */
221 | getCurrentURL : function() {
222 | var path = document.location.pathname;
223 | var parts = path.split(/\//);
224 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
225 | if (this == '..')
226 | parts.pop();
227 | });
228 | var url = parts.join('/');
229 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
230 | }
231 | };
232 |
233 | // quick alias for translations
234 | _ = Documentation.gettext;
235 |
236 | $(document).ready(function() {
237 | Documentation.init();
238 | });
239 |
--------------------------------------------------------------------------------
/docs/_build/html/_static/down-pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/html/_static/down-pressed.png
--------------------------------------------------------------------------------
/docs/_build/html/_static/down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/html/_static/down.png
--------------------------------------------------------------------------------
/docs/_build/html/_static/file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/html/_static/file.png
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/html/_static/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/html/_static/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/docs/_build/html/_static/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/html/_static/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/docs/_build/html/_static/js/theme.js:
--------------------------------------------------------------------------------
1 | $( document ).ready(function() {
2 | // Shift nav in mobile when clicking the menu.
3 | $(document).on('click', "[data-toggle='wy-nav-top']", function() {
4 | $("[data-toggle='wy-nav-shift']").toggleClass("shift");
5 | $("[data-toggle='rst-versions']").toggleClass("shift");
6 | });
7 | // Close menu when you click a link.
8 | $(document).on('click', ".wy-menu-vertical .current ul li a", function() {
9 | $("[data-toggle='wy-nav-shift']").removeClass("shift");
10 | $("[data-toggle='rst-versions']").toggleClass("shift");
11 | });
12 | $(document).on('click', "[data-toggle='rst-current-version']", function() {
13 | $("[data-toggle='rst-versions']").toggleClass("shift-up");
14 | });
15 | // Make tables responsive
16 | $("table.docutils:not(.field-list)").wrap("
");
17 | });
18 |
19 | window.SphinxRtdTheme = (function (jquery) {
20 | var stickyNav = (function () {
21 | var navBar,
22 | win,
23 | stickyNavCssClass = 'stickynav',
24 | applyStickNav = function () {
25 | if (navBar.height() <= win.height()) {
26 | navBar.addClass(stickyNavCssClass);
27 | } else {
28 | navBar.removeClass(stickyNavCssClass);
29 | }
30 | },
31 | enable = function () {
32 | applyStickNav();
33 | win.on('resize', applyStickNav);
34 | },
35 | init = function () {
36 | navBar = jquery('nav.wy-nav-side:first');
37 | win = jquery(window);
38 | };
39 | jquery(init);
40 | return {
41 | enable : enable
42 | };
43 | }());
44 | return {
45 | StickyNav : stickyNav
46 | };
47 | }($));
48 |
--------------------------------------------------------------------------------
/docs/_build/html/_static/minus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/html/_static/minus.png
--------------------------------------------------------------------------------
/docs/_build/html/_static/plus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/html/_static/plus.png
--------------------------------------------------------------------------------
/docs/_build/html/_static/pygments.css:
--------------------------------------------------------------------------------
1 | .highlight .hll { background-color: #ffffcc }
2 | .highlight { background: #eeffcc; }
3 | .highlight .c { color: #408090; font-style: italic } /* Comment */
4 | .highlight .err { border: 1px solid #FF0000 } /* Error */
5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */
6 | .highlight .o { color: #666666 } /* Operator */
7 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
8 | .highlight .cp { color: #007020 } /* Comment.Preproc */
9 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
10 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
11 | .highlight .gd { color: #A00000 } /* Generic.Deleted */
12 | .highlight .ge { font-style: italic } /* Generic.Emph */
13 | .highlight .gr { color: #FF0000 } /* Generic.Error */
14 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
15 | .highlight .gi { color: #00A000 } /* Generic.Inserted */
16 | .highlight .go { color: #333333 } /* Generic.Output */
17 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
18 | .highlight .gs { font-weight: bold } /* Generic.Strong */
19 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
20 | .highlight .gt { color: #0044DD } /* Generic.Traceback */
21 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
22 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
23 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
24 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */
25 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
26 | .highlight .kt { color: #902000 } /* Keyword.Type */
27 | .highlight .m { color: #208050 } /* Literal.Number */
28 | .highlight .s { color: #4070a0 } /* Literal.String */
29 | .highlight .na { color: #4070a0 } /* Name.Attribute */
30 | .highlight .nb { color: #007020 } /* Name.Builtin */
31 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
32 | .highlight .no { color: #60add5 } /* Name.Constant */
33 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
34 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
35 | .highlight .ne { color: #007020 } /* Name.Exception */
36 | .highlight .nf { color: #06287e } /* Name.Function */
37 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
38 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
39 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
40 | .highlight .nv { color: #bb60d5 } /* Name.Variable */
41 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
42 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */
43 | .highlight .mf { color: #208050 } /* Literal.Number.Float */
44 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */
45 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */
46 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */
47 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
48 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */
49 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
50 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */
51 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
52 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
53 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
54 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */
55 | .highlight .sr { color: #235388 } /* Literal.String.Regex */
56 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */
57 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */
58 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
59 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
60 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
61 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
62 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */
--------------------------------------------------------------------------------
/docs/_build/html/_static/sidebar.js:
--------------------------------------------------------------------------------
1 | /*
2 | * sidebar.js
3 | * ~~~~~~~~~~
4 | *
5 | * This script makes the Sphinx sidebar collapsible.
6 | *
7 | * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds
8 | * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton
9 | * used to collapse and expand the sidebar.
10 | *
11 | * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden
12 | * and the width of the sidebar and the margin-left of the document
13 | * are decreased. When the sidebar is expanded the opposite happens.
14 | * This script saves a per-browser/per-session cookie used to
15 | * remember the position of the sidebar among the pages.
16 | * Once the browser is closed the cookie is deleted and the position
17 | * reset to the default (expanded).
18 | *
19 | * :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
20 | * :license: BSD, see LICENSE for details.
21 | *
22 | */
23 |
24 | $(function() {
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | // global elements used by the functions.
34 | // the 'sidebarbutton' element is defined as global after its
35 | // creation, in the add_sidebar_button function
36 | var bodywrapper = $('.bodywrapper');
37 | var sidebar = $('.sphinxsidebar');
38 | var sidebarwrapper = $('.sphinxsidebarwrapper');
39 |
40 | // for some reason, the document has no sidebar; do not run into errors
41 | if (!sidebar.length) return;
42 |
43 | // original margin-left of the bodywrapper and width of the sidebar
44 | // with the sidebar expanded
45 | var bw_margin_expanded = bodywrapper.css('margin-left');
46 | var ssb_width_expanded = sidebar.width();
47 |
48 | // margin-left of the bodywrapper and width of the sidebar
49 | // with the sidebar collapsed
50 | var bw_margin_collapsed = '.8em';
51 | var ssb_width_collapsed = '.8em';
52 |
53 | // colors used by the current theme
54 | var dark_color = $('.related').css('background-color');
55 | var light_color = $('.document').css('background-color');
56 |
57 | function sidebar_is_collapsed() {
58 | return sidebarwrapper.is(':not(:visible)');
59 | }
60 |
61 | function toggle_sidebar() {
62 | if (sidebar_is_collapsed())
63 | expand_sidebar();
64 | else
65 | collapse_sidebar();
66 | }
67 |
68 | function collapse_sidebar() {
69 | sidebarwrapper.hide();
70 | sidebar.css('width', ssb_width_collapsed);
71 | bodywrapper.css('margin-left', bw_margin_collapsed);
72 | sidebarbutton.css({
73 | 'margin-left': '0',
74 | 'height': bodywrapper.height()
75 | });
76 | sidebarbutton.find('span').text('»');
77 | sidebarbutton.attr('title', _('Expand sidebar'));
78 | document.cookie = 'sidebar=collapsed';
79 | }
80 |
81 | function expand_sidebar() {
82 | bodywrapper.css('margin-left', bw_margin_expanded);
83 | sidebar.css('width', ssb_width_expanded);
84 | sidebarwrapper.show();
85 | sidebarbutton.css({
86 | 'margin-left': ssb_width_expanded-12,
87 | 'height': bodywrapper.height()
88 | });
89 | sidebarbutton.find('span').text('«');
90 | sidebarbutton.attr('title', _('Collapse sidebar'));
91 | document.cookie = 'sidebar=expanded';
92 | }
93 |
94 | function add_sidebar_button() {
95 | sidebarwrapper.css({
96 | 'float': 'left',
97 | 'margin-right': '0',
98 | 'width': ssb_width_expanded - 28
99 | });
100 | // create the button
101 | sidebar.append(
102 | ''
103 | );
104 | var sidebarbutton = $('#sidebarbutton');
105 | light_color = sidebarbutton.css('background-color');
106 | // find the height of the viewport to center the '<<' in the page
107 | var viewport_height;
108 | if (window.innerHeight)
109 | viewport_height = window.innerHeight;
110 | else
111 | viewport_height = $(window).height();
112 | sidebarbutton.find('span').css({
113 | 'display': 'block',
114 | 'margin-top': (viewport_height - sidebar.position().top - 20) / 2
115 | });
116 |
117 | sidebarbutton.click(toggle_sidebar);
118 | sidebarbutton.attr('title', _('Collapse sidebar'));
119 | sidebarbutton.css({
120 | 'color': '#FFFFFF',
121 | 'border-left': '1px solid ' + dark_color,
122 | 'font-size': '1.2em',
123 | 'cursor': 'pointer',
124 | 'height': bodywrapper.height(),
125 | 'padding-top': '1px',
126 | 'margin-left': ssb_width_expanded - 12
127 | });
128 |
129 | sidebarbutton.hover(
130 | function () {
131 | $(this).css('background-color', dark_color);
132 | },
133 | function () {
134 | $(this).css('background-color', light_color);
135 | }
136 | );
137 | }
138 |
139 | function set_position_from_cookie() {
140 | if (!document.cookie)
141 | return;
142 | var items = document.cookie.split(';');
143 | for(var k=0; k
4 |
5 |
6 |
7 |
8 |
9 |
10 | Index — msibi 0.1 documentation
11 |
12 |
13 |
14 |
15 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
Index
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
76 |
77 |
78 |
87 |
91 |
92 |
--------------------------------------------------------------------------------
/docs/_build/html/installation.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Installation — msibi 0.1 documentation
10 |
11 |
12 |
13 |
14 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
Installation
46 |
47 |
Install with pip
48 |
Coming soon!
49 |
50 |
51 |
Install from source
52 |
$ git clone https://github.com/ctk3b/msibi
53 | $ cd msibi
54 | $ python setup.py install
55 |
56 |
57 |
58 |
59 |
Dependencies
60 |
To use mbuild, the following libraries and software will need to be installed.
61 |
62 |
63 | Linux, Mac OS X or Windows operating system
64 | We develop mainly on 64-bit OS X Yosemite and Windows 7 machines.
65 | TravisCI is currently only set up to perform testing on Ubuntu 12.04
66 | LTS Server Edition 64 bit
67 | Python = 2.7 or 3.3+
68 | TravisCI currently tests on 2.7, 3.3 and 3.4.
69 | MDTraj >=1.0.0
70 | MDTraj is a Python library for reading, writing and analyizing
71 | molecular dynamics trajectories. mBuild uses MDTraj as an entry and
72 | exit point for several types of molecule data formats. See their
73 | installation instructions
74 | here .
75 |
76 |
77 |
To make your life easier, we recommend that you use a pre-packaged Python
78 | distribution like Continuum’s Anaconda
79 | in order to get all of the dependencies.
80 |
81 |
82 |
Testing your installation
83 |
mBuild uses py.test for unit testing. To run them simply type run the
84 | following while in the base directory:
85 |
$ pip install pytest
86 | $ py.test
87 |
88 |
89 |
We need a LOT more tests so any help here is especially welcome!
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
130 |
131 |
132 |
141 |
145 |
146 |
--------------------------------------------------------------------------------
/docs/_build/html/modules.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | msibi — msibi 0.1 documentation
10 |
11 |
12 |
13 |
14 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
38 |
39 |
101 |
110 |
114 |
115 |
--------------------------------------------------------------------------------
/docs/_build/html/msibi.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | msibi package — msibi 0.1 documentation
10 |
11 |
12 |
13 |
14 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
msibi package
46 |
47 |
Subpackages
48 |
60 |
61 |
62 |
Submodules
63 |
64 |
65 |
msibi.optimize module
66 |
67 |
68 |
msibi.pair module
69 |
70 |
71 |
msibi.potentials module
72 |
73 |
74 |
msibi.state module
75 |
76 |
77 |
msibi.workers module
78 |
79 |
80 |
Module contents
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
125 |
126 |
127 |
136 |
140 |
141 |
--------------------------------------------------------------------------------
/docs/_build/html/msibi.utils.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | msibi.utils package — msibi 0.1 documentation
10 |
11 |
12 |
13 |
14 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
msibi.utils package
46 |
47 |
Submodules
48 |
49 |
50 |
msibi.utils.error_calculation module
51 |
52 |
53 |
msibi.utils.exceptions module
54 |
55 |
56 |
msibi.utils.general module
57 |
58 |
59 |
Module contents
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
101 |
102 |
103 |
112 |
116 |
117 |
--------------------------------------------------------------------------------
/docs/_build/html/objects.inv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/docs/_build/html/objects.inv
--------------------------------------------------------------------------------
/docs/_build/html/search.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Search — msibi 0.1 documentation
10 |
11 |
12 |
13 |
14 |
23 |
24 |
25 |
26 |
27 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
Search
53 |
54 |
55 |
56 | Please activate JavaScript to enable the search
57 | functionality.
58 |
59 |
60 |
61 | From here you can search these documents. Enter your search
62 | words into the box below and click "search". Note that the search
63 | function will automatically search for all of the words. Pages
64 | containing fewer words won't appear in the result list.
65 |
66 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
83 |
84 |
85 |
94 |
98 |
99 |
--------------------------------------------------------------------------------
/docs/_build/html/searchindex.js:
--------------------------------------------------------------------------------
1 | Search.setIndex({envversion:42,terms:{all:1,help:[0,1],show:[],queri:[],soon:[1,6],radiu:[],shape:[],paper:0,follow:1,mainli:1,find:[],dynam:1,row:[],yosemit:1,onli:1,depend:[],point:1,except:[],articl:0,window:1,pytest:1,dtype:[],exit:1,save:[],easier:1,them:1,sourc:[],everi:[],format:1,read:1,molecul:1,initi:[],submodul:[],util:[],temperatur:[],volum:0,compute_current_rdf:[],bit:1,associ:[],continuum:1,tail:[],like:1,edit:1,pot_cutoff:[],n_pair:[],list:[],traj:[],separ:[],bool:[],traj_fil:[],each:[],usabl:[],found:0,pot_r:[],page:[4,0],underli:0,upper:[],set:1,specifi:[],analy:1,runscript:[],back:[],procedur:0,status_filenam:[],n_bin:[],see:1,year:0,server:1,todo:[],librari:1,deriv:0,index:[4,0],scale:[],space:[],mbuild:1,"while":1,calc_similar:[],content:[],state:[],moor:0,moore2014:0,chemic:0,method:0,fals:[],machin:1,r_rang:[],full:[],run:[0,1],linear:[],mdtraj:1,whose:[],numer:[],journal:0,hoomd_run_templ:[],here:[0,1],base:1,find_nearest:[],ubuntu:1,path:[],come:[1,6],valu:[],n_iter:[],search:[4,0],iacovella:0,add_stat:[],current:1,simul:[],rdf:[],grain:0,coars:0,gener:[],unsupportedengin:[],com:1,run_query_simul:[],oper:1,pleas:0,via:0,simpli:1,backup:[],christoph:0,clare:0,appli:[],arrai:[],"float":[],number:0,evolut:[],filenam:[],instruct:1,linux:1,constant:[],n_point:[],msibi:[],your:[],unit:1,manag:0,plot:[],git:1,from:[],log:[],script:[],update_potenti:[],mors:[],interact:[],softwar:1,alpha:[],system:1,name:[],compon:[],timothi:0,alpha_form:[],lot:1,recommend:1,save_runscript:[],trajectori:1,molecular:1,type:1,cite:0,more:1,save_current_rdf:[],life:1,table_width:[],option:[],especi:1,save_table_potenti:[],factor:[],worker:[],weight:[],part:[],error_calcul:[],func:[],atom:[],"true":[],hoomd:[],none:[],input:[],"default":[],setup:1,potentials_dir:[],calcul:[],ctk3b:1,can:0,str:[],modul:[],clone:1,pre:1,r_switch:[],comput:[],abov:0,creat:[],give:[],"int":[],anaconda:1,doi:0,ani:1,top_fil:[],repres:[],packag:[],file:[],pip:[],backup_fil:[],f_fit:[],type1:[],sever:1,type2:[],rdf_cutoff:[],develop:1,welcom:[],author:0,perform:1,titl:0,make:1,get:1,mie:[],detail:0,data:1,write:1,python:1,need:1,valid:0,sig:[],state_dir:[],which:[],test:[],you:[0,1],out:[],target:[],singl:[],arr2:[],pair_indic:[],http:[0,1],arr1:[],closest:[],table_potenti:[],optim:[],kelvin:[],org:0,after:[],correct:[],ndarrai:[],mac:1,two:[],distribut:1,thi:0,pair:[],engin:[],cutoff:[],"class":[],physic:0,subpackag:[],target_rdf:[],github:1,orchestr:[],directori:1,entri:1,backup_trajectori:[],object:[],working_dir:[],mccabe:0,travisci:1,bibtex:0,reload_query_trajectori:[],potenti:[],add:[],order:1},objtypes:{},objnames:{},filenames:["index","installation","modules","msibi.utils","index2","msibi","tutorials/tutorials"],titles:["MultiState Iterative Boltzmann Inversion","Installation","msibi","msibi.utils package","Welcome to msibi’s documentation!","msibi package","Tutorials"],objects:{},titleterms:{citat:0,modul:[3,5],submodul:[3,5],indic:[4,0],except:3,packag:[3,5],api:0,tabl:[4,0],pip:1,instal:[0,1],msibi:[4,3,5,2],your:1,from:1,welcom:4,invers:0,content:[3,5],state:5,test:1,document:4,refer:0,sourc:1,optim:5,gener:3,worker:5,util:3,boltzmann:0,error_calcul:3,pair:5,depend:1,subpackag:5,multist:0,iter:0,tutori:[0,6],potenti:5}})
--------------------------------------------------------------------------------
/docs/_build/html/tutorials/tutorials.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Tutorials — msibi 0.1 documentation
10 |
11 |
12 |
13 |
14 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
Tutorials
46 |
Coming soon!
47 |
48 |
49 |
50 |
51 |
52 |
53 |
75 |
76 |
77 |
86 |
90 |
91 |
--------------------------------------------------------------------------------
/docs/index.rst:
--------------------------------------------------------------------------------
1 | .. Multistate Iterative Boltzmann Inversion documentation master file, created by
2 | sphinx-quickstart on Mon Mar 30 14:37:56 2015.
3 | You can adapt this file completely to your liking, but it should at least
4 | contain the root `toctree` directive.
5 |
6 | MultiState Iterative Boltzmann Inversion
7 | ----------------------------------------
8 |
9 | A package to help you manage and run pair potential optimizations using the
10 | multistate iterative Boltzmann inversion procedure.
11 |
12 | Installation
13 | ------------
14 | .. toctree::
15 | installation
16 |
17 | Tutorials
18 | ---------
19 | .. toctree::
20 | tutorials/tutorials
21 |
22 | Citation
23 | --------
24 | Details of the underlying method and its validation can be found here |citation|
25 |
26 | If you use this package please cite the above paper. The BibTeX reference is::
27 |
28 | @article{Moore2014,
29 | author = "Moore, Timothy C. and Iacovella, Christopher R. and McCabe, Clare",
30 | title = "Derivation of coarse-grained potentials via multistate iterative Boltzmann inversion",
31 | journal = "The Journal of Chemical Physics",
32 | year = "2014",
33 | volume = "140",
34 | number = "22",
35 | doi = "http://dx.doi.org/10.1063/1.4880555"
36 | }
37 |
38 | API Reference
39 | -------------
40 | .. toctree::
41 | msibi
42 | msibi.utils
43 |
44 | Indices and tables
45 | ==================
46 |
47 | * :ref:`genindex`
48 | * :ref:`modindex`
49 | * :ref:`search`
50 |
51 | .. |citation| image:: https://img.shields.io/badge/DOI-10.1063%2F1.4880555-blue.svg
52 | :target: http://dx.doi.org/10.1063/1.4880555
53 |
--------------------------------------------------------------------------------
/docs/installation.rst:
--------------------------------------------------------------------------------
1 | ============
2 | Installation
3 | ============
4 |
5 | Install with pip
6 | ----------------
7 | Coming soon!
8 |
9 | Install from source
10 | -------------------
11 | ::
12 |
13 | $ git clone https://github.com/ctk3b/msibi
14 | $ cd msibi
15 | $ python setup.py install
16 |
17 | Dependencies
18 | ------------
19 | To use mbuild, the following libraries and software will need to be installed.
20 |
21 | Linux, Mac OS X or Windows operating system
22 | We develop mainly on 64-bit OS X Yosemite and Windows 7 machines.
23 | TravisCI is currently only set up to perform testing on Ubuntu 12.04
24 | LTS Server Edition 64 bit
25 |
26 | `Python `_ = 2.7 or 3.3+
27 | TravisCI currently tests on 2.7, 3.3 and 3.4.
28 |
29 | `MDTraj `_ >=1.0.0
30 | MDTraj is a Python library for reading, writing and analyizing
31 | molecular dynamics trajectories. mBuild uses MDTraj as an entry and
32 | exit point for several types of molecule data formats. See their
33 | installation instructions
34 | `here `_.
35 |
36 | To make your life easier, we recommend that you use a pre-packaged Python
37 | distribution like `Continuum's Anaconda `_
38 | in order to get all of the dependencies.
39 |
40 | Testing your installation
41 | -------------------------
42 |
43 | mBuild uses `py.test` for unit testing. To run them simply type run the
44 | following while in the base directory::
45 |
46 | $ pip install pytest
47 | $ py.test
48 |
49 | We need a LOT more tests so any help here is especially welcome!
50 |
--------------------------------------------------------------------------------
/docs/make.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 |
3 | REM Command file for Sphinx documentation
4 |
5 | if "%SPHINXBUILD%" == "" (
6 | set SPHINXBUILD=sphinx-build
7 | )
8 | set BUILDDIR=_build
9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
10 | set I18NSPHINXOPTS=%SPHINXOPTS% .
11 | if NOT "%PAPER%" == "" (
12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
14 | )
15 |
16 | if "%1" == "" goto help
17 |
18 | if "%1" == "help" (
19 | :help
20 | echo.Please use `make ^` where ^ is one of
21 | echo. html to make standalone HTML files
22 | echo. dirhtml to make HTML files named index.html in directories
23 | echo. singlehtml to make a single large HTML file
24 | echo. pickle to make pickle files
25 | echo. json to make JSON files
26 | echo. htmlhelp to make HTML files and a HTML help project
27 | echo. qthelp to make HTML files and a qthelp project
28 | echo. devhelp to make HTML files and a Devhelp project
29 | echo. epub to make an epub
30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
31 | echo. text to make text files
32 | echo. man to make manual pages
33 | echo. texinfo to make Texinfo files
34 | echo. gettext to make PO message catalogs
35 | echo. changes to make an overview over all changed/added/deprecated items
36 | echo. xml to make Docutils-native XML files
37 | echo. pseudoxml to make pseudoxml-XML files for display purposes
38 | echo. linkcheck to check all external links for integrity
39 | echo. doctest to run all doctests embedded in the documentation if enabled
40 | goto end
41 | )
42 |
43 | if "%1" == "clean" (
44 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
45 | del /q /s %BUILDDIR%\*
46 | goto end
47 | )
48 |
49 |
50 | %SPHINXBUILD% 2> nul
51 | if errorlevel 9009 (
52 | echo.
53 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
54 | echo.installed, then set the SPHINXBUILD environment variable to point
55 | echo.to the full path of the 'sphinx-build' executable. Alternatively you
56 | echo.may add the Sphinx directory to PATH.
57 | echo.
58 | echo.If you don't have Sphinx installed, grab it from
59 | echo.http://sphinx-doc.org/
60 | exit /b 1
61 | )
62 |
63 | if "%1" == "html" (
64 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
65 | if errorlevel 1 exit /b 1
66 | echo.
67 | echo.Build finished. The HTML pages are in %BUILDDIR%/html.
68 | goto end
69 | )
70 |
71 | if "%1" == "dirhtml" (
72 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
73 | if errorlevel 1 exit /b 1
74 | echo.
75 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
76 | goto end
77 | )
78 |
79 | if "%1" == "singlehtml" (
80 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
81 | if errorlevel 1 exit /b 1
82 | echo.
83 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
84 | goto end
85 | )
86 |
87 | if "%1" == "pickle" (
88 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
89 | if errorlevel 1 exit /b 1
90 | echo.
91 | echo.Build finished; now you can process the pickle files.
92 | goto end
93 | )
94 |
95 | if "%1" == "json" (
96 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
97 | if errorlevel 1 exit /b 1
98 | echo.
99 | echo.Build finished; now you can process the JSON files.
100 | goto end
101 | )
102 |
103 | if "%1" == "htmlhelp" (
104 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
105 | if errorlevel 1 exit /b 1
106 | echo.
107 | echo.Build finished; now you can run HTML Help Workshop with the ^
108 | .hhp project file in %BUILDDIR%/htmlhelp.
109 | goto end
110 | )
111 |
112 | if "%1" == "qthelp" (
113 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
114 | if errorlevel 1 exit /b 1
115 | echo.
116 | echo.Build finished; now you can run "qcollectiongenerator" with the ^
117 | .qhcp project file in %BUILDDIR%/qthelp, like this:
118 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\MultistateIterativeBoltzmannInversion.qhcp
119 | echo.To view the help file:
120 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\MultistateIterativeBoltzmannInversion.ghc
121 | goto end
122 | )
123 |
124 | if "%1" == "devhelp" (
125 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
126 | if errorlevel 1 exit /b 1
127 | echo.
128 | echo.Build finished.
129 | goto end
130 | )
131 |
132 | if "%1" == "epub" (
133 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
134 | if errorlevel 1 exit /b 1
135 | echo.
136 | echo.Build finished. The epub file is in %BUILDDIR%/epub.
137 | goto end
138 | )
139 |
140 | if "%1" == "latex" (
141 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
142 | if errorlevel 1 exit /b 1
143 | echo.
144 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
145 | goto end
146 | )
147 |
148 | if "%1" == "latexpdf" (
149 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
150 | cd %BUILDDIR%/latex
151 | make all-pdf
152 | cd %BUILDDIR%/..
153 | echo.
154 | echo.Build finished; the PDF files are in %BUILDDIR%/latex.
155 | goto end
156 | )
157 |
158 | if "%1" == "latexpdfja" (
159 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
160 | cd %BUILDDIR%/latex
161 | make all-pdf-ja
162 | cd %BUILDDIR%/..
163 | echo.
164 | echo.Build finished; the PDF files are in %BUILDDIR%/latex.
165 | goto end
166 | )
167 |
168 | if "%1" == "text" (
169 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
170 | if errorlevel 1 exit /b 1
171 | echo.
172 | echo.Build finished. The text files are in %BUILDDIR%/text.
173 | goto end
174 | )
175 |
176 | if "%1" == "man" (
177 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
178 | if errorlevel 1 exit /b 1
179 | echo.
180 | echo.Build finished. The manual pages are in %BUILDDIR%/man.
181 | goto end
182 | )
183 |
184 | if "%1" == "texinfo" (
185 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
186 | if errorlevel 1 exit /b 1
187 | echo.
188 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
189 | goto end
190 | )
191 |
192 | if "%1" == "gettext" (
193 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
194 | if errorlevel 1 exit /b 1
195 | echo.
196 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
197 | goto end
198 | )
199 |
200 | if "%1" == "changes" (
201 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
202 | if errorlevel 1 exit /b 1
203 | echo.
204 | echo.The overview file is in %BUILDDIR%/changes.
205 | goto end
206 | )
207 |
208 | if "%1" == "linkcheck" (
209 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
210 | if errorlevel 1 exit /b 1
211 | echo.
212 | echo.Link check complete; look for any errors in the above output ^
213 | or in %BUILDDIR%/linkcheck/output.txt.
214 | goto end
215 | )
216 |
217 | if "%1" == "doctest" (
218 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
219 | if errorlevel 1 exit /b 1
220 | echo.
221 | echo.Testing of doctests in the sources finished, look at the ^
222 | results in %BUILDDIR%/doctest/output.txt.
223 | goto end
224 | )
225 |
226 | if "%1" == "xml" (
227 | %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml
228 | if errorlevel 1 exit /b 1
229 | echo.
230 | echo.Build finished. The XML files are in %BUILDDIR%/xml.
231 | goto end
232 | )
233 |
234 | if "%1" == "pseudoxml" (
235 | %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml
236 | if errorlevel 1 exit /b 1
237 | echo.
238 | echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.
239 | goto end
240 | )
241 |
242 | :end
243 |
--------------------------------------------------------------------------------
/docs/modules.rst:
--------------------------------------------------------------------------------
1 | msibi
2 | =====
3 |
4 | .. toctree::
5 | :maxdepth: 4
6 |
7 | msibi
8 |
--------------------------------------------------------------------------------
/docs/msibi.rst:
--------------------------------------------------------------------------------
1 | msibi package
2 | =============
3 |
4 | Subpackages
5 | -----------
6 |
7 | .. toctree::
8 |
9 | msibi.utils
10 |
11 | Submodules
12 | ----------
13 |
14 | msibi.optimize module
15 | ---------------------
16 |
17 | .. automodule:: msibi.optimize
18 | :members:
19 | :undoc-members:
20 | :show-inheritance:
21 |
22 | msibi.pair module
23 | -----------------
24 |
25 | .. automodule:: msibi.pair
26 | :members:
27 | :undoc-members:
28 | :show-inheritance:
29 |
30 | msibi.potentials module
31 | -----------------------
32 |
33 | .. automodule:: msibi.potentials
34 | :members:
35 | :undoc-members:
36 | :show-inheritance:
37 |
38 | msibi.state module
39 | ------------------
40 |
41 | .. automodule:: msibi.state
42 | :members:
43 | :undoc-members:
44 | :show-inheritance:
45 |
46 | msibi.workers module
47 | --------------------
48 |
49 | .. automodule:: msibi.workers
50 | :members:
51 | :undoc-members:
52 | :show-inheritance:
53 |
54 |
55 | Module contents
56 | ---------------
57 |
58 | .. automodule:: msibi
59 | :members:
60 | :undoc-members:
61 | :show-inheritance:
62 |
--------------------------------------------------------------------------------
/docs/msibi.utils.rst:
--------------------------------------------------------------------------------
1 | msibi.utils package
2 | ===================
3 |
4 | Submodules
5 | ----------
6 |
7 | msibi.utils.error_calculation module
8 | ------------------------------------
9 |
10 | .. automodule:: msibi.utils.error_calculation
11 | :members:
12 | :undoc-members:
13 | :show-inheritance:
14 |
15 | msibi.utils.exceptions module
16 | -----------------------------
17 |
18 | .. automodule:: msibi.utils.exceptions
19 | :members:
20 | :undoc-members:
21 | :show-inheritance:
22 |
23 | msibi.utils.general module
24 | --------------------------
25 |
26 | .. automodule:: msibi.utils.general
27 | :members:
28 | :undoc-members:
29 | :show-inheritance:
30 |
31 |
32 | Module contents
33 | ---------------
34 |
35 | .. automodule:: msibi.utils
36 | :members:
37 | :undoc-members:
38 | :show-inheritance:
39 |
--------------------------------------------------------------------------------
/docs/tutorials/tutorials.rst:
--------------------------------------------------------------------------------
1 | Tutorials
2 | ---------
3 | Coming soon!
4 |
--------------------------------------------------------------------------------
/environment.yml:
--------------------------------------------------------------------------------
1 | name: test-environment
2 | channels:
3 | - omnia
4 | - glotzer
5 | - defaults
6 | dependencies:
7 | - numpy
8 | - mdtraj
9 | - hoomd
10 | - pytest >=3.0
11 | - pytest-cov
12 |
--------------------------------------------------------------------------------
/msibi/__init__.py:
--------------------------------------------------------------------------------
1 | from msibi.optimize import MSIBI
2 | from msibi.pair import Pair
3 | from msibi.potentials import *
4 | from msibi.state import State
5 |
6 | __all__ = ['MSIBI', 'Pair', 'State',
7 |
8 | # Potentials.
9 | 'mie', 'morse']
10 |
--------------------------------------------------------------------------------
/msibi/potentials.py:
--------------------------------------------------------------------------------
1 | ##############################################################################
2 | # MSIBI: A package for optimizing coarse-grained force fields using multistate
3 | # iterative Boltzmann inversion.
4 | # Copyright (c) 2017 Vanderbilt University and the Authors
5 | #
6 | # Authors: Christoph Klein, Timothy C. Moore
7 | #
8 | # Permission is hereby granted, free of charge, to any person obtaining a copy
9 | # of this software and associated documentation files, to deal
10 | # in MSIBI without restriction, including without limitation the rights
11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | # # copies of MSIBI, and to permit persons to whom MSIBI is
13 | # furnished to do so, subject to the following conditions:
14 | #
15 | # The above copyright notice and this permission notice shall be included in all
16 | # copies or substantial portions of MSIBI.
17 | #
18 | # MSIBI IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | # OUT OF OR IN CONNECTION WITH MSIBI OR THE USE OR OTHER DEALINGS ALONG WITH
24 | # MSIBI.
25 | #
26 | # You should have received a copy of the MIT license.
27 | # If not, see .
28 | ##############################################################################
29 |
30 | from __future__ import division
31 |
32 | import numpy as np
33 |
34 | from msibi.utils.general import find_nearest
35 |
36 | __all__ = ['mie', 'morse']
37 |
38 |
39 | def mie(r, eps, sig, m=12, n=6):
40 | """Mie pair potential. """
41 | prefactor = (m / (m - n)) * (m / n)**(n / (m - n))
42 | return prefactor * eps * ((sig / r) ** m - (sig / r) ** n)
43 |
44 |
45 | def morse(r, D, alpha, r0):
46 | """Morse pair potential. """
47 | return D * (np.exp(-2 * alpha * (r - r0)) - 2 * np.exp(-alpha * (r - r0)))
48 |
49 |
50 | def tail_correction(r, V, r_switch):
51 | """Apply a tail correction to a potential making it go to zero smoothly.
52 |
53 | Parameters
54 | ----------
55 | r : np.ndarray, shape=(n_points,), dtype=float
56 | The radius values at which the potential is given.
57 | V : np.ndarray, shape=r.shape, dtype=float
58 | The potential values at each radius value.
59 | r_switch : float, optional, default=pot_r[-1] - 5 * dr
60 | The radius after which a tail correction is applied.
61 |
62 | References
63 | ----------
64 | .. [1] https://codeblue.umich.edu/hoomd-blue/doc/classhoomd__script_1_1pair_1_1pair.html
65 |
66 | """
67 | r_cut = r[-1]
68 | idx_r_switch, r_switch = find_nearest(r, r_switch)
69 |
70 | S_r = np.ones_like(r)
71 | r = r[idx_r_switch:]
72 | S_r[idx_r_switch:] = ((r_cut ** 2 - r ** 2) ** 2 *
73 | (r_cut ** 2 + 2 * r ** 2 - 3 * r_switch ** 2) /
74 | (r_cut ** 2 - r_switch ** 2) ** 3)
75 | return V * S_r
76 |
77 |
78 | def head_correction(r, V, previous_V, form='linear'):
79 | """Apply head correction to V making it go to a finite value at V(0).
80 |
81 | Parameters
82 | ----------
83 | r : np.ndarray, shape=(n_points,), dtype=float
84 | The radius values at which the potential is given.
85 | V : np.ndarray, shape=r.shape, dtype=float
86 | The potential values at each radius value.
87 | previous_V : np.ndarray, shape=r.shape, dtype=float
88 | The potential from the previous iteration.
89 | form : str, optional, default='linear'
90 | The form of the smoothing function used.
91 |
92 | """
93 | if form == 'linear':
94 | correction_function = linear_head_correction
95 | elif form == 'exponential':
96 | correction_function = exponential_head_correction
97 | else:
98 | raise ValueError('Unsupported head correction form: "{0}"'.format(form))
99 |
100 | for i, pot_value in enumerate(V[::-1]):
101 | # Apply correction function because either of the following is true:
102 | # * both current and target RDFs are 0 --> nan values in potential.
103 | # * current rdf > 0, target rdf = 0 --> +inf values in potential.
104 | if np.isnan(pot_value) or np.isposinf(pot_value):
105 | last_real = V.shape[0] - i - 1
106 | if last_real > len(V) - 2:
107 | raise RuntimeError('Undefined values in tail of potential.'
108 | 'This probably means you need better '
109 | 'sampling at this state point.')
110 | return correction_function(r, V, last_real)
111 | # Retain old potential at small r because:
112 | # * current rdf = 0, target rdf > 0 --> -inf values in potential.
113 | elif np.isneginf(pot_value):
114 | last_neginf = V.shape[0] - i - 1
115 | for i, pot_value in enumerate(V[:last_neginf+1]):
116 | V[i] = previous_V[i]
117 | return V
118 | else:
119 | # TODO: Raise error?
120 | # This means that all potential values are well behaved.
121 | pass
122 |
123 |
124 | def linear_head_correction(r, V, cutoff):
125 | """Use a linear function to smoothly force V to a finite value at V(0). """
126 | slope = ((V[cutoff+1] - V[cutoff+2]) / (r[cutoff+1] - r[cutoff+2]))
127 | V[:cutoff + 1] = slope * (r[:cutoff + 1] - r[cutoff + 1]) + V[cutoff + 1]
128 | return V
129 |
130 |
131 | def exponential_head_correction(r, V, cutoff):
132 | """Use an exponential function to smoothly force V to a finite value at V(0)
133 |
134 | Parameters
135 | ----------
136 | r : np.ndarray
137 | Separation values
138 | V : np.ndarray
139 | Potential at each of the separation values
140 | cutoff : int
141 | The last real value of V when iterating backwards
142 |
143 | This function fits the small part of the potential to the form:
144 | V(r) = A*exp(-Br)
145 | """
146 | dr = r[cutoff+2] - r[cutoff+1]
147 | B = np.log(V[cutoff+1] / V[cutoff+2]) / dr
148 | A = V[cutoff+1] * np.exp(B * r[cutoff+1])
149 | V[:cutoff+1] = A * np.exp(-B * r[:cutoff+1])
150 |
151 |
152 | def alpha_array(alpha0, pot_r, form='linear'):
153 | """Generate an array of alpha values used for scaling in the IBI step. """
154 | if form == 'linear':
155 | return alpha0 * (1.0 - pot_r / pot_r[-1])
156 | else:
157 | raise ValueError('Unsupported alpha form')
158 |
--------------------------------------------------------------------------------
/msibi/state.py:
--------------------------------------------------------------------------------
1 | ##############################################################################
2 | # MSIBI: A package for optimizing coarse-grained force fields using multistate
3 | # iterative Boltzmann inversion.
4 | # Copyright (c) 2017 Vanderbilt University and the Authors
5 | #
6 | # Authors: Christoph Klein, Timothy C. Moore
7 | # Contributors: Davy Yue
8 | #
9 | # Permission is hereby granted, free of charge, to any person obtaining a copy
10 | # of this software and associated documentation files, to deal
11 | # in MSIBI without restriction, including without limitation the rights
12 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | # # copies of MSIBI, and to permit persons to whom MSIBI is
14 | # furnished to do so, subject to the following conditions:
15 | #
16 | # The above copyright notice and this permission notice shall be included in all
17 | # copies or substantial portions of MSIBI.
18 | #
19 | # MSIBI IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | # OUT OF OR IN CONNECTION WITH MSIBI OR THE USE OR OTHER DEALINGS ALONG WITH
25 | # MSIBI.
26 | #
27 | # You should have received a copy of the MIT license.
28 | # If not, see .
29 | ##############################################################################
30 |
31 | import os
32 |
33 | import mdtraj as md
34 |
35 |
36 | HOOMD1_HEADER = """
37 | from hoomd_script import *
38 |
39 | system = init.read_xml(filename="{0}", wrap_coordinates=True)
40 |
41 | T_final = {1:.1f}
42 |
43 | pot_width = {2:d}
44 | table = pair.table(width=pot_width)
45 | """
46 |
47 | HOOMD2_HEADER = """
48 | import hoomd
49 | import hoomd.md
50 | from hoomd.deprecated.init import read_xml
51 |
52 | hoomd.context.initialize("")
53 | system = read_xml(filename="{0}", wrap_coordinates=True)
54 | T_final = {1:.1f}
55 |
56 | pot_width = {2:d}
57 | nl = hoomd.md.nlist.cell()
58 | table = hoomd.md.pair.table(width=pot_width, nlist=nl)
59 |
60 | """
61 |
62 | HOOMD_TABLE_ENTRY = """
63 | table.set_from_file('{type1}', '{type2}', filename='{potential_file}')
64 | """
65 |
66 |
67 | class State(object):
68 | """A single state used as part of a multistate optimization.
69 |
70 | Attributes
71 | ----------
72 | k : float
73 | Boltzmann's constant in specified units.
74 | T : float
75 | Temperature in kelvin.
76 | traj : md.Trajectory
77 | The trajectory associated with this state.
78 | backup_trajectory : bool
79 | True if each query trajectory is backed up (default=False)
80 |
81 | """
82 |
83 | def __init__(self, kT, state_dir='', traj_file=None, top_file=None,
84 | name=None, backup_trajectory=False):
85 | self.kT = kT
86 | self.state_dir = state_dir
87 |
88 | if not traj_file:
89 | self.traj_path = os.path.join(state_dir, 'query.dcd')
90 | if top_file:
91 | self.top_path = os.path.join(state_dir, top_file)
92 |
93 | self.traj = None
94 | if not name:
95 | name = 'state-{0:.3f}'.format(self.kT)
96 | self.name = name
97 |
98 | self.backup_trajectory = backup_trajectory
99 |
100 | def reload_query_trajectory(self):
101 | """Reload the query trajectory. """
102 | if self.top_path:
103 | self.traj = md.load(self.traj_path, top=self.top_path)
104 | else:
105 | self.traj = md.load(self.traj_path)
106 |
107 | def save_runscript(self, table_potentials, table_width, engine='hoomd',
108 | runscript='hoomd_run_template.py'):
109 | """Save the input script for the MD engine. """
110 |
111 | header = list()
112 |
113 | if self.HOOMD_VERSION == 1:
114 | HOOMD_HEADER = HOOMD1_HEADER
115 | elif self.HOOMD_VERSION == 2:
116 | HOOMD_HEADER = HOOMD2_HEADER
117 |
118 | header.append(HOOMD_HEADER.format('start.hoomdxml', self.kT, table_width))
119 | for type1, type2, potential_file in table_potentials:
120 | header.append(HOOMD_TABLE_ENTRY.format(**locals()))
121 | header = ''.join(header)
122 | with open(os.path.join(self.state_dir, runscript)) as fh:
123 | body = ''.join(fh.readlines())
124 |
125 | runscript_file = os.path.join(self.state_dir, 'run.py')
126 | with open(runscript_file, 'w') as fh:
127 | fh.write(header)
128 | fh.write(body)
129 |
--------------------------------------------------------------------------------
/msibi/tests/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/msibi/tests/__init__.py
--------------------------------------------------------------------------------
/msibi/tests/test_error_calculation.py:
--------------------------------------------------------------------------------
1 | import numpy as np
2 |
3 | from msibi.utils.error_calculation import calc_similarity
4 |
5 |
6 | def test_calc_similarity():
7 | arr1 = np.ones(10)
8 | arr2 = np.ones(10)
9 | f_fit = calc_similarity(arr1, arr2)
10 | assert f_fit == 1.0
11 |
12 | arr2 = np.zeros(10)
13 | f_fit = calc_similarity(arr1, arr2)
14 | assert f_fit == 0.0
15 |
16 | arr1 = np.random.random(10)
17 | arr2 = np.random.random(10)
18 | assert calc_similarity(arr1, arr2) == calc_similarity(arr2, arr1)
19 |
--------------------------------------------------------------------------------
/msibi/tests/test_msibi.py:
--------------------------------------------------------------------------------
1 | import pytest
2 |
3 | from msibi.optimize import MSIBI
4 | from msibi.tests.test_pair import init_state
5 |
6 |
7 | n_bins = 151
8 |
9 | def test_msibi_init_single_cutoff():
10 | opt = MSIBI(2.5, n_bins)
11 | assert opt.pot_cutoff == opt.rdf_cutoff
12 | assert opt.n_rdf_points == n_bins
13 | assert opt.rdf_n_bins == n_bins
14 | assert opt.r_switch == 14.6/6.0
15 | assert opt.dr == 0.1/6.0
16 | assert opt.smooth_rdfs is False
17 | assert opt.rdf_r_range.shape[0] == 2
18 | assert opt.pot_r.shape[0] == n_bins
19 |
20 |
21 | def test_msibi_init_multiple_cutoff():
22 | opt = MSIBI(2.5, n_bins, pot_cutoff=2.0)
23 | assert opt.pot_cutoff != opt.rdf_cutoff
24 | assert opt.n_rdf_points == n_bins
25 | assert opt.rdf_n_bins == n_bins
26 | assert opt.r_switch == 11.6/6.0
27 | assert opt.dr == 0.1/6.0
28 | assert opt.smooth_rdfs is False
29 | assert opt.rdf_r_range.shape[0] == 2
30 | assert opt.pot_r.shape[0] != n_bins
31 | assert opt.pot_r.shape[0] == 121
32 |
33 |
34 | def test_msibi_optimize_states():
35 | pair, state0, rdf = init_state(0)
36 | opt = MSIBI(2.5, n_bins, pot_cutoff=2.5)
37 | opt.optimize([state0], [pair], n_iterations=0, engine='hoomd')
38 |
39 |
40 | def test_rdf_length():
41 | pair, state0, rdf = init_state(0)
42 | opt = MSIBI(2.5, n_bins + 1, pot_cutoff=2.5)
43 | with pytest.raises(ValueError):
44 | opt.optimize([state0], [pair], n_iterations=0, engine='hoomd')
45 |
--------------------------------------------------------------------------------
/msibi/tests/test_pair.py:
--------------------------------------------------------------------------------
1 | import os
2 | import pytest
3 | import tempfile
4 |
5 | import mdtraj as md
6 | import numpy as np
7 |
8 | from msibi.potentials import mie
9 | from msibi.pair import Pair
10 | from msibi.state import State
11 | from msibi.utils.general import get_fn
12 |
13 |
14 | dr = 0.1/6.0
15 | r = np.arange(0, 2.5+dr, dr)
16 | pot_r = np.arange(0, 2.0+dr, dr)
17 | r_range = np.asarray([0.0, 2.5+dr])
18 | n_bins = 151
19 | k_B = 1.9872041e-3 # kcal/mol-K
20 | T = 298.0 # K
21 |
22 |
23 | @pytest.fixture
24 | def init_state(state_number):
25 | pair = Pair('0', '1', potential=mie(r, 1.0, 1.0))
26 | topology_filename = get_fn('final.hoomdxml')
27 | traj_filename = get_fn('state{0}/query.dcd'.format(state_number))
28 | t = md.load(traj_filename, top=topology_filename)
29 | pair_list = t.top.select_pairs('name "0"', 'name "1"')
30 | rdf_filename = get_fn('state{0}/target-rdf.txt'.format(state_number))
31 | rdf = np.loadtxt(rdf_filename)
32 | alpha = 0.5
33 | state_dir = get_fn('state{0}/'.format(state_number))
34 | state = State(k_B*T, state_dir=state_dir,
35 | top_file='sys.hoomdxml', name='state0')
36 | pair.add_state(state, rdf, alpha, pair_list)
37 | return pair, state, rdf
38 |
39 |
40 | def test_pair_name():
41 | pair, state, rdf = init_state(0)
42 | assert pair.name == '0-1'
43 |
44 |
45 | def test_save_table_potential():
46 | pair = Pair('A', 'B', potential=mie(r, 1.0, 1.0))
47 | pair.potential_file = tempfile.mkstemp()[1]
48 | pair.save_table_potential(r, dr)
49 | assert os.path.isfile(pair.potential_file)
50 |
51 |
52 | def test_add_state():
53 | pair, state, rdf = init_state(0)
54 | assert np.array_equal(pair.states[state]['target_rdf'], rdf)
55 | assert pair.states[state]['current_rdf'] is None
56 | assert pair.states[state]['alpha'] == 0.5
57 | assert len(pair.states[state]['pair_indices']) == 145152
58 | assert len(pair.states[state]['f_fit']) == 0
59 |
60 |
61 | def test_calc_current_rdf_no_smooth():
62 | pair, state, rdf = init_state(0)
63 | state.reload_query_trajectory()
64 | pair.compute_current_rdf(state, r_range, n_bins, smooth=False, max_frames=1e3)
65 | assert pair.states[state]['current_rdf'] is not None
66 | assert len(pair.states[state]['f_fit']) > 0
67 |
68 |
69 | def test_calc_current_rdf_smooth():
70 | pair, state, rdf = init_state(0)
71 | state.reload_query_trajectory()
72 | pair.compute_current_rdf(state, r_range, n_bins, smooth=True, max_frames=1e3)
73 | assert pair.states[state]['current_rdf'] is not None
74 | assert len(pair.states[state]['f_fit']) > 0
75 |
76 |
77 | def test_save_current_rdf():
78 | pair, state, rdf = init_state(0)
79 | state.reload_query_trajectory()
80 | pair.compute_current_rdf(state, r_range, n_bins, smooth=True, max_frames=1e3)
81 | pair.save_current_rdf(state, 0, 0.1/6.0)
82 | if not os.path.isdir('rdfs'):
83 | os.system('mkdir rdfs')
84 | assert os.path.isfile('rdfs/pair_0-1-state_state0-step0.txt')
85 |
86 |
87 | def test_update_potential():
88 | """Make sure the potential changes after calculating RDF"""
89 | pair, state, rdf = init_state(0)
90 | state.reload_query_trajectory()
91 | pair.compute_current_rdf(state, r_range, n_bins, smooth=True, max_frames=1e3)
92 | pair.update_potential(np.arange(0, 2.5+dr, dr), r_switch=1.8)
93 | assert not np.array_equal(pair.potential, pair.previous_potential)
94 |
95 |
96 | def test_select_pairs():
97 | """Test selecting pairs with exclusions"""
98 | pair = Pair('tail', 'tail', potential=mie(r, 1.0, 1.0))
99 | alpha = 0.5
100 | state_dir = get_fn('state0/')
101 | state = State(k_B*T, state_dir=state_dir,
102 | top_file=get_fn('2chains.hoomdxml'), name='state0')
103 | rdf_filename = get_fn('state0/target-rdf.txt')
104 | rdf = np.loadtxt(rdf_filename)
105 | pair.add_state(state, rdf, alpha)
106 | pair.select_pairs(state, exclude_up_to=3)
107 | assert pair.states[state]['pair_indices'].shape[0] == 162
108 |
--------------------------------------------------------------------------------
/msibi/tests/test_potentials.py:
--------------------------------------------------------------------------------
1 | import pytest
2 | import numpy as np
3 |
4 | from msibi.potentials import tail_correction, mie, alpha_array
5 |
6 |
7 | def test_tail_correction():
8 | dr = 0.05
9 | r = np.arange(0, 2.5, dr)
10 | V = mie(r, 1, 1)
11 | smooth_V = tail_correction(r, V, r_switch=2.25)
12 | assert smooth_V[-1] == 0.0
13 |
14 |
15 | def test_calc_alpha_array():
16 | alpha0 = 1.0
17 | dr = 0.1
18 | r = np.arange(0, 2.5, dr)
19 | form = 'linear'
20 | alpha = alpha_array(alpha0, r, form)
21 | assert alpha[0] == alpha0
22 | assert alpha[-1] == 0.0
23 |
24 | form = 'margaret-thatcher'
25 | with pytest.raises(ValueError):
26 | alpha = alpha_array(alpha0, r, form)
27 |
28 |
--------------------------------------------------------------------------------
/msibi/tests/test_select_pairs.py:
--------------------------------------------------------------------------------
1 | import mdtraj as md
2 | import networkx as nx
3 | import numpy as np
4 |
5 | from msibi.utils.general import get_fn
6 | from msibi.utils.find_exclusions import find_1_n_exclusions
7 | from msibi.utils.find_exclusions import is_1_n
8 |
9 |
10 | def test_select_pair_no_exclusions():
11 | """Test pair selection without exclusions"""
12 | top = md.load(get_fn('2chains.hoomdxml')).top
13 | pairs = top.select_pairs("name 'tail'", "name 'tail'")
14 | assert pairs.shape[0] == 190
15 |
16 |
17 | def test_find_1_n_exclusions():
18 | top = md.load(get_fn('2chains.hoomdxml')).top
19 | pairs = top.select_pairs("name 'tail'", "name 'tail'")
20 | to_delete = find_1_n_exclusions(top, pairs, 3)
21 | assert to_delete.shape[0] == 28
22 |
23 |
24 | def test_select_pair_with_exclusions():
25 | traj = md.load(get_fn('2chains.hoomdxml'))
26 | pairs = traj.top.select_pairs("name 'tail'", "name 'tail'")
27 | to_delete = find_1_n_exclusions(traj.top, pairs, 3)
28 | pairs = np.delete(pairs, to_delete, axis=0)
29 | assert pairs.shape[0] == 162
30 |
31 |
32 | def test_is_exclusion():
33 | top = md.load(get_fn('2chains.hoomdxml')).top
34 | G = nx.Graph()
35 | G.add_nodes_from([a.index for a in top.atoms])
36 | bonds = [b for b in top.bonds]
37 | bonds_by_index = [(b[0].index, b[1].index) for b in bonds]
38 | G.add_edges_from(bonds_by_index)
39 | tail_tail = top.select_pairs("name 'tail'", "name 'tail'")
40 | assert is_1_n(tail_tail[0], 3, G)
41 | assert is_1_n(tail_tail[0], 2, G)
42 | assert is_1_n(tail_tail[0], 4, G)
43 | assert is_1_n(tail_tail[2], 4, G)
44 | assert not is_1_n(tail_tail[2], 3, G)
45 |
46 |
--------------------------------------------------------------------------------
/msibi/tests/test_state.py:
--------------------------------------------------------------------------------
1 | import pytest
2 |
3 | from msibi.state import State
4 | from msibi.utils.general import get_fn
5 |
6 |
7 | @pytest.mark.skipif(True, reason='Needs implementing!')
8 | def test_init():
9 | pass
10 |
11 |
12 | def test_reload_query_trajectory():
13 | state_dir = get_fn('state0/')
14 | state = State(1.987e-3*500.0, state_dir=state_dir, top_file='sys.hoomdxml',
15 | name='state0')
16 | state.reload_query_trajectory()
17 | assert(state.traj)
18 | assert(state.traj.top)
19 |
20 | @pytest.mark.skipif(True, reason='Needs implementing!')
21 | def test_save_runscript():
22 | pass
23 |
--------------------------------------------------------------------------------
/msibi/tests/test_utils.py:
--------------------------------------------------------------------------------
1 | import pytest
2 |
3 | import numpy as np
4 |
5 | from msibi.utils.error_calculation import calc_similarity
6 | from msibi.utils.general import find_nearest
7 | from msibi.utils.smoothing import savitzky_golay
8 |
9 |
10 | def test_calc_similarity():
11 | a = np.arange(0.0, 5.0, 0.05)
12 | b = np.arange(0.0, 5.0, 0.05)
13 | assert calc_similarity(a, b) == 1.0
14 | b *= -1
15 | assert calc_similarity(a, b) == 0.0
16 |
17 |
18 | def test_find_nearest():
19 | a = np.arange(10)
20 | idx, nearest = find_nearest(a, 2.1)
21 | assert idx == 2
22 | assert nearest == 2
23 |
24 |
25 | def test_savitzky_golay():
26 | x = np.arange(0, 1, 0.01)
27 | y = 2 * x + 1
28 | y2 = savitzky_golay(y, 3, 1)
29 | assert y.shape == y2.shape
30 | assert np.allclose(y, y2)
31 |
32 | y = x**3.0
33 | y2 = savitzky_golay(y, 3, 1)
34 | assert calc_similarity(y, y2) > 0.99
35 |
36 | with pytest.raises(ValueError):
37 | y2 = savitzky_golay(y, 3.1, 1)
38 | with pytest.raises(TypeError):
39 | y2 = savitzky_golay(y, 2, 1)
40 | with pytest.raises(TypeError):
41 | y2 = savitzky_golay(y, 4, 1)
42 | with pytest.raises(TypeError):
43 | y2 = savitzky_golay(y, 3, 3)
44 | with pytest.raises(TypeError):
45 | y2 = savitzky_golay(y, 3, 2)
46 |
--------------------------------------------------------------------------------
/msibi/tests/test_workers.py:
--------------------------------------------------------------------------------
1 | import os
2 | import pytest
3 |
4 | from msibi.tests.test_pair import init_state
5 | from msibi.utils.exceptions import UnsupportedEngine
6 | from msibi.workers import run_query_simulations
7 | from msibi.workers import _post_query
8 |
9 |
10 | def test_unsupported_engine():
11 | engine = 'crammps'
12 | with pytest.raises(UnsupportedEngine):
13 | run_query_simulations(['margaret', 'thatcher'], engine=engine)
14 |
15 |
16 | def test_post_query():
17 | pair, state0, rdf = init_state(0)
18 | _post_query(state0)
19 | assert state0.traj is not None
20 | assert os.path.isfile(os.path.join(state0.state_dir, '_.0.log.txt'))
21 | assert os.path.isfile(os.path.join(state0.state_dir, '_.0.err.txt'))
22 |
--------------------------------------------------------------------------------
/msibi/tutorials/README:
--------------------------------------------------------------------------------
1 | This directory contains several tests.
2 | It is advisable, at the minimum, to run the LJ test to make sure the
3 | code works as expected. To run plot.py, downloading and installing msibi_utils
4 | is highly recommended to visualize the results.
5 |
6 | LJ : recover known LJ potential
7 | - This test, as described in the original paper, is recovering a
8 | known potential to show that the methodology works. The target
9 | data was derived from LJ fluids at three different states.
10 |
11 | PROPANE : optimize pair potentials for a single-site propane model
12 | - This test, as described in the original 2014 paper, performs further
13 | optimizations on propane using a coarse-graining 3-1 mapping. The 3-site
14 | propane is mapped to the single-site propane and the generated data can be
15 | compared to known LJ potentials from literature [1].
16 |
17 | [1] Q. Pu et al., “Molecular simulations of stretching gold nanowires in
18 | solvents,” Nanotechnology 18, 424007 (2007).
19 |
--------------------------------------------------------------------------------
/msibi/tutorials/lj/opt.py:
--------------------------------------------------------------------------------
1 | import itertools
2 | import os
3 |
4 | import numpy as np
5 |
6 | from msibi import MSIBI, State, Pair, mie
7 |
8 |
9 | os.system('rm state*/_* rdfs/pair* potentials/* f_fits.log state*/log.txt')
10 | os.system('rm state*/err.txt')
11 | os.system('rm state*/query.dcd')
12 |
13 | # Set up global parameters.
14 | rdf_cutoff = 5.0
15 | opt = MSIBI(rdf_cutoff=rdf_cutoff, n_rdf_points=101, pot_cutoff=3.0,
16 | smooth_rdfs=True)
17 |
18 | # Specify states.
19 | state0 = State(kT=0.5, state_dir='./state0', top_file='start.hoomdxml',
20 | name='state0', backup_trajectory=True)
21 | state1 = State(kT=1.5, state_dir='./state1', top_file='start.hoomdxml',
22 | name='state1', backup_trajectory=True)
23 | state2 = State(kT=2.0, state_dir='./state2', top_file='start.hoomdxml',
24 | name='state2', backup_trajectory=True)
25 | states = [state0, state1, state2]
26 |
27 | # Specify pairs.
28 | indices = list(itertools.combinations(range(1468), 2)) # all-all for 1468 atoms
29 | initial_guess = mie(opt.pot_r, 1.0, 1.0) # 1-D array of potential values.
30 | rdf_targets = [np.loadtxt('rdfs/rdf.target{0:d}.t1t1.txt'.format(i))
31 | for i in range(3)]
32 |
33 | pair0 = Pair('1', '1', initial_guess)
34 | alphas = [1.0, 1.0, 1.0]
35 |
36 | # Add targets to pair.
37 | for state, target, alpha in zip(states, rdf_targets, alphas):
38 | pair0.add_state(state, target, alpha, indices)
39 | pairs = [pair0] # optimize() expects a list of pairs
40 |
41 | # Do magic.
42 | opt.optimize(states, pairs, n_iterations=5, engine='hoomd')
43 |
--------------------------------------------------------------------------------
/msibi/tutorials/lj/rdfs/rdf.target0.t1t1.txt:
--------------------------------------------------------------------------------
1 | 0 0
2 | 0.05 0
3 | 0.1 0
4 | 0.15 0
5 | 0.2 0
6 | 0.25 0
7 | 0.3 0
8 | 0.35 0
9 | 0.4 0
10 | 0.45 0
11 | 0.5 0
12 | 0.55 0
13 | 0.6 0
14 | 0.65 0
15 | 0.7 0
16 | 0.75 0
17 | 0.8 0
18 | 0.85 0
19 | 0.9 0.00343199
20 | 0.95 0.25661
21 | 1 1.70286
22 | 1.05 3.13567
23 | 1.1 3.10826
24 | 1.15 2.37586
25 | 1.2 1.68615
26 | 1.25 1.19868
27 | 1.3 0.905337
28 | 1.35 0.715035
29 | 1.4 0.609764
30 | 1.45 0.543081
31 | 1.5 0.51985
32 | 1.55 0.518761
33 | 1.6 0.553223
34 | 1.65 0.611436
35 | 1.7 0.707678
36 | 1.75 0.839403
37 | 1.8 0.977983
38 | 1.85 1.10835
39 | 1.9 1.20238
40 | 1.95 1.25224
41 | 2 1.28504
42 | 2.05 1.30419
43 | 2.1 1.30097
44 | 2.15 1.25637
45 | 2.2 1.17699
46 | 2.25 1.06703
47 | 2.3 0.968362
48 | 2.35 0.884896
49 | 2.4 0.81879
50 | 2.45 0.788498
51 | 2.5 0.781656
52 | 2.55 0.796351
53 | 2.6 0.828547
54 | 2.65 0.881824
55 | 2.7 0.946627
56 | 2.75 1.0153
57 | 2.8 1.07573
58 | 2.85 1.11632
59 | 2.9 1.13682
60 | 2.95 1.14071
61 | 3 1.12151
62 | 3.05 1.10168
63 | 3.1 1.07506
64 | 3.15 1.04158
65 | 3.2 1.01435
66 | 3.25 0.981591
67 | 3.3 0.953676
68 | 3.35 0.928868
69 | 3.4 0.91361
70 | 3.45 0.905935
71 | 3.5 0.913247
72 | 3.55 0.92847
73 | 3.6 0.949367
74 | 3.65 0.981483
75 | 3.7 1.00953
76 | 3.75 1.03721
77 | 3.8 1.05739
78 | 3.85 1.06761
79 | 3.9 1.069
80 | 3.95 1.05941
81 | 4 1.04634
82 | 4.05 1.02815
83 | 4.1 1.01618
84 | 4.15 0.998816
85 | 4.2 0.981874
86 | 4.25 0.97311
87 | 4.3 0.964823
88 | 4.35 0.961271
89 | 4.4 0.958939
90 | 4.45 0.96255
91 | 4.5 0.969203
92 | 4.55 0.981393
93 | 4.6 0.993913
94 | 4.65 1.00835
95 | 4.7 1.0183
96 | 4.75 1.02735
97 | 4.8 1.03295
98 | 4.85 1.03346
99 | 4.9 1.03082
100 | 4.95 1.02326
101 | 5 1.01477
102 |
--------------------------------------------------------------------------------
/msibi/tutorials/lj/rdfs/rdf.target1.t1t1.txt:
--------------------------------------------------------------------------------
1 | 0 0
2 | 0.05 0
3 | 0.1 0
4 | 0.15 0
5 | 0.2 0
6 | 0.25 0
7 | 0.3 0
8 | 0.35 0
9 | 0.4 0
10 | 0.45 0
11 | 0.5 0
12 | 0.55 0
13 | 0.6 0
14 | 0.65 0
15 | 0.7 0
16 | 0.75 0
17 | 0.8 0
18 | 0.85 0.00419783
19 | 0.9 0.179927
20 | 0.95 0.933757
21 | 1 1.7965
22 | 1.05 2.12968
23 | 1.1 2.02124
24 | 1.15 1.76298
25 | 1.2 1.50654
26 | 1.25 1.28046
27 | 1.3 1.10959
28 | 1.35 0.994047
29 | 1.4 0.905181
30 | 1.45 0.849052
31 | 1.5 0.818728
32 | 1.55 0.791253
33 | 1.6 0.785798
34 | 1.65 0.794944
35 | 1.7 0.813936
36 | 1.75 0.854724
37 | 1.8 0.905149
38 | 1.85 0.947861
39 | 1.9 1.00115
40 | 1.95 1.06015
41 | 2 1.09604
42 | 2.05 1.11635
43 | 2.1 1.11768
44 | 2.15 1.10942
45 | 2.2 1.08775
46 | 2.25 1.06184
47 | 2.3 1.03587
48 | 2.35 1.00724
49 | 2.4 0.987037
50 | 2.45 0.968469
51 | 2.5 0.959016
52 | 2.55 0.950442
53 | 2.6 0.955028
54 | 2.65 0.955511
55 | 2.7 0.961311
56 | 2.75 0.97273
57 | 2.8 0.98225
58 | 2.85 0.997133
59 | 2.9 1.007
60 | 2.95 1.01668
61 | 3 1.02303
62 | 3.05 1.02556
63 | 3.1 1.02454
64 | 3.15 1.02506
65 | 3.2 1.0172
66 | 3.25 1.01363
67 | 3.3 1.00662
68 | 3.35 0.998155
69 | 3.4 0.996059
70 | 3.45 0.993227
71 | 3.5 0.992487
72 | 3.55 0.988348
73 | 3.6 0.988808
74 | 3.65 0.990113
75 | 3.7 0.993798
76 | 3.75 0.995855
77 | 3.8 0.997494
78 | 3.85 1.00021
79 | 3.9 1.00321
80 | 3.95 1.00573
81 | 4 1.00682
82 | 4.05 1.00402
83 | 4.1 1.00852
84 | 4.15 1.00458
85 | 4.2 1.00321
86 | 4.25 1.00055
87 | 4.3 1.00034
88 | 4.35 0.99851
89 | 4.4 1.00097
90 | 4.45 0.997601
91 | 4.5 0.999584
92 | 4.55 0.998182
93 | 4.6 0.997278
94 | 4.65 1.0018
95 | 4.7 1.00001
96 | 4.75 0.998586
97 | 4.8 1.00024
98 | 4.85 1.00015
99 | 4.9 1.00053
100 | 4.95 1.00254
101 | 5 1.00049
102 |
--------------------------------------------------------------------------------
/msibi/tutorials/lj/rdfs/rdf.target2.t1t1.txt:
--------------------------------------------------------------------------------
1 | 0 0
2 | 0.05 0
3 | 0.1 0
4 | 0.15 0
5 | 0.2 0
6 | 0.25 0
7 | 0.3 0
8 | 0.35 0
9 | 0.4 0
10 | 0.45 0
11 | 0.5 0
12 | 0.55 0
13 | 0.6 0
14 | 0.65 0
15 | 0.7 0
16 | 0.75 0
17 | 0.8 0
18 | 0.85 0.00895525
19 | 0.9 0.172014
20 | 0.95 0.719421
21 | 1 1.29325
22 | 1.05 1.5901
23 | 1.1 1.61558
24 | 1.15 1.55716
25 | 1.2 1.45771
26 | 1.25 1.35727
27 | 1.3 1.26668
28 | 1.35 1.20882
29 | 1.4 1.15728
30 | 1.45 1.10923
31 | 1.5 1.06256
32 | 1.55 1.04378
33 | 1.6 1.01623
34 | 1.65 1.00287
35 | 1.7 1.00196
36 | 1.75 0.991572
37 | 1.8 0.98435
38 | 1.85 0.98909
39 | 1.9 0.992431
40 | 1.95 0.99902
41 | 2 1.0103
42 | 2.05 1.01935
43 | 2.1 1.01052
44 | 2.15 1.0247
45 | 2.2 1.03272
46 | 2.25 1.02417
47 | 2.3 1.01708
48 | 2.35 1.02181
49 | 2.4 1.02312
50 | 2.45 1.02258
51 | 2.5 1.01355
52 | 2.55 1.01791
53 | 2.6 1.01454
54 | 2.65 1.00772
55 | 2.7 1.01094
56 | 2.75 1.00267
57 | 2.8 1.00448
58 | 2.85 1.00337
59 | 2.9 1.00168
60 | 2.95 1.00182
61 | 3 1.00441
62 | 3.05 1.00288
63 | 3.1 1.00277
64 | 3.15 1.00897
65 | 3.2 1.0099
66 | 3.25 1.00403
67 | 3.3 1.0071
68 | 3.35 1.00727
69 | 3.4 0.995851
70 | 3.45 1.00373
71 | 3.5 1.00183
72 | 3.55 0.999256
73 | 3.6 1.00526
74 | 3.65 1.00322
75 | 3.7 0.994496
76 | 3.75 1.00761
77 | 3.8 0.99495
78 | 3.85 0.995781
79 | 3.9 1.00257
80 | 3.95 1.00232
81 | 4 0.999494
82 | 4.05 1.00209
83 | 4.1 0.997951
84 | 4.15 1.00455
85 | 4.2 0.99336
86 | 4.25 0.996347
87 | 4.3 0.994082
88 | 4.35 0.993397
89 | 4.4 0.995942
90 | 4.45 0.997825
91 | 4.5 0.997754
92 | 4.55 0.998684
93 | 4.6 0.997661
94 | 4.65 0.997053
95 | 4.7 0.997254
96 | 4.75 0.998877
97 | 4.8 1.00133
98 | 4.85 0.997903
99 | 4.9 1.00021
100 | 4.95 0.997446
101 | 5 0.997648
102 |
--------------------------------------------------------------------------------
/msibi/tutorials/lj/state0/hoomd_run_template.py:
--------------------------------------------------------------------------------
1 | all = hoomd.group.all()
2 | nvt_int = hoomd.md.integrate.langevin(group=all, kT=T_final, seed=1)
3 | hoomd.md.integrate.mode_standard(dt=0.001)
4 |
5 | hoomd.run(1e2)
6 | output_dcd = hoomd.dump.dcd(filename='query.dcd', period=100, overwrite=True)
7 | hoomd.run(1e4)
8 |
--------------------------------------------------------------------------------
/msibi/tutorials/lj/state1/hoomd_run_template.py:
--------------------------------------------------------------------------------
1 | all = hoomd.group.all()
2 | nvt_int = hoomd.md.integrate.langevin(group=all, kT=T_final, seed=1)
3 | hoomd.md.integrate.mode_standard(dt=0.001)
4 |
5 | hoomd.run(1e2)
6 | output_dcd = hoomd.dump.dcd(filename='query.dcd', period=100, overwrite=True)
7 | hoomd.run(1e4)
8 |
--------------------------------------------------------------------------------
/msibi/tutorials/lj/state2/hoomd_run_template.py:
--------------------------------------------------------------------------------
1 | all = hoomd.group.all()
2 | nvt_int = hoomd.md.integrate.langevin(group=all, kT=T_final, seed=1)
3 | hoomd.md.integrate.mode_standard(dt=0.001)
4 |
5 | hoomd.run(1e2)
6 | output_dcd = hoomd.dump.dcd(filename='query.dcd', period=100, overwrite=True)
7 | hoomd.run(1e4)
8 |
--------------------------------------------------------------------------------
/msibi/tutorials/propane/.gitignore:
--------------------------------------------------------------------------------
1 | rdfs/pair*
2 | potentials/
3 | state*/*.txt
4 | state*/run.py
5 |
--------------------------------------------------------------------------------
/msibi/tutorials/propane/opt.py:
--------------------------------------------------------------------------------
1 | import itertools
2 | import string
3 | import os
4 |
5 | import numpy as np
6 |
7 | from msibi import MSIBI, State, Pair, mie
8 |
9 | os.system('rm rdfs/pair_C3*_state*-step*.txt f_fits.log')
10 | os.system('rm state_*/*.txt state*/run.py state*/*query.dcd')
11 |
12 |
13 | # Set up global parameters.
14 | rdf_cutoff = 5.0
15 | opt = MSIBI(rdf_cutoff=rdf_cutoff, n_rdf_points=201, pot_cutoff=3.0,
16 | smooth_rdfs=True)
17 |
18 | # Specify states.
19 | stateA = State(kT=0.5, state_dir='./state_A', top_file='start.hoomdxml',
20 | name='stateA', backup_trajectory=True)
21 | stateB = State(kT=1.5, state_dir='./state_B', top_file='start.hoomdxml',
22 | name='stateB', backup_trajectory=True)
23 | stateC = State(kT=2.0, state_dir='./state_C', top_file='start.hoomdxml',
24 | name='stateC', backup_trajectory=True)
25 | states = [stateA, stateB, stateC]
26 |
27 | # Specify pairs.
28 | indices = list(itertools.combinations(range(1024), 2)) # all-all for 1024 atoms
29 |
30 | initial_guess = mie(opt.pot_r, 1.0, 1.0) # 1-D array of potential values.
31 | alphabet = ['A', 'B', 'C']
32 | rdf_targets = [np.loadtxt('rdfs/C3-C3-state_{0}.txt'.format(i))
33 | for i in alphabet]
34 |
35 | pair0 = Pair('C3', 'C3', initial_guess)
36 | alphas = [1.0, 1.0, 1.0]
37 |
38 | # Add targets to pair.
39 | for state, target, alpha in zip(states, rdf_targets, alphas):
40 | pair0.add_state(state, target, alpha, indices)
41 | pairs = [pair0] # optimize() expects a list of pairs
42 |
43 | # Do magic.
44 | opt.optimize(states, pairs, n_iterations=5, engine='hoomd')
45 |
--------------------------------------------------------------------------------
/msibi/tutorials/propane/plot.py:
--------------------------------------------------------------------------------
1 | from msibi_utils.plot_fit import plot_all_fits
2 | from msibi_utils.plot_rdfs import plot_all_rdfs
3 | from msibi_utils.animate_rdf import animate_all_pairs_states
4 |
5 | plot_all_fits('opt.out', ylims=(0.5, 1))
6 | plot_all_rdfs('opt.out', 'rdfs', step=4)
7 | animate_all_pairs_states('opt.out', 'rdfs', step=4, n_skip=0)
8 |
--------------------------------------------------------------------------------
/msibi/tutorials/propane/propane.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "markdown",
5 | "metadata": {},
6 | "source": [
7 | "# Propane Tutorial\n",
8 | "\n",
9 | "Created by Davy Yue 2017-06-14\n",
10 | "\n",
11 | "\n",
12 | "### Imports"
13 | ]
14 | },
15 | {
16 | "cell_type": "code",
17 | "execution_count": null,
18 | "metadata": {
19 | "collapsed": true
20 | },
21 | "outputs": [],
22 | "source": [
23 | "import itertools\n",
24 | "import string\n",
25 | "import os\n",
26 | "\n",
27 | "import numpy as np\n",
28 | "\n",
29 | "from msibi import MSIBI, State, Pair, mie"
30 | ]
31 | },
32 | {
33 | "cell_type": "markdown",
34 | "metadata": {},
35 | "source": [
36 | "### Remove files generated during CG simulation"
37 | ]
38 | },
39 | {
40 | "cell_type": "code",
41 | "execution_count": null,
42 | "metadata": {},
43 | "outputs": [],
44 | "source": [
45 | "os.system('rm rdfs/pair_C3*_state*-step*.txt f_fits.log')\n",
46 | "os.system('rm state_*/*.txt state*/run.py state*/*query.dcd')"
47 | ]
48 | },
49 | {
50 | "cell_type": "markdown",
51 | "metadata": {},
52 | "source": [
53 | "### Set up global parameters\n",
54 | "Cutoff radius set to 5.0 units. Parameters including number of data points and potential cutoff are passed to `MSIBI`."
55 | ]
56 | },
57 | {
58 | "cell_type": "code",
59 | "execution_count": null,
60 | "metadata": {
61 | "collapsed": true
62 | },
63 | "outputs": [],
64 | "source": [
65 | "rdf_cutoff = 5.0\n",
66 | "opt = MSIBI(rdf_cutoff=rdf_cutoff, n_rdf_points=201, pot_cutoff=3.0,\n",
67 | " smooth_rdfs=True)"
68 | ]
69 | },
70 | {
71 | "cell_type": "markdown",
72 | "metadata": {},
73 | "source": [
74 | "### Specify states\n",
75 | "States each are initialized with different temperatures, directories, and start.hoomdxml files. \n",
76 | "\n",
77 | "A list `states` contains all the individual states: `stateA`, `stateB`, `stateC`."
78 | ]
79 | },
80 | {
81 | "cell_type": "code",
82 | "execution_count": null,
83 | "metadata": {
84 | "collapsed": true
85 | },
86 | "outputs": [],
87 | "source": [
88 | "stateA = State(kT=0.5, state_dir='./state_A', top_file='start.hoomdxml',\n",
89 | " name='stateA', backup_trajectory=True)\n",
90 | "stateB = State(kT=1.5, state_dir='./state_B', top_file='start.hoomdxml',\n",
91 | " name='stateB', backup_trajectory=True)\n",
92 | "stateC = State(kT=2.0, state_dir='./state_C', top_file='start.hoomdxml',\n",
93 | " name='stateC', backup_trajectory=True)\n",
94 | "states = [stateA, stateB, stateC]"
95 | ]
96 | },
97 | {
98 | "cell_type": "markdown",
99 | "metadata": {},
100 | "source": [
101 | "### Specify pairs\n",
102 | "\n",
103 | "Creates a list of all the possible indices for the 1024 atoms. \n",
104 | "\n",
105 | "Passes the type of interaction to be optimized, a `C3` to itself, to `Pair`. Sets the alpha values to `1.0`"
106 | ]
107 | },
108 | {
109 | "cell_type": "code",
110 | "execution_count": null,
111 | "metadata": {},
112 | "outputs": [],
113 | "source": [
114 | "indices = list(itertools.combinations(range(1024), 2)) # all-all for 1024 atoms\n",
115 | "\n",
116 | "initial_guess = mie(opt.pot_r, 1.0, 1.0) # 1-D array of potential values.\n",
117 | "alphabet = ['A', 'B', 'C']\n",
118 | "rdf_targets = [np.loadtxt('rdfs/C3-C3-state_{0}.txt'.format(i))\n",
119 | " for i in alphabet]\n",
120 | "\n",
121 | "pair0 = Pair('C3', 'C3', initial_guess)\n",
122 | "alphas = [1.0, 1.0, 1.0]"
123 | ]
124 | },
125 | {
126 | "cell_type": "markdown",
127 | "metadata": {},
128 | "source": [
129 | "### Add targets to pair\n",
130 | "\n",
131 | "Loops through each `state`, `target`, and `alpha` in `zip`. Adds the appropriate states, and converts `pair0` into a list for the `optimize()` function."
132 | ]
133 | },
134 | {
135 | "cell_type": "code",
136 | "execution_count": null,
137 | "metadata": {
138 | "collapsed": true
139 | },
140 | "outputs": [],
141 | "source": [
142 | "for state, target, alpha in zip(states, rdf_targets, alphas):\n",
143 | " pair0.add_state(state, target, alpha, indices)\n",
144 | "pairs = [pair0]"
145 | ]
146 | },
147 | {
148 | "cell_type": "markdown",
149 | "metadata": {},
150 | "source": [
151 | "### Do magic\n",
152 | "\n",
153 | "Sprinkle fairy dust over the code.\n",
154 | "\n",
155 | "\n",
156 | "Calls the `optimize` function with the parameters given. \n",
157 | "Performs five iterations, with each successive iteration usually producing finer, better output. \n",
158 | "Uses the `hoomd` engine to run the simulations."
159 | ]
160 | },
161 | {
162 | "cell_type": "code",
163 | "execution_count": null,
164 | "metadata": {},
165 | "outputs": [],
166 | "source": [
167 | "opt.optimize(states, pairs, n_iterations=5, engine='hoomd')"
168 | ]
169 | },
170 | {
171 | "cell_type": "code",
172 | "execution_count": null,
173 | "metadata": {
174 | "collapsed": true
175 | },
176 | "outputs": [],
177 | "source": []
178 | }
179 | ],
180 | "metadata": {
181 | "kernelspec": {
182 | "display_name": "Python 3",
183 | "language": "python",
184 | "name": "python3"
185 | },
186 | "language_info": {
187 | "codemirror_mode": {
188 | "name": "ipython",
189 | "version": 3
190 | },
191 | "file_extension": ".py",
192 | "mimetype": "text/x-python",
193 | "name": "python",
194 | "nbconvert_exporter": "python",
195 | "pygments_lexer": "ipython3",
196 | "version": "3.5.3"
197 | },
198 | "widgets": {
199 | "state": {
200 | "0167551767ac4299a760fb1f479ad1b1": {
201 | "views": [
202 | {
203 | "cell_index": 2
204 | }
205 | ]
206 | },
207 | "0c7a72e241b341ab8ca29ce3292b3ea3": {
208 | "views": [
209 | {
210 | "cell_index": 2
211 | }
212 | ]
213 | },
214 | "1fca05dfeb3d4987893759f4cc0520ea": {
215 | "views": [
216 | {
217 | "cell_index": 3
218 | }
219 | ]
220 | },
221 | "56215d591c034eff8b0899b7e18d5cba": {
222 | "views": [
223 | {
224 | "cell_index": 3
225 | }
226 | ]
227 | }
228 | },
229 | "version": "1.2.0"
230 | }
231 | },
232 | "nbformat": 4,
233 | "nbformat_minor": 1
234 | }
235 |
--------------------------------------------------------------------------------
/msibi/tutorials/propane/rdfs/C3-C3-state_A.txt:
--------------------------------------------------------------------------------
1 | 0 0
2 | 0.025 0
3 | 0.05 0
4 | 0.075 0
5 | 0.1 0
6 | 0.125 0
7 | 0.15 0
8 | 0.175 0
9 | 0.2 0
10 | 0.225 0
11 | 0.25 0
12 | 0.275 0
13 | 0.3 0
14 | 0.325 0
15 | 0.35 0
16 | 0.375 0
17 | 0.4 0
18 | 0.425 0
19 | 0.45 0
20 | 0.475 0
21 | 0.5 0
22 | 0.525 0
23 | 0.55 0
24 | 0.575 0
25 | 0.6 0
26 | 0.625 0
27 | 0.65 0
28 | 0.675 0
29 | 0.7 0
30 | 0.725 0
31 | 0.75 0
32 | 0.775 0
33 | 0.8 0
34 | 0.825 0
35 | 0.85 0
36 | 0.875 0
37 | 0.9 0
38 | 0.925 0
39 | 0.95 0.000144115
40 | 0.975 0.000547643
41 | 1 0.00169303
42 | 1.025 0.0121552
43 | 1.05 0.0501444
44 | 1.075 0.122938
45 | 1.1 0.261594
46 | 1.125 0.471037
47 | 1.15 0.720606
48 | 1.175 1.00672
49 | 1.2 1.28503
50 | 1.225 1.54392
51 | 1.25 1.7639
52 | 1.275 1.96846
53 | 1.3 2.09609
54 | 1.325 2.16646
55 | 1.35 2.20974
56 | 1.375 2.23375
57 | 1.4 2.1875
58 | 1.425 2.11498
59 | 1.45 2.02195
60 | 1.475 1.91865
61 | 1.5 1.76103
62 | 1.525 1.6286
63 | 1.55 1.47759
64 | 1.575 1.34798
65 | 1.6 1.2129
66 | 1.625 1.07562
67 | 1.65 0.963757
68 | 1.675 0.875166
69 | 1.7 0.784106
70 | 1.725 0.709739
71 | 1.75 0.637311
72 | 1.775 0.58593
73 | 1.8 0.558539
74 | 1.825 0.523949
75 | 1.85 0.501472
76 | 1.875 0.498544
77 | 1.9 0.499577
78 | 1.925 0.504871
79 | 1.95 0.515455
80 | 1.975 0.535119
81 | 2 0.562982
82 | 2.025 0.590418
83 | 2.05 0.645273
84 | 2.075 0.699583
85 | 2.1 0.741972
86 | 2.125 0.808908
87 | 2.15 0.848957
88 | 2.175 0.92252
89 | 2.2 0.986616
90 | 2.225 1.03662
91 | 2.25 1.07654
92 | 2.275 1.12029
93 | 2.3 1.16658
94 | 2.325 1.19948
95 | 2.35 1.22069
96 | 2.375 1.2414
97 | 2.4 1.25684
98 | 2.425 1.27803
99 | 2.45 1.26927
100 | 2.475 1.26756
101 | 2.5 1.25481
102 | 2.525 1.23782
103 | 2.55 1.23436
104 | 2.575 1.20045
105 | 2.6 1.19355
106 | 2.625 1.16264
107 | 2.65 1.14071
108 | 2.675 1.11648
109 | 2.7 1.10066
110 | 2.725 1.07295
111 | 2.75 1.04931
112 | 2.775 1.01796
113 | 2.8 0.989396
114 | 2.825 0.975405
115 | 2.85 0.954841
116 | 2.875 0.928418
117 | 2.9 0.906819
118 | 2.925 0.896277
119 | 2.95 0.880408
120 | 2.975 0.857058
121 | 3 0.856589
122 | 3.025 0.84602
123 | 3.05 0.844549
124 | 3.075 0.840522
125 | 3.1 0.842606
126 | 3.125 0.85214
127 | 3.15 0.853192
128 | 3.175 0.868522
129 | 3.2 0.885085
130 | 3.225 0.90618
131 | 3.25 0.920494
132 | 3.275 0.93758
133 | 3.3 0.957528
134 | 3.325 0.978968
135 | 3.35 0.996503
136 | 3.375 1.01699
137 | 3.4 1.03399
138 | 3.425 1.05251
139 | 3.45 1.06703
140 | 3.475 1.08176
141 | 3.5 1.08419
142 | 3.525 1.09654
143 | 3.55 1.10207
144 | 3.575 1.10333
145 | 3.6 1.09967
146 | 3.625 1.09822
147 | 3.65 1.0893
148 | 3.675 1.08512
149 | 3.7 1.0874
150 | 3.725 1.07274
151 | 3.75 1.06293
152 | 3.775 1.05613
153 | 3.8 1.04845
154 | 3.825 1.03628
155 | 3.85 1.02356
156 | 3.875 1.01704
157 | 3.9 1.00752
158 | 3.925 0.995554
159 | 3.95 0.991526
160 | 3.975 0.980938
161 | 4 0.966381
162 | 4.025 0.968382
163 | 4.05 0.956258
164 | 4.075 0.951557
165 | 4.1 0.950104
166 | 4.125 0.944795
167 | 4.15 0.94601
168 | 4.175 0.942964
169 | 4.2 0.944521
170 | 4.225 0.948882
171 | 4.25 0.942759
172 | 4.275 0.948713
173 | 4.3 0.95107
174 | 4.325 0.960172
175 | 4.35 0.963644
176 | 4.375 0.971281
177 | 4.4 0.973871
178 | 4.425 0.988009
179 | 4.45 0.990748
180 | 4.475 1.00135
181 | 4.5 1.00679
182 | 4.525 1.00726
183 | 4.55 1.01578
184 | 4.575 1.02861
185 | 4.6 1.02607
186 | 4.625 1.03425
187 | 4.65 1.03473
188 | 4.675 1.03698
189 | 4.7 1.03563
190 | 4.725 1.03737
191 | 4.75 1.04003
192 | 4.775 1.03881
193 | 4.8 1.03667
194 | 4.825 1.03565
195 | 4.85 1.03125
196 | 4.875 1.02937
197 | 4.9 1.02547
198 | 4.925 1.01571
199 | 4.95 1.01456
200 | 4.975 1.01306
201 | 5 1.00527
202 |
--------------------------------------------------------------------------------
/msibi/tutorials/propane/rdfs/C3-C3-state_B.txt:
--------------------------------------------------------------------------------
1 | 0 0
2 | 0.025 0
3 | 0.05 0
4 | 0.075 0
5 | 0.1 0
6 | 0.125 0
7 | 0.15 0
8 | 0.175 0
9 | 0.2 0
10 | 0.225 0
11 | 0.25 0
12 | 0.275 0
13 | 0.3 0
14 | 0.325 0
15 | 0.35 0
16 | 0.375 0
17 | 0.4 0
18 | 0.425 0
19 | 0.45 0
20 | 0.475 0
21 | 0.5 0
22 | 0.525 0
23 | 0.55 0
24 | 0.575 0
25 | 0.6 0
26 | 0.625 0
27 | 0.65 0
28 | 0.675 0
29 | 0.7 0
30 | 0.725 0
31 | 0.75 0
32 | 0.775 0
33 | 0.8 0
34 | 0.825 0
35 | 0.85 0
36 | 0.875 0
37 | 0.9 0
38 | 0.925 0
39 | 0.95 0
40 | 0.975 0.000255251
41 | 1 0.00169961
42 | 1.025 0.00485609
43 | 1.05 0.0143318
44 | 1.075 0.039989
45 | 1.1 0.0774296
46 | 1.125 0.151013
47 | 1.15 0.232077
48 | 1.175 0.350029
49 | 1.2 0.470177
50 | 1.225 0.631954
51 | 1.25 0.782237
52 | 1.275 0.955022
53 | 1.3 1.07692
54 | 1.325 1.22071
55 | 1.35 1.31282
56 | 1.375 1.40248
57 | 1.4 1.49962
58 | 1.425 1.56042
59 | 1.45 1.63426
60 | 1.475 1.65258
61 | 1.5 1.65248
62 | 1.525 1.66015
63 | 1.55 1.63467
64 | 1.575 1.61026
65 | 1.6 1.61279
66 | 1.625 1.53515
67 | 1.65 1.49644
68 | 1.675 1.41886
69 | 1.7 1.3684
70 | 1.725 1.31307
71 | 1.75 1.26262
72 | 1.775 1.21345
73 | 1.8 1.15694
74 | 1.825 1.10054
75 | 1.85 1.05648
76 | 1.875 1.03189
77 | 1.9 0.982227
78 | 1.925 0.952203
79 | 1.95 0.925125
80 | 1.975 0.90477
81 | 2 0.884706
82 | 2.025 0.866786
83 | 2.05 0.851869
84 | 2.075 0.854722
85 | 2.1 0.830429
86 | 2.125 0.832093
87 | 2.15 0.818714
88 | 2.175 0.833712
89 | 2.2 0.829927
90 | 2.225 0.831175
91 | 2.25 0.845731
92 | 2.275 0.839667
93 | 2.3 0.86234
94 | 2.325 0.875564
95 | 2.35 0.89223
96 | 2.375 0.899582
97 | 2.4 0.913197
98 | 2.425 0.93675
99 | 2.45 0.93675
100 | 2.475 0.965808
101 | 2.5 0.968371
102 | 2.525 0.986767
103 | 2.55 1.00093
104 | 2.575 0.995883
105 | 2.6 1.01663
106 | 2.625 1.0327
107 | 2.65 1.03906
108 | 2.675 1.04684
109 | 2.7 1.04485
110 | 2.725 1.06558
111 | 2.75 1.05131
112 | 2.775 1.07229
113 | 2.8 1.06216
114 | 2.825 1.06612
115 | 2.85 1.06778
116 | 2.875 1.04973
117 | 2.9 1.05321
118 | 2.925 1.06046
119 | 2.95 1.05682
120 | 2.975 1.06079
121 | 3 1.04611
122 | 3.025 1.04423
123 | 3.05 1.03256
124 | 3.075 1.03311
125 | 3.1 1.03401
126 | 3.125 1.02275
127 | 3.15 1.02165
128 | 3.175 1.0128
129 | 3.2 1.00631
130 | 3.225 0.999732
131 | 3.25 0.995858
132 | 3.275 0.997422
133 | 3.3 0.993471
134 | 3.325 0.992834
135 | 3.35 0.992568
136 | 3.375 0.980184
137 | 3.4 0.982292
138 | 3.425 0.979832
139 | 3.45 0.980662
140 | 3.475 0.974942
141 | 3.5 0.987442
142 | 3.525 0.975922
143 | 3.55 0.979807
144 | 3.575 0.982175
145 | 3.6 0.978966
146 | 3.625 0.986024
147 | 3.65 0.981646
148 | 3.675 0.979987
149 | 3.7 0.982654
150 | 3.725 0.978498
151 | 3.75 0.983104
152 | 3.775 0.995
153 | 3.8 0.98475
154 | 3.825 0.999378
155 | 3.85 1.00454
156 | 3.875 1.0036
157 | 3.9 0.994945
158 | 3.925 1.00486
159 | 3.95 1.00237
160 | 3.975 1.00196
161 | 4 1.0103
162 | 4.025 1.01528
163 | 4.05 1.00907
164 | 4.075 1.01096
165 | 4.1 1.00708
166 | 4.125 1.00403
167 | 4.15 1.00802
168 | 4.175 1.01443
169 | 4.2 1.01285
170 | 4.225 1.00767
171 | 4.25 1.00745
172 | 4.275 1.01301
173 | 4.3 1.01036
174 | 4.325 1.00657
175 | 4.35 1.00384
176 | 4.375 1.00371
177 | 4.4 1.00044
178 | 4.425 1.00326
179 | 4.45 1.00137
180 | 4.475 1.00545
181 | 4.5 1.00006
182 | 4.525 1.00315
183 | 4.55 1.00036
184 | 4.575 1.00028
185 | 4.6 0.999741
186 | 4.625 1.00937
187 | 4.65 0.9978
188 | 4.675 0.999239
189 | 4.7 1.0039
190 | 4.725 1.00128
191 | 4.75 0.998765
192 | 4.775 0.991327
193 | 4.8 1.00171
194 | 4.825 0.99314
195 | 4.85 0.994734
196 | 4.875 0.994286
197 | 4.9 0.998199
198 | 4.925 1.0024
199 | 4.95 1.0009
200 | 4.975 1.0005
201 | 5 1.00046
202 |
--------------------------------------------------------------------------------
/msibi/tutorials/propane/rdfs/C3-C3-state_C.txt:
--------------------------------------------------------------------------------
1 | 0 0
2 | 0.025 0
3 | 0.05 0
4 | 0.075 0
5 | 0.1 0
6 | 0.125 0
7 | 0.15 0
8 | 0.175 0
9 | 0.2 0
10 | 0.225 0
11 | 0.25 0
12 | 0.275 0
13 | 0.3 0
14 | 0.325 0
15 | 0.35 0
16 | 0.375 0
17 | 0.4 0
18 | 0.425 0
19 | 0.45 0
20 | 0.475 0
21 | 0.5 0
22 | 0.525 0
23 | 0.55 0
24 | 0.575 0
25 | 0.6 0
26 | 0.625 0
27 | 0.65 0
28 | 0.675 0
29 | 0.7 0
30 | 0.725 0
31 | 0.75 0
32 | 0.775 0
33 | 0.8 0
34 | 0.825 0
35 | 0.85 0
36 | 0.875 0
37 | 0.9 0
38 | 0.925 0
39 | 0.95 0
40 | 0.975 0
41 | 1 0.00296389
42 | 1.025 0.00423417
43 | 1.05 0.0107661
44 | 1.075 0.0475301
45 | 1.1 0.0969736
46 | 1.125 0.190213
47 | 1.15 0.272055
48 | 1.175 0.392159
49 | 1.2 0.535298
50 | 1.225 0.72123
51 | 1.25 0.943632
52 | 1.275 1.09614
53 | 1.3 1.3467
54 | 1.325 1.52698
55 | 1.35 1.61222
56 | 1.375 1.82533
57 | 1.4 1.89303
58 | 1.425 1.96745
59 | 1.45 2.08757
60 | 1.475 2.16356
61 | 1.5 2.13115
62 | 1.525 2.08426
63 | 1.55 2.1718
64 | 1.575 2.1594
65 | 1.6 2.10173
66 | 1.625 2.09924
67 | 1.65 2.05417
68 | 1.675 1.97082
69 | 1.7 1.90074
70 | 1.725 1.86204
71 | 1.75 1.8497
72 | 1.775 1.78501
73 | 1.8 1.67691
74 | 1.825 1.65679
75 | 1.85 1.56925
76 | 1.875 1.58382
77 | 1.9 1.48204
78 | 1.925 1.46266
79 | 1.95 1.44299
80 | 1.975 1.37461
81 | 2 1.33579
82 | 2.025 1.31017
83 | 2.05 1.27967
84 | 2.075 1.275
85 | 2.1 1.24126
86 | 2.125 1.23667
87 | 2.15 1.21929
88 | 2.175 1.19983
89 | 2.2 1.18529
90 | 2.225 1.17078
91 | 2.25 1.14565
92 | 2.275 1.14484
93 | 2.3 1.1242
94 | 2.325 1.10807
95 | 2.35 1.13237
96 | 2.375 1.076
97 | 2.4 1.09375
98 | 2.425 1.06837
99 | 2.45 1.08812
100 | 2.475 1.08134
101 | 2.5 1.06257
102 | 2.525 1.08044
103 | 2.55 1.03609
104 | 2.575 1.06178
105 | 2.6 1.07895
106 | 2.625 1.042
107 | 2.65 1.04652
108 | 2.675 1.0425
109 | 2.7 1.06157
110 | 2.725 1.06052
111 | 2.75 1.03683
112 | 2.775 1.00619
113 | 2.8 1.03141
114 | 2.825 1.04785
115 | 2.85 1.04705
116 | 2.875 1.03301
117 | 2.9 1.02932
118 | 2.925 1.0441
119 | 2.95 1.02118
120 | 2.975 1.02748
121 | 3 1.0331
122 | 3.025 1.01699
123 | 3.05 1.02621
124 | 3.075 1.03373
125 | 3.1 1.04008
126 | 3.125 1.0015
127 | 3.15 1.03343
128 | 3.175 1.03179
129 | 3.2 1.03066
130 | 3.225 1.00205
131 | 3.25 1.00531
132 | 3.275 1.01749
133 | 3.3 1.00607
134 | 3.325 1.02488
135 | 3.35 1.01628
136 | 3.375 1.01974
137 | 3.4 1.01737
138 | 3.425 1.01073
139 | 3.45 1.01659
140 | 3.475 1.00232
141 | 3.5 1.03022
142 | 3.525 0.99543
143 | 3.55 0.995634
144 | 3.575 1.01498
145 | 3.6 1.0281
146 | 3.625 1.01184
147 | 3.65 0.997846
148 | 3.675 1.00738
149 | 3.7 0.998266
150 | 3.725 1.0289
151 | 3.75 0.99316
152 | 3.775 1.00371
153 | 3.8 0.998534
154 | 3.825 1.00424
155 | 3.85 1.0089
156 | 3.875 0.999082
157 | 3.9 1.02278
158 | 3.925 1.00346
159 | 3.95 0.996261
160 | 3.975 0.999478
161 | 4 0.999141
162 | 4.025 1.00629
163 | 4.05 1.0187
164 | 4.075 0.995549
165 | 4.1 1.00899
166 | 4.125 0.99382
167 | 4.15 1.00209
168 | 4.175 1.00246
169 | 4.2 1.00387
170 | 4.225 1.00619
171 | 4.25 1.00914
172 | 4.275 0.998725
173 | 4.3 1.00621
174 | 4.325 1.00305
175 | 4.35 0.989747
176 | 4.375 0.983472
177 | 4.4 1.00607
178 | 4.425 1.00132
179 | 4.45 0.992959
180 | 4.475 1.01233
181 | 4.5 1.01778
182 | 4.525 0.998039
183 | 4.55 0.993919
184 | 4.575 1.01567
185 | 4.6 0.982628
186 | 4.625 0.989017
187 | 4.65 1.00528
188 | 4.675 0.992508
189 | 4.7 0.995893
190 | 4.725 0.995767
191 | 4.75 0.999742
192 | 4.775 0.993372
193 | 4.8 0.992983
194 | 4.825 1.00489
195 | 4.85 0.997149
196 | 4.875 1.00122
197 | 4.9 0.996219
198 | 4.925 0.995193
199 | 4.95 1.00247
200 | 4.975 1.00844
201 | 5 1.0125
202 |
--------------------------------------------------------------------------------
/msibi/tutorials/propane/state_A/hoomd_run_template.py:
--------------------------------------------------------------------------------
1 | all = hoomd.group.all()
2 | nvt_int = hoomd.md.integrate.langevin(group=all, kT=T_final, seed=1)
3 | hoomd.md.integrate.mode_standard(dt=0.001)
4 |
5 | hoomd.run(1e2)
6 | output_dcd = hoomd.dump.dcd(filename='query.dcd', period=100, overwrite=True)
7 | hoomd.run(1e4)
8 |
--------------------------------------------------------------------------------
/msibi/tutorials/propane/state_B/hoomd_run_template.py:
--------------------------------------------------------------------------------
1 | all = hoomd.group.all()
2 | nvt_int = hoomd.md.integrate.langevin(group=all, kT=T_final, seed=1)
3 | hoomd.md.integrate.mode_standard(dt=0.001)
4 |
5 | hoomd.run(1e2)
6 | output_dcd = hoomd.dump.dcd(filename='query.dcd', period=100, overwrite=True)
7 | hoomd.run(1e4)
8 |
--------------------------------------------------------------------------------
/msibi/tutorials/propane/state_C/hoomd_run_template.py:
--------------------------------------------------------------------------------
1 | all = hoomd.group.all()
2 | nvt_int = hoomd.md.integrate.langevin(group=all, kT=T_final, seed=1)
3 | hoomd.md.integrate.mode_standard(dt=0.001)
4 |
5 | hoomd.run(1e2)
6 | output_dcd = hoomd.dump.dcd(filename='query.dcd', period=100, overwrite=True)
7 | hoomd.run(1e4)
8 |
--------------------------------------------------------------------------------
/msibi/utils/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/msibi/utils/__init__.py
--------------------------------------------------------------------------------
/msibi/utils/error_calculation.py:
--------------------------------------------------------------------------------
1 | ##############################################################################
2 | # MSIBI: A package for optimizing coarse-grained force fields using multistate
3 | # iterative Boltzmann inversion.
4 | # Copyright (c) 2017 Vanderbilt University and the Authors
5 | #
6 | # Authors: Christoph Klein, Timothy C. Moore
7 | #
8 | # Permission is hereby granted, free of charge, to any person obtaining a copy
9 | # of this software and associated documentation files, to deal
10 | # in MSIBI without restriction, including without limitation the rights
11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | # # copies of MSIBI, and to permit persons to whom MSIBI is
13 | # furnished to do so, subject to the following conditions:
14 | #
15 | # The above copyright notice and this permission notice shall be included in all
16 | # copies or substantial portions of MSIBI.
17 | #
18 | # MSIBI IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | # OUT OF OR IN CONNECTION WITH MSIBI OR THE USE OR OTHER DEALINGS ALONG WITH
24 | # MSIBI.
25 | #
26 | # You should have received a copy of the MIT license.
27 | # If not, see .
28 | ##############################################################################
29 |
30 | from __future__ import division
31 |
32 | import numpy as np
33 |
34 |
35 | def calc_similarity(arr1, arr2):
36 | f_fit = np.sum(np.absolute(arr1 - arr2))
37 | f_fit /= np.sum((np.absolute(arr1) + np.absolute(arr2)))
38 | return 1.0 - f_fit
39 |
--------------------------------------------------------------------------------
/msibi/utils/exceptions.py:
--------------------------------------------------------------------------------
1 | ##############################################################################
2 | # MSIBI: A package for optimizing coarse-grained force fields using multistate
3 | # iterative Boltzmann inversion.
4 | # Copyright (c) 2017 Vanderbilt University and the Authors
5 | #
6 | # Authors: Christoph Klein, Timothy C. Moore
7 | #
8 | # Permission is hereby granted, free of charge, to any person obtaining a copy
9 | # of this software and associated documentation files, to deal
10 | # in MSIBI without restriction, including without limitation the rights
11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | # # copies of MSIBI, and to permit persons to whom MSIBI is
13 | # furnished to do so, subject to the following conditions:
14 | #
15 | # The above copyright notice and this permission notice shall be included in all
16 | # copies or substantial portions of MSIBI.
17 | #
18 | # MSIBI IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | # OUT OF OR IN CONNECTION WITH MSIBI OR THE USE OR OTHER DEALINGS ALONG WITH
24 | # MSIBI.
25 | #
26 | # You should have received a copy of the MIT license.
27 | # If not, see .
28 | ##############################################################################
29 |
30 | SUPPORTED_ENGINES = ['hoomd']
31 |
32 |
33 | class UnsupportedEngine(Exception):
34 | def __init__(self, engine):
35 | message = 'Unsupported engine: "{0}". Supported engines are: {1}'.format(
36 | engine, ', '.join(SUPPORTED_ENGINES))
37 | super(UnsupportedEngine, self).__init__(message)
38 |
--------------------------------------------------------------------------------
/msibi/utils/find_exclusions.py:
--------------------------------------------------------------------------------
1 | ##############################################################################
2 | # MSIBI: A package for optimizing coarse-grained force fields using multistate
3 | # iterative Boltzmann inversion.
4 | # Copyright (c) 2017 Vanderbilt University and the Authors
5 | #
6 | # Authors: Christoph Klein, Timothy C. Moore
7 | #
8 | # Permission is hereby granted, free of charge, to any person obtaining a copy
9 | # of this software and associated documentation files, to deal
10 | # in MSIBI without restriction, including without limitation the rights
11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | # # copies of MSIBI, and to permit persons to whom MSIBI is
13 | # furnished to do so, subject to the following conditions:
14 | #
15 | # The above copyright notice and this permission notice shall be included in all
16 | # copies or substantial portions of MSIBI.
17 | #
18 | # MSIBI IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | # OUT OF OR IN CONNECTION WITH MSIBI OR THE USE OR OTHER DEALINGS ALONG WITH
24 | # MSIBI.
25 | #
26 | # You should have received a copy of the MIT license.
27 | # If not, see .
28 | ##############################################################################
29 |
30 | import networkx as nx
31 | from networkx import NetworkXNoPath
32 | import numpy as np
33 |
34 | def find_1_n_exclusions(top, pairs, n):
35 | """Find exclusions in a trajectory based on an exculsion principle
36 |
37 | Parameters
38 | ----------
39 | top : mdtraj.Topology
40 | Topology object containing the types and list of bonds
41 | pairs : array-like, shape=(n_pairs, 2), dtype=int
42 | Each row gives the indices of two atoms.
43 | n : int
44 | Exclude particles in pairs separated by n or fewer bonds
45 | """
46 | G = nx.Graph()
47 | G.add_nodes_from([a.index for a in top.atoms])
48 | bonds = [b for b in top.bonds]
49 | bonds_by_index = [(b[0].index, b[1].index) for b in bonds]
50 | G.add_edges_from(bonds_by_index)
51 | to_exclude = []
52 | # TODO: make faster by looping over bonds instead of pairs
53 | for i, pair in enumerate(pairs):
54 | if is_1_n(pair, n, G) == True:
55 | to_exclude.append(i)
56 | return np.asarray(to_exclude)
57 |
58 |
59 | def is_1_n(pair, n, G):
60 | """Find if atoms in a pair are separated by n or less bonds
61 |
62 | Parameters
63 | ----------
64 | n : int
65 | Return false atoms in pair are separated by n or fewer bonds
66 | pair : [int, int]
67 | Pair of atom indices
68 | G : networkx.Graph
69 | A graph with atoms and nodes and bonds as edges
70 |
71 | Returns
72 | -------
73 | answer : bool
74 | answer == True if atoms are separated by n or fewer bonds, False otherwise
75 |
76 | The graph is expected to have atom indices as nodes, and tuples of atom indices as
77 | edges. Ideally, the nodes would be MDTraj.Atom-s and edges a list of tuples of
78 | MDTraj.Atom-s
79 | try:
80 | return n > len(nx.shortest_path(G, pair[0], pair[1])) - 1
81 | except: # no path between pair[0] and pair[1]
82 | return False
83 | """
84 | try:
85 | return n > len(nx.shortest_path(G, pair[0], pair[1])) - 1
86 | except NetworkXNoPath:
87 | return False
88 |
--------------------------------------------------------------------------------
/msibi/utils/general.py:
--------------------------------------------------------------------------------
1 | ##############################################################################
2 | # MSIBI: A package for optimizing coarse-grained force fields using multistate
3 | # iterative Boltzmann inversion.
4 | # Copyright (c) 2017 Vanderbilt University and the Authors
5 | #
6 | # Authors: Christoph Klein, Timothy C. Moore
7 | #
8 | # Permission is hereby granted, free of charge, to any person obtaining a copy
9 | # of this software and associated documentation files, to deal
10 | # in MSIBI without restriction, including without limitation the rights
11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | # # copies of MSIBI, and to permit persons to whom MSIBI is
13 | # furnished to do so, subject to the following conditions:
14 | #
15 | # The above copyright notice and this permission notice shall be included in all
16 | # copies or substantial portions of MSIBI.
17 | #
18 | # MSIBI IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | # OUT OF OR IN CONNECTION WITH MSIBI OR THE USE OR OTHER DEALINGS ALONG WITH
24 | # MSIBI.
25 | #
26 | # You should have received a copy of the MIT license.
27 | # If not, see .
28 | ##############################################################################
29 |
30 | import glob
31 | import os
32 | from pkg_resources import resource_filename
33 | import shutil
34 |
35 | import numpy as np
36 |
37 |
38 | def get_fn(name):
39 | """Get the full path to one of the reference files shipped for testing.
40 |
41 | This function is taken straight from MDTraj (see https://github.com/mdtraj/mdtraj).
42 | In the source distribution, these files are in ``msibi/utils/reference``,
43 | but on istallation, they're moved to somewhere in the user's python
44 | site-packages directory.
45 |
46 | Parameters
47 | ----------
48 | name : str
49 | Name of the file ot load (with respecto to the reference/ directory).
50 |
51 | Examples
52 | ________
53 | >>> import mdtraj as md
54 | >>> t = md.load(get_fun('final.hoomdxml'))
55 | """
56 |
57 | fn = resource_filename('msibi', os.path.join('utils', 'reference', name))
58 |
59 | if not os.path.exists(fn):
60 | raise ValueError('Sorry! %s does not exist. If you just '
61 | 'added it, you\'ll have to re install' % fn)
62 |
63 | return fn
64 |
65 |
66 | def find_nearest(array, target):
67 | """Find array component whose numeric value is closest to 'target'. """
68 | idx = np.abs(array - target).argmin()
69 | return idx, array[idx]
70 |
71 |
72 | def _count_backups(filename):
73 | """Count the number of backups of a file in a directory. """
74 | head, tail = os.path.split(filename)
75 | backup_files = ''.join(['_.*.', tail])
76 | return len(glob.glob(os.path.join(head, backup_files)))
77 |
78 |
79 | def _backup_name(filename, n_backups):
80 | """Return backup filename based on the number of existing backups.
81 |
82 | Parameters
83 | ----------
84 | filename : str
85 | Full path to file to make backup of.
86 | n_backups : int
87 | Number of existing backups.
88 |
89 | """
90 | head, tail = os.path.split(filename)
91 | new_backup = ''.join(['_.{0:d}.'.format(n_backups), tail])
92 | return os.path.join(head, new_backup)
93 |
94 |
95 | def backup_file(filename):
96 | """Backup a file based on the number of backups in the file's directory.
97 |
98 | Parameters
99 | ----------
100 | filename : str
101 | Full path to file to make backup of.
102 |
103 | """
104 | n_backups = _count_backups(filename)
105 | new_backup = _backup_name(filename, n_backups)
106 | shutil.copy(filename, new_backup)
107 |
--------------------------------------------------------------------------------
/msibi/utils/reference/2chains.hoomdxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | -2.7333316803 -2.46567463875 0.55542576313
7 | -2.72046780586 -2.46154713631 1.02677297592
8 | -2.80130243301 -2.46441173553 1.56453490257
9 | -2.91316199303 -2.44769048691 2.08861136436
10 | -2.87734794617 -2.27416229248 2.58729457855
11 | -2.7680990696 -2.2819275856 3.07851672173
12 | -2.29131817818 -2.29085230827 3.05982160568
13 | -2.05989289284 -2.20904803276 2.53355431557
14 | -2.03481507301 -2.22300314903 1.9820330143
15 | -2.00645232201 -2.20227694511 1.38646674156
16 | -1.92186760902 -2.39061784744 0.853813171387
17 | -1.97674882412 -2.21867656708 0.322696864605
18 | -2.20922231674 -2.5525393486 3.35658693314
19 | -2.02347803116 -2.05300593376 3.07850694656
20 | -1.35115528107 -3.29404234886 -0.347912281752
21 | -1.3077236414 -3.2197394371 -0.885239481926
22 | -1.36111533642 -3.08145642281 -1.37002539635
23 | -1.36416041851 -3.004601717 -1.94559442997
24 | -1.28880751133 -2.95457053185 -2.45670771599
25 | -1.4447606802 -3.07918691635 -2.91643261909
26 | -1.78900539875 -3.41477632523 -2.93149352074
27 | -2.04393744469 -3.44978022575 -2.4506289959
28 | -2.09815168381 -3.3438911438 -1.89779162407
29 | -1.97417390347 -3.43454241753 -1.38360655308
30 | -1.98977410793 -3.61914563179 -0.832499086857
31 | -2.03277039528 -3.73046851158 -0.282502353191
32 | -1.83023786545 -3.12718200684 -3.19096660614
33 | -1.74684906006 -3.72490954399 -2.80147957802
34 |
35 |
36 | 0.597922980785
37 | 0.583921015263
38 | 0.583921015263
39 | 0.583921015263
40 | 0.583921015263
41 | 0.597075998783
42 | 0.555985987186
43 | 0.555971980095
44 | 0.583921015263
45 | 0.583921015263
46 | 0.583921015263
47 | 0.597922980785
48 | 0.236021995544
49 | 0.236021995544
50 | 0.597922980785
51 | 0.583921015263
52 | 0.583921015263
53 | 0.583921015263
54 | 0.583921015263
55 | 0.597075998783
56 | 0.555985987186
57 | 0.555971980095
58 | 0.583921015263
59 | 0.583921015263
60 | 0.583921015263
61 | 0.597922980785
62 | 0.236021995544
63 | 0.236021995544
64 |
65 |
66 | tail
67 | tail
68 | tail
69 | tail
70 | tail
71 | amide
72 | mhead2
73 | tail
74 | tail
75 | tail
76 | tail
77 | tail
78 | stick1
79 | stick2
80 | tail
81 | tail
82 | tail
83 | tail
84 | tail
85 | amide
86 | mhead2
87 | tail
88 | tail
89 | tail
90 | tail
91 | tail
92 | stick1
93 | stick2
94 |
95 |
96 | bond0 0 1
97 | bond0 1 2
98 | bond0 2 3
99 | bond0 3 4
100 | bond1 4 5
101 | bond2 5 6
102 | bond3 6 7
103 | bond0 7 8
104 | bond0 8 9
105 | bond0 9 10
106 | bond0 10 11
107 | bond4 6 12
108 | bond5 6 13
109 | bond0 14 15
110 | bond0 15 16
111 | bond0 16 17
112 | bond0 17 18
113 | bond1 18 19
114 | bond2 19 20
115 | bond3 20 21
116 | bond0 21 22
117 | bond0 22 23
118 | bond0 23 24
119 | bond0 24 25
120 | bond4 20 26
121 | bond5 20 27
122 |
123 |
124 | angle0 0 1 2
125 | angle0 1 2 3
126 | angle0 2 3 4
127 | angle0 3 4 5
128 | angle1 4 5 6
129 | angle2 5 6 7
130 | angle0 6 7 8
131 | angle0 7 8 9
132 | angle0 8 9 10
133 | angle0 9 10 11
134 | angle3 5 6 12
135 | angle4 5 6 13
136 | angle5 7 6 12
137 | angle6 7 6 13
138 | angle7 12 6 13
139 | angle0 14 15 16
140 | angle0 15 16 17
141 | angle0 16 17 18
142 | angle0 17 18 19
143 | angle1 18 19 20
144 | angle2 19 20 21
145 | angle0 20 21 22
146 | angle0 21 22 23
147 | angle0 22 23 24
148 | angle0 23 24 25
149 | angle3 19 20 26
150 | angle4 19 20 27
151 | angle5 21 20 26
152 | angle6 21 20 27
153 | angle7 26 20 27
154 |
155 |
156 |
157 |
158 |
159 |
160 | 0
161 | 0
162 | 0
163 | 0
164 | 0
165 | 0
166 | 0
167 | 0
168 | 0
169 | 0
170 | 0
171 | 0
172 | 0
173 | 0
174 | 0
175 | 0
176 | 0
177 | 0
178 | 0
179 | 0
180 | 0
181 | 0
182 | 0
183 | 0
184 | 0
185 | 0
186 | 0
187 | 0
188 |
189 |
190 |
191 |
--------------------------------------------------------------------------------
/msibi/utils/reference/state0/err.txt:
--------------------------------------------------------------------------------
1 | [vmp840:19487] mca: base: component_find: unable to open /usr/local/openmpi/1.4.4/x86_64/gcc46/lib/openmpi/mca_plm_tm: perhaps a missing symbol, or compiled for a different version of Open MPI? (ignored)
2 | [vmp840:19487] mca: base: component_find: unable to open /usr/local/openmpi/1.4.4/x86_64/gcc46/lib/openmpi/mca_ras_tm: perhaps a missing symbol, or compiled for a different version of Open MPI? (ignored)
3 | *Warning*: Syntax bond.harmonic.set_coeff deprecated.
4 | *Warning*: Syntax bond.harmonic.set_coeff deprecated.
5 | *Warning*: Syntax bond.harmonic.set_coeff deprecated.
6 | *Warning*: Syntax bond.harmonic.set_coeff deprecated.
7 | *Warning*: Syntax bond.harmonic.set_coeff deprecated.
8 | *Warning*: Syntax bond.harmonic.set_coeff deprecated.
9 | *Warning*: Syntax bond.harmonic.set_coeff deprecated.
10 |
--------------------------------------------------------------------------------
/msibi/utils/reference/state0/hoomd_run_template.py:
--------------------------------------------------------------------------------
1 | all = group.all()
2 | nvt_int = integrate.bdnvt(group=all, T=T_final)
3 | integrate.mode_standard(dt=0.001)
4 |
5 |
6 | run(5000)
7 | output_dcd = dump.dcd(filename="query.dcd", period=1e3, overwrite=True)
8 | run(50000)
9 |
10 | output_xml = dump.xml()
11 | output_xml.set_params(all=True)
12 | output_xml.write(filename="final.xml")
13 |
--------------------------------------------------------------------------------
/msibi/utils/reference/state0/query.dcd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/msibi/utils/reference/state0/query.dcd
--------------------------------------------------------------------------------
/msibi/utils/reference/state0/target-rdf.txt:
--------------------------------------------------------------------------------
1 | 0 0
2 | 0.0166667 0
3 | 0.0333333 0
4 | 0.05 0
5 | 0.0666667 0
6 | 0.0833333 0
7 | 0.1 0
8 | 0.116667 0
9 | 0.133333 0
10 | 0.15 0
11 | 0.166667 0
12 | 0.183333 0
13 | 0.2 0
14 | 0.216667 0
15 | 0.233333 0
16 | 0.25 0
17 | 0.266667 0
18 | 0.283333 0
19 | 0.3 0
20 | 0.316667 0
21 | 0.333333 0
22 | 0.35 0
23 | 0.366667 0
24 | 0.383333 0
25 | 0.4 0
26 | 0.416667 0
27 | 0.433333 0
28 | 0.45 0
29 | 0.466667 0
30 | 0.483333 0
31 | 0.5 0
32 | 0.516667 0
33 | 0.533333 0
34 | 0.55 0
35 | 0.566667 8.63518e-05
36 | 0.583333 0.000883521
37 | 0.6 0.00452604
38 | 0.616667 0.019198
39 | 0.633333 0.0549186
40 | 0.65 0.131981
41 | 0.666667 0.254326
42 | 0.683333 0.414561
43 | 0.7 0.609593
44 | 0.716667 0.802999
45 | 0.733333 0.978938
46 | 0.75 1.12114
47 | 0.766667 1.23726
48 | 0.783333 1.33056
49 | 0.8 1.4215
50 | 0.816667 1.49667
51 | 0.833333 1.56309
52 | 0.85 1.62478
53 | 0.866667 1.67197
54 | 0.883333 1.69845
55 | 0.9 1.67672
56 | 0.916667 1.61493
57 | 0.933333 1.53568
58 | 0.95 1.46078
59 | 0.966667 1.38933
60 | 0.983333 1.33482
61 | 1 1.26782
62 | 1.01667 1.19002
63 | 1.03333 1.1061
64 | 1.05 1.02777
65 | 1.06667 0.959775
66 | 1.08333 0.91451
67 | 1.1 0.878737
68 | 1.11667 0.855217
69 | 1.13333 0.83591
70 | 1.15 0.822076
71 | 1.16667 0.796467
72 | 1.18333 0.783877
73 | 1.2 0.771965
74 | 1.21667 0.763578
75 | 1.23333 0.761449
76 | 1.25 0.764973
77 | 1.26667 0.773438
78 | 1.28333 0.786288
79 | 1.3 0.798328
80 | 1.31667 0.813496
81 | 1.33333 0.832485
82 | 1.35 0.854556
83 | 1.36667 0.877693
84 | 1.38333 0.910023
85 | 1.4 0.935884
86 | 1.41667 0.969893
87 | 1.43333 0.990216
88 | 1.45 1.01735
89 | 1.46667 1.03598
90 | 1.48333 1.05744
91 | 1.5 1.06812
92 | 1.51667 1.07721
93 | 1.53333 1.08528
94 | 1.55 1.09663
95 | 1.56667 1.11161
96 | 1.58333 1.12913
97 | 1.6 1.14936
98 | 1.61667 1.17015
99 | 1.63333 1.17594
100 | 1.65 1.16913
101 | 1.66667 1.14929
102 | 1.68333 1.12217
103 | 1.7 1.09748
104 | 1.71667 1.07495
105 | 1.73333 1.05946
106 | 1.75 1.04446
107 | 1.76667 1.0368
108 | 1.78333 1.03066
109 | 1.8 1.02137
110 | 1.81667 1.00934
111 | 1.83333 0.990898
112 | 1.85 0.973054
113 | 1.86667 0.955302
114 | 1.88333 0.94063
115 | 1.9 0.931843
116 | 1.91667 0.922475
117 | 1.93333 0.919237
118 | 1.95 0.924236
119 | 1.96667 0.925599
120 | 1.98333 0.934766
121 | 2 0.943183
122 | 2.01667 0.948543
123 | 2.03333 0.952103
124 | 2.05 0.948398
125 | 2.06667 0.943758
126 | 2.08333 0.936261
127 | 2.1 0.93156
128 | 2.11667 0.927669
129 | 2.13333 0.925554
130 | 2.15 0.924349
131 | 2.16667 0.928554
132 | 2.18333 0.931112
133 | 2.2 0.931848
134 | 2.21667 0.934322
135 | 2.23333 0.935492
136 | 2.25 0.93166
137 | 2.26667 0.929361
138 | 2.28333 0.925228
139 | 2.3 0.920542
140 | 2.31667 0.915891
141 | 2.33333 0.907846
142 | 2.35 0.905299
143 | 2.36667 0.902062
144 | 2.38333 0.901072
145 | 2.4 0.900012
146 | 2.41667 0.90475
147 | 2.43333 0.906202
148 | 2.45 0.902537
149 | 2.46667 0.892637
150 | 2.48333 0.876248
151 | 2.5 0.861465
152 |
--------------------------------------------------------------------------------
/msibi/utils/reference/state1/hoomd_run_template.py:
--------------------------------------------------------------------------------
1 | all = group.all()
2 | nvt_int = integrate.bdnvt(group=all, T=T_final)
3 | integrate.mode_standard(dt=0.001)
4 |
5 |
6 | run(5000)
7 | output_dcd = dump.dcd(filename="query.dcd", period=1e3, overwrite=True)
8 | run(50000)
9 |
10 | output_xml = dump.xml()
11 | output_xml.set_params(all=True)
12 | output_xml.write(filename="final.xml")
13 |
--------------------------------------------------------------------------------
/msibi/utils/reference/state1/query.dcd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mosdef-hub/msibi/fe2bd543093531740cca4666721b0c0bb5be539f/msibi/utils/reference/state1/query.dcd
--------------------------------------------------------------------------------
/msibi/utils/reference/state1/target-rdf.txt:
--------------------------------------------------------------------------------
1 | 0 0
2 | 0.0166667 0
3 | 0.0333333 0
4 | 0.05 0
5 | 0.0666667 0
6 | 0.0833333 0
7 | 0.1 0
8 | 0.116667 0
9 | 0.133333 0
10 | 0.15 0
11 | 0.166667 0
12 | 0.183333 0
13 | 0.2 0
14 | 0.216667 0
15 | 0.233333 0
16 | 0.25 0
17 | 0.266667 0
18 | 0.283333 0
19 | 0.3 0
20 | 0.316667 0
21 | 0.333333 0
22 | 0.35 0
23 | 0.366667 0
24 | 0.383333 0
25 | 0.4 0
26 | 0.416667 0
27 | 0.433333 0
28 | 0.45 0
29 | 0.466667 0
30 | 0.483333 0
31 | 0.5 0
32 | 0.516667 0
33 | 0.533333 0
34 | 0.55 0
35 | 0.566667 8.63518e-05
36 | 0.583333 0.000883521
37 | 0.6 0.00452604
38 | 0.616667 0.019198
39 | 0.633333 0.0549186
40 | 0.65 0.131981
41 | 0.666667 0.254326
42 | 0.683333 0.414561
43 | 0.7 0.609593
44 | 0.716667 0.802999
45 | 0.733333 0.978938
46 | 0.75 1.12114
47 | 0.766667 1.23726
48 | 0.783333 1.33056
49 | 0.8 1.4215
50 | 0.816667 1.49667
51 | 0.833333 1.56309
52 | 0.85 1.62478
53 | 0.866667 1.67197
54 | 0.883333 1.69845
55 | 0.9 1.67672
56 | 0.916667 1.61493
57 | 0.933333 1.53568
58 | 0.95 1.46078
59 | 0.966667 1.38933
60 | 0.983333 1.33482
61 | 1 1.26782
62 | 1.01667 1.19002
63 | 1.03333 1.1061
64 | 1.05 1.02777
65 | 1.06667 0.959775
66 | 1.08333 0.91451
67 | 1.1 0.878737
68 | 1.11667 0.855217
69 | 1.13333 0.83591
70 | 1.15 0.822076
71 | 1.16667 0.796467
72 | 1.18333 0.783877
73 | 1.2 0.771965
74 | 1.21667 0.763578
75 | 1.23333 0.761449
76 | 1.25 0.764973
77 | 1.26667 0.773438
78 | 1.28333 0.786288
79 | 1.3 0.798328
80 | 1.31667 0.813496
81 | 1.33333 0.832485
82 | 1.35 0.854556
83 | 1.36667 0.877693
84 | 1.38333 0.910023
85 | 1.4 0.935884
86 | 1.41667 0.969893
87 | 1.43333 0.990216
88 | 1.45 1.01735
89 | 1.46667 1.03598
90 | 1.48333 1.05744
91 | 1.5 1.06812
92 | 1.51667 1.07721
93 | 1.53333 1.08528
94 | 1.55 1.09663
95 | 1.56667 1.11161
96 | 1.58333 1.12913
97 | 1.6 1.14936
98 | 1.61667 1.17015
99 | 1.63333 1.17594
100 | 1.65 1.16913
101 | 1.66667 1.14929
102 | 1.68333 1.12217
103 | 1.7 1.09748
104 | 1.71667 1.07495
105 | 1.73333 1.05946
106 | 1.75 1.04446
107 | 1.76667 1.0368
108 | 1.78333 1.03066
109 | 1.8 1.02137
110 | 1.81667 1.00934
111 | 1.83333 0.990898
112 | 1.85 0.973054
113 | 1.86667 0.955302
114 | 1.88333 0.94063
115 | 1.9 0.931843
116 | 1.91667 0.922475
117 | 1.93333 0.919237
118 | 1.95 0.924236
119 | 1.96667 0.925599
120 | 1.98333 0.934766
121 | 2 0.943183
122 | 2.01667 0.948543
123 | 2.03333 0.952103
124 | 2.05 0.948398
125 | 2.06667 0.943758
126 | 2.08333 0.936261
127 | 2.1 0.93156
128 | 2.11667 0.927669
129 | 2.13333 0.925554
130 | 2.15 0.924349
131 | 2.16667 0.928554
132 | 2.18333 0.931112
133 | 2.2 0.931848
134 | 2.21667 0.934322
135 | 2.23333 0.935492
136 | 2.25 0.93166
137 | 2.26667 0.929361
138 | 2.28333 0.925228
139 | 2.3 0.920542
140 | 2.31667 0.915891
141 | 2.33333 0.907846
142 | 2.35 0.905299
143 | 2.36667 0.902062
144 | 2.38333 0.901072
145 | 2.4 0.900012
146 | 2.41667 0.90475
147 | 2.43333 0.906202
148 | 2.45 0.902537
149 | 2.46667 0.892637
150 | 2.48333 0.876248
151 | 2.5 0.861465
152 |
--------------------------------------------------------------------------------
/msibi/utils/smoothing.py:
--------------------------------------------------------------------------------
1 | ##############################################################################
2 | # MSIBI: A package for optimizing coarse-grained force fields using multistate
3 | # iterative Boltzmann inversion.
4 | # Copyright (c) 2017 Vanderbilt University and the Authors
5 | #
6 | # Authors: Christoph Klein, Timothy C. Moore
7 | #
8 | # Permission is hereby granted, free of charge, to any person obtaining a copy
9 | # of this software and associated documentation files, to deal
10 | # in MSIBI without restriction, including without limitation the rights
11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 | # # copies of MSIBI, and to permit persons to whom MSIBI is
13 | # furnished to do so, subject to the following conditions:
14 | #
15 | # The above copyright notice and this permission notice shall be included in all
16 | # copies or substantial portions of MSIBI.
17 | #
18 | # MSIBI IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 | # OUT OF OR IN CONNECTION WITH MSIBI OR THE USE OR OTHER DEALINGS ALONG WITH
24 | # MSIBI.
25 | #
26 | # You should have received a copy of the MIT license.
27 | # If not, see .
28 | ##############################################################################
29 |
30 | from __future__ import division
31 |
32 | from math import factorial
33 |
34 | import numpy as np
35 |
36 |
37 | def savitzky_golay(y, window_size, order, deriv=0, rate=1):
38 | """
39 |
40 | Parameters
41 | ----------
42 | y:
43 | window_size:
44 | order:
45 | deriv:
46 | rate:
47 |
48 | Returns
49 | -------
50 |
51 | """
52 | if not (isinstance(window_size, int) and isinstance(order, int)):
53 | raise ValueError("window_size and order must be of type int")
54 | if window_size % 2 != 1 or window_size < 1:
55 | raise TypeError('window_size must be a positive odd number')
56 | if window_size < order + 2:
57 | raise TypeError('window_size is too small for the polynomials order')
58 |
59 | order_range = range(order+1)
60 | half_window = (window_size - 1) // 2
61 | b = np.mat([[k**i for i in order_range] for k in range(-half_window,
62 | half_window +1)])
63 | m = np.linalg.pinv(b).A[deriv] * rate**deriv * factorial(deriv)
64 | firstvals = y[0] - np.abs(y[1:half_window+1][::-1] - y[0])
65 | lastvals = y[-1] + np.abs(y[-half_window-1:-1][::-1] - y[-1])
66 | y = np.concatenate((firstvals, y, lastvals))
67 | return np.convolve(m[::-1], y, mode='valid')
68 |
--------------------------------------------------------------------------------
/msibi/workers.py:
--------------------------------------------------------------------------------
1 | ##############################################################################
2 | # MSIBI: A package for optimizing coarse-grained force fields using multistate
3 | # iterative Boltzmann inversion.
4 | # Copyright (c) 2017 Vanderbilt University and the Authors
5 | #
6 | # Authors: Christoph Klein, Timothy C. Moore
7 | # Contributors: Davy Yue
8 | #
9 | # Permission is hereby granted, free of charge, to any person obtaining a copy
10 | # of this software and associated documentation files, to deal
11 | # in MSIBI without restriction, including without limitation the rights
12 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | # # copies of MSIBI, and to permit persons to whom MSIBI is
14 | # furnished to do so, subject to the following conditions:
15 | #
16 | # The above copyright notice and this permission notice shall be included in all
17 | # copies or substantial portions of MSIBI.
18 | #
19 | # MSIBI IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | # OUT OF OR IN CONNECTION WITH MSIBI OR THE USE OR OTHER DEALINGS ALONG WITH
25 | # MSIBI.
26 | #
27 | # You should have received a copy of the MIT license.
28 | # If not, see .
29 | ##############################################################################
30 |
31 | from __future__ import print_function, division
32 |
33 | from distutils.spawn import find_executable
34 | import itertools
35 | import logging
36 | from math import ceil
37 | from multiprocessing import cpu_count
38 | from multiprocessing.dummy import Pool
39 | import os
40 | from subprocess import Popen
41 |
42 | from msibi.utils.general import backup_file
43 | from msibi.utils.exceptions import UnsupportedEngine
44 |
45 | logging.basicConfig(level=logging.DEBUG, format='[%(levelname)s] %(message)s')
46 |
47 |
48 | def run_query_simulations(states, engine='hoomd'):
49 | """Run all query simulations for a single iteration. """
50 |
51 | # Gather hardware info.
52 | gpus = _get_gpu_info()
53 | if gpus is None:
54 | n_procs = cpu_count()
55 | gpus = []
56 | logging.info("Launching {n_procs} CPU threads...".format(**locals()))
57 | else:
58 | n_procs = len(gpus)
59 | logging.info("Launching {n_procs} GPU threads...".format(**locals()))
60 |
61 | if engine.lower() == 'hoomd':
62 | worker = _hoomd_worker
63 | else:
64 | raise UnsupportedEngine(engine)
65 |
66 | n_states = len(states)
67 | worker_args = zip(states, range(n_states), itertools.repeat(gpus))
68 | chunk_size = ceil(n_states / n_procs)
69 |
70 | pool = Pool(n_procs)
71 | pool.imap(worker, worker_args, chunk_size)
72 | pool.close()
73 | pool.join()
74 |
75 |
76 | def _hoomd_worker(args):
77 | """Worker for managing a single HOOMD-blue simulation. """
78 |
79 | state, idx, gpus = args
80 | log_file = os.path.join(state.state_dir, 'log.txt')
81 | err_file = os.path.join(state.state_dir, 'err.txt')
82 |
83 | if state.HOOMD_VERSION == 1:
84 | executable = 'hoomd'
85 | elif state.HOOMD_VERSION == 2:
86 | executable = 'python'
87 | with open(log_file, 'w') as log, open(err_file, 'w') as err:
88 | if gpus:
89 | card = gpus[idx % len(gpus)]
90 | cmds = [executable, 'run.py', '--gpu={card}'.format(**locals())]
91 | else:
92 | logging.info(' Running state {state.name} on CPU'.format(**locals()))
93 | cmds = [executable, 'run.py']
94 |
95 | proc = Popen(cmds, cwd=state.state_dir, stdout=log, stderr=err,
96 | universal_newlines=True)
97 | logging.info(" Launched HOOMD in {state.state_dir}".format(**locals()))
98 | proc.communicate()
99 | logging.info(" Finished in {state.state_dir}.".format(**locals()))
100 | _post_query(state)
101 |
102 | def _post_query(state):
103 | """Reload the query trajectory and make backups. """
104 |
105 | state.reload_query_trajectory()
106 | backup_file(os.path.join(state.state_dir, 'log.txt'))
107 | backup_file(os.path.join(state.state_dir, 'err.txt'))
108 | if state.backup_trajectory:
109 | backup_file(state.traj_path)
110 |
111 | def _get_gpu_info():
112 | """ """
113 | nvidia_smi = find_executable('nvidia-smi')
114 | if not nvidia_smi:
115 | return
116 | else:
117 | gpus = [line.split()[1].replace(':', '') for
118 | line in os.popen('nvidia-smi -L').readlines()]
119 | return gpus
120 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | numpy
2 | six
3 | networkx
4 |
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | """"MSIBI: A package for optimizing coarse-grained force fields using multistate
2 | iterative Boltzmann inversion.
3 |
4 | """
5 |
6 | from setuptools import setup
7 | from setuptools.command.test import test as TestCommand
8 | import sys
9 |
10 | try:
11 | import mdtraj
12 | except ImportError:
13 | print('Building and running msibi requires mdtraj. See '
14 | 'http://mdtraj.org/latest/installation.html for help!')
15 | sys.exit(1)
16 |
17 | requirements = [line.strip() for line in open('requirements.txt').readlines()]
18 |
19 |
20 | class PyTest(TestCommand):
21 | def finalize_options(self):
22 | TestCommand.finalize_options(self)
23 | self.test_args = []
24 | self.test_suite = True
25 |
26 | def run_tests(self):
27 | import pytest
28 | errcode = pytest.main(['msibi'])
29 | sys.exit(errcode)
30 |
31 |
32 | setup(name='msibi',
33 | version='0.1',
34 | description='',
35 | url='http://github.com/mosdef-hub/misibi',
36 | author='Christoph Klein, Timothy C. Moore',
37 | author_email='christoph.klein@vanderbilt.edu, timothy.c.moore@vanderbilt.edu',
38 | license='MIT',
39 | packages=['msibi'],
40 | install_requires=requirements,
41 | zip_safe=False,
42 | test_suite='tests',
43 | cmdclass={'test': PyTest},
44 | extras_require={'utils': ['pytest']},
45 | )
46 |
--------------------------------------------------------------------------------