polyphys 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- polyphys/__init__.py +7 -0
- polyphys/__version__.py +22 -0
- polyphys/analyze/__init__.py +51 -0
- polyphys/analyze/clusters.py +1738 -0
- polyphys/analyze/correlations.py +995 -0
- polyphys/analyze/density.py +1138 -0
- polyphys/analyze/measurer.py +1338 -0
- polyphys/analyze/pipeline.py +1868 -0
- polyphys/analyze/stats.py +810 -0
- polyphys/analyze/sumrule.py +1159 -0
- polyphys/manage/__init__.py +11 -0
- polyphys/manage/organizer.py +2188 -0
- polyphys/manage/parser.py +1264 -0
- polyphys/manage/types.py +171 -0
- polyphys/manage/utils.py +777 -0
- polyphys/probe/__init__.py +25 -0
- polyphys/probe/binders.py +711 -0
- polyphys/probe/chain_size.py +583 -0
- polyphys/probe/core.py +437 -0
- polyphys/probe/histograms.py +863 -0
- polyphys/probe/pairs.py +555 -0
- polyphys/simulate/__init__.py +48 -0
- polyphys/simulate/build.py +1231 -0
- polyphys/simulate/core.py +237 -0
- polyphys/simulate/data.py +977 -0
- polyphys/simulate/dump.py +752 -0
- polyphys/simulate/log.py +788 -0
- polyphys/spec.py +1359 -0
- polyphys/tests/analyze/test_clusters.py +1058 -0
- polyphys/tests/analyze/test_correlations.py +708 -0
- polyphys/tests/analyze/test_density.py +813 -0
- polyphys/tests/analyze/test_measurer.py +785 -0
- polyphys/tests/analyze/test_pipeline.py +1881 -0
- polyphys/tests/analyze/test_stats.py +732 -0
- polyphys/tests/analyze/test_sumrule.py +917 -0
- polyphys/tests/conftest.py +753 -0
- polyphys/tests/data/lammps_build/make_starts.py +70 -0
- polyphys/tests/manage/test_organizer.py +1495 -0
- polyphys/tests/manage/test_parser.py +1222 -0
- polyphys/tests/manage/test_utils.py +498 -0
- polyphys/tests/probe/conftest.py +407 -0
- polyphys/tests/probe/test_binders.py +686 -0
- polyphys/tests/probe/test_chain_size.py +557 -0
- polyphys/tests/probe/test_core.py +391 -0
- polyphys/tests/probe/test_histograms.py +779 -0
- polyphys/tests/probe/test_pairs.py +475 -0
- polyphys/tests/simulate/test_build.py +1042 -0
- polyphys/tests/simulate/test_core.py +106 -0
- polyphys/tests/simulate/test_data.py +858 -0
- polyphys/tests/simulate/test_dump.py +487 -0
- polyphys/tests/simulate/test_log.py +667 -0
- polyphys/tests/strategies.py +120 -0
- polyphys/tests/synthetic.py +410 -0
- polyphys/tests/test_conftest.py +414 -0
- polyphys/tests/test_docs.py +82 -0
- polyphys/tests/test_packaging.py +97 -0
- polyphys/tests/test_spec.py +772 -0
- polyphys/tests/viz/conftest.py +32 -0
- polyphys/tests/viz/test_colors.py +113 -0
- polyphys/tests/viz/test_helpers.py +292 -0
- polyphys/viz/__init__.py +15 -0
- polyphys/viz/colors.py +204 -0
- polyphys/viz/helpers.py +549 -0
- polyphys-1.0.0.dist-info/METADATA +339 -0
- polyphys-1.0.0.dist-info/RECORD +69 -0
- polyphys-1.0.0.dist-info/WHEEL +5 -0
- polyphys-1.0.0.dist-info/licenses/AUTHORS.rst +13 -0
- polyphys-1.0.0.dist-info/licenses/LICENSE +22 -0
- polyphys-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""Write the start configurations that ``in.kg`` checks.
|
|
2
|
+
|
|
3
|
+
Run from the project environment::
|
|
4
|
+
|
|
5
|
+
python make_starts.py OUTDIR
|
|
6
|
+
|
|
7
|
+
It writes, with :mod:`polyphys.simulate.build`, ``helix.data`` (a linear
|
|
8
|
+
helix of 200 beads, radius 2, pitch 2.5, atom style ``bond``),
|
|
9
|
+
``ring.data`` (a plectoneme ring of 200 beads, the same radius and pitch,
|
|
10
|
+
atom style ``bond``), and ``ring_angle.data`` (the same ring with angles,
|
|
11
|
+
atom style ``angle``), each in a box that is periodic along z only and wide
|
|
12
|
+
enough for a cylinder of diameter 5.2 about the z axis, and prints the
|
|
13
|
+
:func:`~polyphys.simulate.build.check_conformation` report of each. The
|
|
14
|
+
same configurations are built by ``test_build.py``; this script is for a
|
|
15
|
+
run by hand with ``check_starts.sh``.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
import sys
|
|
19
|
+
from pathlib import Path
|
|
20
|
+
|
|
21
|
+
import numpy as np
|
|
22
|
+
|
|
23
|
+
from polyphys.simulate.build import (
|
|
24
|
+
chain_data,
|
|
25
|
+
check_conformation,
|
|
26
|
+
helix,
|
|
27
|
+
plectoneme_ring,
|
|
28
|
+
)
|
|
29
|
+
from polyphys.simulate.core import Box
|
|
30
|
+
from polyphys.simulate.data import write_data
|
|
31
|
+
|
|
32
|
+
N_BEADS = 200
|
|
33
|
+
RADIUS = 2.0
|
|
34
|
+
PITCH = 2.5
|
|
35
|
+
HALF_WIDTH = 5.0 # x and y half-width of the box; the wall at 3.1 fits
|
|
36
|
+
MARGIN = 2.0 # z margin on each side, beyond the ghost cutoff
|
|
37
|
+
GHOST_CUTOFF = 1.122462 + 0.3
|
|
38
|
+
PERIODIC = (False, False, True)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def start_box(positions: np.ndarray) -> Box:
|
|
42
|
+
"""Return a box of the configuration's height plus the margins."""
|
|
43
|
+
half_height = 0.5 * float(np.ptp(positions[:, 2])) + MARGIN
|
|
44
|
+
return Box(lo=np.array([-HALF_WIDTH, -HALF_WIDTH, -half_height]),
|
|
45
|
+
hi=np.array([HALF_WIDTH, HALF_WIDTH, half_height]))
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def main(out_dir: Path) -> None:
|
|
49
|
+
out_dir.mkdir(parents=True, exist_ok=True)
|
|
50
|
+
line = helix(N_BEADS, radius=RADIUS, pitch=PITCH)
|
|
51
|
+
ring = plectoneme_ring(N_BEADS, radius=RADIUS, pitch=PITCH)
|
|
52
|
+
files = {
|
|
53
|
+
"helix.data": chain_data(line, start_box(line)),
|
|
54
|
+
"ring.data": chain_data(ring, start_box(ring), ring=True),
|
|
55
|
+
"ring_angle.data": chain_data(ring, start_box(ring), ring=True,
|
|
56
|
+
angles=True),
|
|
57
|
+
}
|
|
58
|
+
for name, data in files.items():
|
|
59
|
+
cylinder = {"dcyl": 5.2, "dmon": 1.0} if name == "helix.data" else {}
|
|
60
|
+
report = check_conformation(data, r0=1.5, ghost_cutoff=GHOST_CUTOFF,
|
|
61
|
+
periodic=PERIODIC, **cylinder)
|
|
62
|
+
path = write_data(data, out_dir / name,
|
|
63
|
+
title=f"{name}: polyphys.simulate.build start")
|
|
64
|
+
print(f"{path.name}: {report}")
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
if __name__ == "__main__":
|
|
68
|
+
if len(sys.argv) != 2:
|
|
69
|
+
sys.exit("usage: python make_starts.py OUTDIR")
|
|
70
|
+
main(Path(sys.argv[1]))
|