synth-dynamics 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- synth_dynamics-0.1.0/LICENSE +21 -0
- synth_dynamics-0.1.0/MANIFEST.in +9 -0
- synth_dynamics-0.1.0/PKG-INFO +100 -0
- synth_dynamics-0.1.0/README.md +69 -0
- synth_dynamics-0.1.0/docs/_build/html/.buildinfo +4 -0
- synth_dynamics-0.1.0/docs/_build/html/.doctrees/api.doctree +0 -0
- synth_dynamics-0.1.0/docs/_build/html/.doctrees/environment.pickle +0 -0
- synth_dynamics-0.1.0/docs/_build/html/.doctrees/index.doctree +0 -0
- synth_dynamics-0.1.0/docs/_build/html/.doctrees/usage.doctree +0 -0
- synth_dynamics-0.1.0/docs/_build/html/.nojekyll +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_modules/index.html +105 -0
- synth_dynamics-0.1.0/docs/_build/html/_modules/synth_dynamics/forcefield.html +165 -0
- synth_dynamics-0.1.0/docs/_build/html/_modules/synth_dynamics/integrator.html +147 -0
- synth_dynamics-0.1.0/docs/_build/html/_modules/synth_dynamics/simulation.html +148 -0
- synth_dynamics-0.1.0/docs/_build/html/_modules/synth_dynamics/system.html +133 -0
- synth_dynamics-0.1.0/docs/_build/html/_sources/api.rst.txt +36 -0
- synth_dynamics-0.1.0/docs/_build/html/_sources/index.rst.txt +20 -0
- synth_dynamics-0.1.0/docs/_build/html/_sources/usage.rst.txt +41 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/_sphinx_javascript_frameworks_compat.js +123 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/base-stemmer.js +476 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/basic.css +906 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/badge_only.css +1 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/fontawesome-webfont.eot +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/fontawesome-webfont.svg +2671 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/fontawesome-webfont.ttf +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/fontawesome-webfont.woff +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/lato-bold-italic.woff +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/lato-bold-italic.woff2 +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/lato-bold.woff +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/lato-bold.woff2 +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/lato-normal-italic.woff +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/lato-normal-italic.woff2 +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/lato-normal.woff +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/fonts/lato-normal.woff2 +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/css/theme.css +4 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/doctools.js +150 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/documentation_options.js +13 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/english-stemmer.js +1066 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/file.png +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-bold.eot +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-bold.ttf +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-bold.woff +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-bold.woff2 +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-bolditalic.eot +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-bolditalic.woff +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-italic.eot +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-italic.ttf +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-italic.woff +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-italic.woff2 +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-regular.eot +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-regular.ttf +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-regular.woff +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/Lato/lato-regular.woff2 +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/jquery.js +2 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/js/badge_only.js +1 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/js/theme.js +1 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/js/versions.js +228 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/language_data.js +13 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/minus.png +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/plus.png +0 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/pygments.css +75 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/searchtools.js +693 -0
- synth_dynamics-0.1.0/docs/_build/html/_static/sphinx_highlight.js +159 -0
- synth_dynamics-0.1.0/docs/_build/html/api.html +233 -0
- synth_dynamics-0.1.0/docs/_build/html/genindex.html +166 -0
- synth_dynamics-0.1.0/docs/_build/html/index.html +136 -0
- synth_dynamics-0.1.0/docs/_build/html/objects.inv +0 -0
- synth_dynamics-0.1.0/docs/_build/html/py-modindex.html +124 -0
- synth_dynamics-0.1.0/docs/_build/html/search.html +121 -0
- synth_dynamics-0.1.0/docs/_build/html/searchindex.js +1 -0
- synth_dynamics-0.1.0/docs/_build/html/usage.html +151 -0
- synth_dynamics-0.1.0/docs/api.rst +36 -0
- synth_dynamics-0.1.0/docs/conf.py +21 -0
- synth_dynamics-0.1.0/docs/index.rst +20 -0
- synth_dynamics-0.1.0/docs/usage.rst +41 -0
- synth_dynamics-0.1.0/examples/run_enm.py +20 -0
- synth_dynamics-0.1.0/pyproject.toml +47 -0
- synth_dynamics-0.1.0/setup.cfg +4 -0
- synth_dynamics-0.1.0/synth_dynamics/__init__.py +6 -0
- synth_dynamics-0.1.0/synth_dynamics/forcefield.py +57 -0
- synth_dynamics-0.1.0/synth_dynamics/integrator.py +39 -0
- synth_dynamics-0.1.0/synth_dynamics/simulation.py +40 -0
- synth_dynamics-0.1.0/synth_dynamics/system.py +28 -0
- synth_dynamics-0.1.0/synth_dynamics.egg-info/PKG-INFO +100 -0
- synth_dynamics-0.1.0/synth_dynamics.egg-info/SOURCES.txt +103 -0
- synth_dynamics-0.1.0/synth_dynamics.egg-info/dependency_links.txt +1 -0
- synth_dynamics-0.1.0/synth_dynamics.egg-info/requires.txt +7 -0
- synth_dynamics-0.1.0/synth_dynamics.egg-info/top_level.txt +1 -0
- synth_dynamics-0.1.0/tests/test_engine.py +78 -0
- synth_dynamics-0.1.0/tests/test_integration.py +66 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 George Elkins
|
|
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.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: synth-dynamics
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Time-Resolved Ensemble Generator using Coarse-Grained ENM Langevin Dynamics
|
|
5
|
+
Author: George Elkins
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/georgeelkins/synth-dynamics
|
|
8
|
+
Project-URL: Repository, https://github.com/georgeelkins/synth-dynamics
|
|
9
|
+
Project-URL: Documentation, https://synth-dynamics.readthedocs.io/
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/georgeelkins/synth-dynamics/issues
|
|
11
|
+
Keywords: molecular-dynamics,protein-dynamics,ANM,Langevin,ensemble-generation
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Operating System :: OS Independent
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: numpy
|
|
25
|
+
Requires-Dist: MDAnalysis
|
|
26
|
+
Requires-Dist: scipy
|
|
27
|
+
Provides-Extra: docs
|
|
28
|
+
Requires-Dist: sphinx; extra == "docs"
|
|
29
|
+
Requires-Dist: sphinx_rtd_theme; extra == "docs"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# synth-dynamics: Time-Resolved Ensemble Generator
|
|
33
|
+
|
|
34
|
+
`synth-dynamics` is a fast, lightweight molecular dynamics engine designed to generate meaningful conformational ensembles of proteins. Unlike full-atom simulations (like GROMACS or Amber), `synth-dynamics` uses a **Coarse-Grained Anisotropic Network Model (ANM)** and **Langevin dynamics** to capture the essential global motions of proteins with minimal computational overhead.
|
|
35
|
+
|
|
36
|
+
This tool is designed to bridge the gap between static structures and time-averaged experimental observables, such as NMR relaxation parameters, SAXS Kratky plots, or FRET efficiency distributions.
|
|
37
|
+
|
|
38
|
+
## Key Features
|
|
39
|
+
|
|
40
|
+
- **Coarse-Grained Simulation**: Models proteins using C-alpha atoms and harmonic "spring" networks.
|
|
41
|
+
- **Fast Langevin Engine**: Propagates coordinates using a stable, overdamped Langevin integrator.
|
|
42
|
+
- **Experimental Integration**: Perfect for generating the structural ensembles needed for `synth-nmr` or `synth-saxs`.
|
|
43
|
+
- **Easy to Use**: Simple API for loading PDBs, configuring forcefields, and running simulations.
|
|
44
|
+
- **Extensively Tested**: 100% test coverage ensuring reliability and correctness.
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
`synth-dynamics` requires Python 3.10+ and the following dependencies:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install numpy MDAnalysis scipy
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
To install the documentation theme:
|
|
55
|
+
```bash
|
|
56
|
+
pip install sphinx_rtd_theme
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Quick Start
|
|
60
|
+
|
|
61
|
+
Running a simulation is straightforward:
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
from synth_dynamics import System, ANMForceField, LangevinIntegrator, Simulation
|
|
65
|
+
|
|
66
|
+
# 1. Load the system (automatically filters for C-alpha atoms)
|
|
67
|
+
system = System("protein.pdb")
|
|
68
|
+
|
|
69
|
+
# 2. Define the Anisotropic Network Model forcefield
|
|
70
|
+
# Cutoff (15A) and spring constant determine the flexibility
|
|
71
|
+
ff = ANMForceField(system.equilibrium_coords, cutoff=15.0, spring_constant=1.0)
|
|
72
|
+
|
|
73
|
+
# 3. Initialize the Langevin integrator (dt in fs, T in Kelvin)
|
|
74
|
+
integrator = LangevinIntegrator(dt=0.1, temperature=300.0, friction=1.0)
|
|
75
|
+
|
|
76
|
+
# 4. Run and save the trajectory
|
|
77
|
+
sim = Simulation(system, ff, integrator)
|
|
78
|
+
sim.run(n_steps=1000, output_path="trajectory.dcd", stride=10)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Documentation
|
|
82
|
+
|
|
83
|
+
Full API documentation and usage guides are available in the `docs/` directory. You can build the HTML documentation locally:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
cd docs
|
|
87
|
+
sphinx-build -b html . _build/html
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Testing
|
|
91
|
+
|
|
92
|
+
To run the test suite and verify coverage:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
PYTHONPATH=. pytest --cov=synth_dynamics tests/
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## License
|
|
99
|
+
|
|
100
|
+
This project is licensed under the MIT License - see the LICENSE file for details (if applicable).
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# synth-dynamics: Time-Resolved Ensemble Generator
|
|
2
|
+
|
|
3
|
+
`synth-dynamics` is a fast, lightweight molecular dynamics engine designed to generate meaningful conformational ensembles of proteins. Unlike full-atom simulations (like GROMACS or Amber), `synth-dynamics` uses a **Coarse-Grained Anisotropic Network Model (ANM)** and **Langevin dynamics** to capture the essential global motions of proteins with minimal computational overhead.
|
|
4
|
+
|
|
5
|
+
This tool is designed to bridge the gap between static structures and time-averaged experimental observables, such as NMR relaxation parameters, SAXS Kratky plots, or FRET efficiency distributions.
|
|
6
|
+
|
|
7
|
+
## Key Features
|
|
8
|
+
|
|
9
|
+
- **Coarse-Grained Simulation**: Models proteins using C-alpha atoms and harmonic "spring" networks.
|
|
10
|
+
- **Fast Langevin Engine**: Propagates coordinates using a stable, overdamped Langevin integrator.
|
|
11
|
+
- **Experimental Integration**: Perfect for generating the structural ensembles needed for `synth-nmr` or `synth-saxs`.
|
|
12
|
+
- **Easy to Use**: Simple API for loading PDBs, configuring forcefields, and running simulations.
|
|
13
|
+
- **Extensively Tested**: 100% test coverage ensuring reliability and correctness.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
`synth-dynamics` requires Python 3.10+ and the following dependencies:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install numpy MDAnalysis scipy
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
To install the documentation theme:
|
|
24
|
+
```bash
|
|
25
|
+
pip install sphinx_rtd_theme
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
Running a simulation is straightforward:
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from synth_dynamics import System, ANMForceField, LangevinIntegrator, Simulation
|
|
34
|
+
|
|
35
|
+
# 1. Load the system (automatically filters for C-alpha atoms)
|
|
36
|
+
system = System("protein.pdb")
|
|
37
|
+
|
|
38
|
+
# 2. Define the Anisotropic Network Model forcefield
|
|
39
|
+
# Cutoff (15A) and spring constant determine the flexibility
|
|
40
|
+
ff = ANMForceField(system.equilibrium_coords, cutoff=15.0, spring_constant=1.0)
|
|
41
|
+
|
|
42
|
+
# 3. Initialize the Langevin integrator (dt in fs, T in Kelvin)
|
|
43
|
+
integrator = LangevinIntegrator(dt=0.1, temperature=300.0, friction=1.0)
|
|
44
|
+
|
|
45
|
+
# 4. Run and save the trajectory
|
|
46
|
+
sim = Simulation(system, ff, integrator)
|
|
47
|
+
sim.run(n_steps=1000, output_path="trajectory.dcd", stride=10)
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Documentation
|
|
51
|
+
|
|
52
|
+
Full API documentation and usage guides are available in the `docs/` directory. You can build the HTML documentation locally:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
cd docs
|
|
56
|
+
sphinx-build -b html . _build/html
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Testing
|
|
60
|
+
|
|
61
|
+
To run the test suite and verify coverage:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
PYTHONPATH=. pytest --cov=synth_dynamics tests/
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
This project is licensed under the MIT License - see the LICENSE file for details (if applicable).
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<!DOCTYPE html>
|
|
4
|
+
<html class="writer-html5" lang="en" data-content_root="../">
|
|
5
|
+
<head>
|
|
6
|
+
<meta charset="utf-8" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
+
<title>Overview: module code — synth-dynamics 0.1.0 documentation</title>
|
|
9
|
+
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=b86133f3" />
|
|
10
|
+
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=9edc463e" />
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<script src="../_static/jquery.js?v=5d32c60e"></script>
|
|
14
|
+
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
|
15
|
+
<script src="../_static/documentation_options.js?v=01f34227"></script>
|
|
16
|
+
<script src="../_static/doctools.js?v=fd6eb6e6"></script>
|
|
17
|
+
<script src="../_static/sphinx_highlight.js?v=6ffebe34"></script>
|
|
18
|
+
<script src="../_static/js/theme.js"></script>
|
|
19
|
+
<link rel="index" title="Index" href="../genindex.html" />
|
|
20
|
+
<link rel="search" title="Search" href="../search.html" />
|
|
21
|
+
</head>
|
|
22
|
+
|
|
23
|
+
<body class="wy-body-for-nav">
|
|
24
|
+
<div class="wy-grid-for-nav">
|
|
25
|
+
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
26
|
+
<div class="wy-side-scroll">
|
|
27
|
+
<div class="wy-side-nav-search" >
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
<a href="../index.html" class="icon icon-home">
|
|
32
|
+
synth-dynamics
|
|
33
|
+
</a>
|
|
34
|
+
<div role="search">
|
|
35
|
+
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
|
|
36
|
+
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
|
37
|
+
<input type="hidden" name="check_keywords" value="yes" />
|
|
38
|
+
<input type="hidden" name="area" value="default" />
|
|
39
|
+
</form>
|
|
40
|
+
</div>
|
|
41
|
+
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
|
42
|
+
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
|
43
|
+
<ul>
|
|
44
|
+
<li class="toctree-l1"><a class="reference internal" href="../usage.html">Usage Guide</a></li>
|
|
45
|
+
<li class="toctree-l1"><a class="reference internal" href="../api.html">API Reference</a></li>
|
|
46
|
+
</ul>
|
|
47
|
+
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</nav>
|
|
51
|
+
|
|
52
|
+
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
|
53
|
+
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
54
|
+
<a href="../index.html">synth-dynamics</a>
|
|
55
|
+
</nav>
|
|
56
|
+
|
|
57
|
+
<div class="wy-nav-content">
|
|
58
|
+
<div class="rst-content">
|
|
59
|
+
<div role="navigation" aria-label="Page navigation">
|
|
60
|
+
<ul class="wy-breadcrumbs">
|
|
61
|
+
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
|
|
62
|
+
<li class="breadcrumb-item active">Overview: module code</li>
|
|
63
|
+
<li class="wy-breadcrumbs-aside">
|
|
64
|
+
</li>
|
|
65
|
+
</ul>
|
|
66
|
+
<hr/>
|
|
67
|
+
</div>
|
|
68
|
+
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
69
|
+
<div itemprop="articleBody">
|
|
70
|
+
|
|
71
|
+
<h1>All modules for which code is available</h1>
|
|
72
|
+
<ul><li><a href="synth_dynamics/forcefield.html">synth_dynamics.forcefield</a></li>
|
|
73
|
+
<li><a href="synth_dynamics/integrator.html">synth_dynamics.integrator</a></li>
|
|
74
|
+
<li><a href="synth_dynamics/simulation.html">synth_dynamics.simulation</a></li>
|
|
75
|
+
<li><a href="synth_dynamics/system.html">synth_dynamics.system</a></li>
|
|
76
|
+
</ul>
|
|
77
|
+
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
<footer>
|
|
81
|
+
|
|
82
|
+
<hr/>
|
|
83
|
+
|
|
84
|
+
<div role="contentinfo">
|
|
85
|
+
<p>© Copyright 2026, George Elkins.</p>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
89
|
+
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
90
|
+
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
</footer>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</section>
|
|
97
|
+
</div>
|
|
98
|
+
<script>
|
|
99
|
+
jQuery(function () {
|
|
100
|
+
SphinxRtdTheme.Navigation.enable(true);
|
|
101
|
+
});
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
</body>
|
|
105
|
+
</html>
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<!DOCTYPE html>
|
|
4
|
+
<html class="writer-html5" lang="en" data-content_root="../../">
|
|
5
|
+
<head>
|
|
6
|
+
<meta charset="utf-8" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
+
<title>synth_dynamics.forcefield — synth-dynamics 0.1.0 documentation</title>
|
|
9
|
+
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=b86133f3" />
|
|
10
|
+
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=9edc463e" />
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<script src="../../_static/jquery.js?v=5d32c60e"></script>
|
|
14
|
+
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
|
15
|
+
<script src="../../_static/documentation_options.js?v=01f34227"></script>
|
|
16
|
+
<script src="../../_static/doctools.js?v=fd6eb6e6"></script>
|
|
17
|
+
<script src="../../_static/sphinx_highlight.js?v=6ffebe34"></script>
|
|
18
|
+
<script src="../../_static/js/theme.js"></script>
|
|
19
|
+
<link rel="index" title="Index" href="../../genindex.html" />
|
|
20
|
+
<link rel="search" title="Search" href="../../search.html" />
|
|
21
|
+
</head>
|
|
22
|
+
|
|
23
|
+
<body class="wy-body-for-nav">
|
|
24
|
+
<div class="wy-grid-for-nav">
|
|
25
|
+
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
26
|
+
<div class="wy-side-scroll">
|
|
27
|
+
<div class="wy-side-nav-search" >
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
<a href="../../index.html" class="icon icon-home">
|
|
32
|
+
synth-dynamics
|
|
33
|
+
</a>
|
|
34
|
+
<div role="search">
|
|
35
|
+
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
|
|
36
|
+
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
|
37
|
+
<input type="hidden" name="check_keywords" value="yes" />
|
|
38
|
+
<input type="hidden" name="area" value="default" />
|
|
39
|
+
</form>
|
|
40
|
+
</div>
|
|
41
|
+
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
|
42
|
+
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
|
43
|
+
<ul>
|
|
44
|
+
<li class="toctree-l1"><a class="reference internal" href="../../usage.html">Usage Guide</a></li>
|
|
45
|
+
<li class="toctree-l1"><a class="reference internal" href="../../api.html">API Reference</a></li>
|
|
46
|
+
</ul>
|
|
47
|
+
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</nav>
|
|
51
|
+
|
|
52
|
+
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
|
53
|
+
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
54
|
+
<a href="../../index.html">synth-dynamics</a>
|
|
55
|
+
</nav>
|
|
56
|
+
|
|
57
|
+
<div class="wy-nav-content">
|
|
58
|
+
<div class="rst-content">
|
|
59
|
+
<div role="navigation" aria-label="Page navigation">
|
|
60
|
+
<ul class="wy-breadcrumbs">
|
|
61
|
+
<li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
|
|
62
|
+
<li class="breadcrumb-item"><a href="../index.html">Module code</a></li>
|
|
63
|
+
<li class="breadcrumb-item active">synth_dynamics.forcefield</li>
|
|
64
|
+
<li class="wy-breadcrumbs-aside">
|
|
65
|
+
</li>
|
|
66
|
+
</ul>
|
|
67
|
+
<hr/>
|
|
68
|
+
</div>
|
|
69
|
+
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
70
|
+
<div itemprop="articleBody">
|
|
71
|
+
|
|
72
|
+
<h1>Source code for synth_dynamics.forcefield</h1><div class="highlight"><pre>
|
|
73
|
+
<span></span><span class="kn">import</span><span class="w"> </span><span class="nn">numpy</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="nn">np</span>
|
|
74
|
+
<span class="kn">from</span><span class="w"> </span><span class="nn">scipy.spatial.distance</span><span class="w"> </span><span class="kn">import</span> <span class="n">pdist</span><span class="p">,</span> <span class="n">squareform</span>
|
|
75
|
+
|
|
76
|
+
<div class="viewcode-block" id="ANMForceField">
|
|
77
|
+
<a class="viewcode-back" href="../../api.html#synth_dynamics.ANMForceField">[docs]</a>
|
|
78
|
+
<span class="k">class</span><span class="w"> </span><span class="nc">ANMForceField</span><span class="p">:</span>
|
|
79
|
+
<span class="k">def</span><span class="w"> </span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">equilibrium_coords</span><span class="p">,</span> <span class="n">cutoff</span><span class="o">=</span><span class="mf">15.0</span><span class="p">,</span> <span class="n">spring_constant</span><span class="o">=</span><span class="mf">1.0</span><span class="p">):</span>
|
|
80
|
+
<span class="w"> </span><span class="sd">"""</span>
|
|
81
|
+
<span class="sd"> Anisotropic Network Model Force Field.</span>
|
|
82
|
+
<span class="sd"> </span>
|
|
83
|
+
<span class="sd"> Args:</span>
|
|
84
|
+
<span class="sd"> equilibrium_coords: (N, 3) array of C-alpha equilibrium positions.</span>
|
|
85
|
+
<span class="sd"> cutoff: Distance cutoff for interactions in Angstroms.</span>
|
|
86
|
+
<span class="sd"> spring_constant: Uniform spring constant k.</span>
|
|
87
|
+
<span class="sd"> """</span>
|
|
88
|
+
<span class="bp">self</span><span class="o">.</span><span class="n">x0</span> <span class="o">=</span> <span class="n">equilibrium_coords</span>
|
|
89
|
+
<span class="bp">self</span><span class="o">.</span><span class="n">cutoff</span> <span class="o">=</span> <span class="n">cutoff</span>
|
|
90
|
+
<span class="bp">self</span><span class="o">.</span><span class="n">k</span> <span class="o">=</span> <span class="n">spring_constant</span>
|
|
91
|
+
<span class="bp">self</span><span class="o">.</span><span class="n">n_atoms</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">equilibrium_coords</span><span class="p">)</span>
|
|
92
|
+
|
|
93
|
+
<span class="c1"># Precompute equilibrium distances and adjacency matrix</span>
|
|
94
|
+
<span class="n">dist_matrix</span> <span class="o">=</span> <span class="n">squareform</span><span class="p">(</span><span class="n">pdist</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">x0</span><span class="p">))</span>
|
|
95
|
+
<span class="bp">self</span><span class="o">.</span><span class="n">adj</span> <span class="o">=</span> <span class="p">(</span><span class="n">dist_matrix</span> <span class="o"><</span> <span class="n">cutoff</span><span class="p">)</span> <span class="o">&</span> <span class="p">(</span><span class="n">dist_matrix</span> <span class="o">></span> <span class="mi">0</span><span class="p">)</span>
|
|
96
|
+
<span class="bp">self</span><span class="o">.</span><span class="n">r0</span> <span class="o">=</span> <span class="n">dist_matrix</span>
|
|
97
|
+
|
|
98
|
+
<div class="viewcode-block" id="ANMForceField.compute_forces">
|
|
99
|
+
<a class="viewcode-back" href="../../api.html#synth_dynamics.ANMForceField.compute_forces">[docs]</a>
|
|
100
|
+
<span class="k">def</span><span class="w"> </span><span class="nf">compute_forces</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">current_coords</span><span class="p">):</span>
|
|
101
|
+
<span class="w"> </span><span class="sd">"""</span>
|
|
102
|
+
<span class="sd"> Computes the harmonic forces on each atom.</span>
|
|
103
|
+
<span class="sd"> </span>
|
|
104
|
+
<span class="sd"> Args:</span>
|
|
105
|
+
<span class="sd"> current_coords: (N, 3) array of current positions.</span>
|
|
106
|
+
<span class="sd"> Returns:</span>
|
|
107
|
+
<span class="sd"> forces: (N, 3) array of forces.</span>
|
|
108
|
+
<span class="sd"> """</span>
|
|
109
|
+
<span class="c1"># Calculate current distances and difference vectors</span>
|
|
110
|
+
<span class="c1"># diff[i, j] = r_i - r_j</span>
|
|
111
|
+
<span class="n">diff</span> <span class="o">=</span> <span class="n">current_coords</span><span class="p">[:,</span> <span class="n">np</span><span class="o">.</span><span class="n">newaxis</span><span class="p">,</span> <span class="p">:]</span> <span class="o">-</span> <span class="n">current_coords</span><span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">newaxis</span><span class="p">,</span> <span class="p">:,</span> <span class="p">:]</span>
|
|
112
|
+
<span class="n">dist</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linalg</span><span class="o">.</span><span class="n">norm</span><span class="p">(</span><span class="n">diff</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
|
|
113
|
+
|
|
114
|
+
<span class="c1"># Avoid division by zero</span>
|
|
115
|
+
<span class="n">dist_inv</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros_like</span><span class="p">(</span><span class="n">dist</span><span class="p">)</span>
|
|
116
|
+
<span class="n">mask</span> <span class="o">=</span> <span class="n">dist</span> <span class="o">></span> <span class="mi">0</span>
|
|
117
|
+
<span class="n">dist_inv</span><span class="p">[</span><span class="n">mask</span><span class="p">]</span> <span class="o">=</span> <span class="mf">1.0</span> <span class="o">/</span> <span class="n">dist</span><span class="p">[</span><span class="n">mask</span><span class="p">]</span>
|
|
118
|
+
|
|
119
|
+
<span class="c1"># Force magnitude matrix: F_ij = -k * (r_ij - r0_ij)</span>
|
|
120
|
+
<span class="c1"># We only care about pairs in the adjacency matrix</span>
|
|
121
|
+
<span class="n">force_mag</span> <span class="o">=</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">k</span> <span class="o">*</span> <span class="p">(</span><span class="n">dist</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">r0</span><span class="p">)</span>
|
|
122
|
+
|
|
123
|
+
<span class="c1"># Full force vector matrix: F_vec_ij = F_ij * (diff_ij / dist_ij)</span>
|
|
124
|
+
<span class="c1"># Shape: (N, N, 3)</span>
|
|
125
|
+
<span class="n">force_vecs</span> <span class="o">=</span> <span class="p">(</span><span class="n">force_mag</span> <span class="o">*</span> <span class="n">dist_inv</span><span class="p">)[:,</span> <span class="p">:,</span> <span class="n">np</span><span class="o">.</span><span class="n">newaxis</span><span class="p">]</span> <span class="o">*</span> <span class="n">diff</span>
|
|
126
|
+
|
|
127
|
+
<span class="c1"># Zero out inactive interactions</span>
|
|
128
|
+
<span class="n">force_vecs</span><span class="p">[</span><span class="o">~</span><span class="bp">self</span><span class="o">.</span><span class="n">adj</span><span class="p">]</span> <span class="o">=</span> <span class="mf">0.0</span>
|
|
129
|
+
|
|
130
|
+
<span class="c1"># Total force on atom i is sum over j</span>
|
|
131
|
+
<span class="n">forces</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">force_vecs</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
|
|
132
|
+
|
|
133
|
+
<span class="k">return</span> <span class="n">forces</span></div>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
</pre></div>
|
|
137
|
+
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
<footer>
|
|
141
|
+
|
|
142
|
+
<hr/>
|
|
143
|
+
|
|
144
|
+
<div role="contentinfo">
|
|
145
|
+
<p>© Copyright 2026, George Elkins.</p>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
149
|
+
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
150
|
+
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
</footer>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</section>
|
|
157
|
+
</div>
|
|
158
|
+
<script>
|
|
159
|
+
jQuery(function () {
|
|
160
|
+
SphinxRtdTheme.Navigation.enable(true);
|
|
161
|
+
});
|
|
162
|
+
</script>
|
|
163
|
+
|
|
164
|
+
</body>
|
|
165
|
+
</html>
|