ioNERDSS 2.2__tar.gz → 2.2.2__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.
- {ionerdss-2.2/ioNERDSS.egg-info → ionerdss-2.2.2}/PKG-INFO +2 -1
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/analysis/test_io.py +57 -2
- {ionerdss-2.2 → ionerdss-2.2.2/ioNERDSS.egg-info}/PKG-INFO +2 -1
- {ionerdss-2.2 → ionerdss-2.2.2}/ioNERDSS.egg-info/SOURCES.txt +33 -35
- {ionerdss-2.2 → ionerdss-2.2.2}/ioNERDSS.egg-info/requires.txt +1 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ioNERDSS.egg-info/top_level.txt +2 -2
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/io/parser.py +13 -2
- {ionerdss-2.2 → ionerdss-2.2.2}/pyproject.toml +8 -3
- ionerdss-2.2/tests/unit/gillespie_simulation/test_simple_gillespie.py +0 -106
- ionerdss-2.2/tests/unit/utils/test_angles.py +0 -163
- {ionerdss-2.2 → ionerdss-2.2.2}/LICENSE +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/MANIFEST.in +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/README.md +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/benchmark/benchmark_subcomplexes.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/benchmark/build_pdbs.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/benchmark/run_validation_benchmark.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/graph_based/test_reactions_generation_pipeline.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/graph_based/test_subcomplexes_extraction.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/graph_based/test_symmetry_group_identification.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/integration/__init__.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/analysis/test_api.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/analysis/test_processing.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/components/test_instances.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/components/test_reactions.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/components/test_reference_coordinates.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/components/test_registry.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/components/test_types.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/components/test_units.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/pdb/test_chain_grouping.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/pdb/test_coarse_graining.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/pdb/test_file_manager.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/pdb/test_hyperparameters.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/pdb/test_nerdss_exporter.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/pdb/test_parser.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/pdb/test_ring_regularizer.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/pdb/test_template_builder.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/pdb/test_visualizer.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/test_platonic_solids.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/ode_solver/test_ode_solver.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/utils/test_bond_geometry.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/utils/test_coords.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/utils/test_diffusion_constants.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/utils/test_inertia_tensors.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/utils/test_rigid_transform.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/utils/test_rotations.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/utils/test_steric_clash.py +0 -0
- {ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/utils/test_string_similarity.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ioNERDSS.egg-info/dependency_links.txt +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/api.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/core/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/core/simulation.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/core/types.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/docs/pymol_movie_example.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/io/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/io/loader.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/legacy/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/legacy/interface.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/processing/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/processing/transitions.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/visualization/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/visualization/config.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/visualization/plots.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/analysis/visualization/pymol_movie.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/api.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/gillespie_simulation/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/gillespie_simulation/adaptive_rates.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/gillespie_simulation/helpers.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/gillespie_simulation/simple_gillespie.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/PlatonicSolids.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/ProAffinity_GNN_inference.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/components/docs/crosslink_diagram.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/components/docs/pipeline_flowchart.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/components/instances.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/components/reactions.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/components/registry.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/components/system.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/components/types.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/components/units.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/graph_based/complexes/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/graph_based/complexes/conversion.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/graph_based/complexes/examples.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/graph_based/complexes/graphize.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/graph_based/complexes/subcomplexes.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/graph_based/reactions/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/graph_based/reactions/dimer.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/graph_based/reactions/transformation.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/graph_based/symmetry/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/graph_based/symmetry/grid.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/graph_based/symmetry/pointgroup.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/graph_based/symmetry/utils.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/model.pkl +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/api.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/chain_grouping.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/coarse_graining.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/file_manager.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/hyperparameters.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/interface_naming.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/main.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/nerdss_exporter.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/parser.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/ring_regularizer.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/structure_validation.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/system_builder.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/template_builder.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/validation.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/pdb/visualizer.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/platonic_solids/geometry.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/platonic_solids/solids.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/proaffinity_predictor.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/proaffinity_requirements.txt +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/spherical_assembly/A.mol +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/spherical_assembly/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/spherical_assembly/core.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/spherical_assembly/gagpositions.txt +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/spherical_assembly/geometry.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/spherical_assembly/legacy/_pdb.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/spherical_assembly/legacy/chain_int.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/spherical_assembly/legacy/gagReshape.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/spherical_assembly/output_test.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/spherical_assembly/parms.inp +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/model/titrate/parms_titrator.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/nerdss_guis/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/nerdss_guis/gen/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/nerdss_guis/gen/advanced_options_parse_pdb.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/nerdss_guis/gen/mainwindow.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/nerdss_guis/gen/modify_parameters.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/nerdss_guis/gen/mplwidget.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/nerdss_guis/gen/nerdss_install.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/nerdss_guis/gen/pdb_movie_player.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/nerdss_guis/gen/plot_complex.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/nerdss_guis/gen/plot_copy_num.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/nerdss_guis/gui.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/nerdss_guis/nerdss.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/nerdss_simulation/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/nerdss_simulation/simulation.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/ode/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/ode/ode_pipeline.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/ode/reaction_ode_solver.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/ode/reaction_string_parser.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/ode/system_ode_generator.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/ovito_visualizer.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/simularium_converter/simularium_converter.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/tests/test_pymol_movie.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/tests/test_structure_validation.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/tests/test_template_builder_hht.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/tests/test_validation_benchmark_status.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/util.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/utils/__init__.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/utils/angles.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/utils/bond_geometry.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/utils/coords.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/utils/diffusion_constant.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/utils/inertia_tensors.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/utils/rigid_transform.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/utils/rotations.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/utils/steric_clash.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/utils/string_similarity.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/ionerdss/utils/vectors.py +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/setup.cfg +0 -0
- {ionerdss-2.2 → ionerdss-2.2.2}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ioNERDSS
|
|
3
|
-
Version: 2.2
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: Package for preparing NERDSS inputs and analysing outputs.
|
|
5
5
|
Author-email: Yue Moon Ying <yying7@jh.edu>, Mankun Sang <msang2@jhu.edu>, Samuel L Foley <sfoley13@jh.edu>, "Zixiu (Hugh) Liu" <zliu140@jhu.edu>, Sikao Guo <sikaoguo@gmail.com>
|
|
6
6
|
License: GPL-3.0
|
|
@@ -53,6 +53,7 @@ Requires-Dist: ipywidgets; extra == "jupyter"
|
|
|
53
53
|
Provides-Extra: simularium
|
|
54
54
|
Requires-Dist: simulariumio; extra == "simularium"
|
|
55
55
|
Requires-Dist: MDAnalysis; extra == "simularium"
|
|
56
|
+
Requires-Dist: pandas<3; extra == "simularium"
|
|
56
57
|
Provides-Extra: docs
|
|
57
58
|
Requires-Dist: mkdocs>=1.6; extra == "docs"
|
|
58
59
|
Provides-Extra: all
|
|
@@ -63,10 +63,65 @@ class TestIOParser(unittest.TestCase):
|
|
|
63
63
|
if Path(self.temp_dir).exists():
|
|
64
64
|
shutil.rmtree(self.temp_dir)
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
def _write_transition_file(self, name: str, header: str) -> Path:
|
|
67
|
+
"""Writes a two-time-point transition file using the given matrix header."""
|
|
68
|
+
path = self.temp_path / name
|
|
69
|
+
with open(path, 'w') as f:
|
|
70
|
+
f.write("time: 0\n")
|
|
71
|
+
f.write(f"{header}\n")
|
|
72
|
+
f.write("A\n")
|
|
73
|
+
f.write(" 0 0\n")
|
|
74
|
+
f.write(" 0 0\n")
|
|
75
|
+
f.write("lifetime for each mol type:\n")
|
|
76
|
+
f.write("A\n")
|
|
77
|
+
f.write("size of the cluster:1\n")
|
|
78
|
+
f.write("\n")
|
|
79
|
+
f.write("time: 0.005\n")
|
|
80
|
+
f.write(f"{header}\n")
|
|
81
|
+
f.write("A\n")
|
|
82
|
+
f.write(" 4 2\n")
|
|
83
|
+
f.write(" 1 3\n")
|
|
84
|
+
f.write("lifetime for each mol type:\n")
|
|
85
|
+
f.write("A\n")
|
|
86
|
+
f.write("size of the cluster:1\n")
|
|
87
|
+
f.write(" 0.5 0.25\n")
|
|
88
|
+
f.write("\n")
|
|
89
|
+
return path
|
|
90
|
+
|
|
67
91
|
def test_parse_transition_file(self):
|
|
68
92
|
"""Test transition file parsing."""
|
|
69
|
-
|
|
93
|
+
path = self._write_transition_file(
|
|
94
|
+
"transition_ok.dat", "transition matrix for each mol type:"
|
|
95
|
+
)
|
|
96
|
+
transitions, lifetimes = parser.parse_transition_file(path)
|
|
97
|
+
|
|
98
|
+
# The all-zero block at time 0 still counts: the header was found.
|
|
99
|
+
self.assertEqual(len(transitions), 2)
|
|
100
|
+
self.assertEqual(transitions[1]["time"], 0.005)
|
|
101
|
+
np.testing.assert_array_equal(
|
|
102
|
+
transitions[1]["matrix"], np.array([[4, 2], [1, 3]])
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
self.assertEqual(len(lifetimes), 1)
|
|
106
|
+
self.assertEqual(lifetimes[0]["lifetimes"][1], [0.5, 0.25])
|
|
107
|
+
|
|
108
|
+
def test_parse_transition_file_legacy_typo_header(self):
|
|
109
|
+
"""Pre-fix NERDSS builds write 'transion matrix ...'; both must parse."""
|
|
110
|
+
typo_path = self._write_transition_file(
|
|
111
|
+
"transition_typo.dat", "transion matrix for each mol type:"
|
|
112
|
+
)
|
|
113
|
+
ok_path = self._write_transition_file(
|
|
114
|
+
"transition_ok2.dat", "transition matrix for each mol type:"
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
typo_transitions, typo_lifetimes = parser.parse_transition_file(typo_path)
|
|
118
|
+
ok_transitions, ok_lifetimes = parser.parse_transition_file(ok_path)
|
|
119
|
+
|
|
120
|
+
self.assertEqual(len(typo_transitions), len(ok_transitions))
|
|
121
|
+
for typo, ok in zip(typo_transitions, ok_transitions):
|
|
122
|
+
self.assertEqual(typo["time"], ok["time"])
|
|
123
|
+
np.testing.assert_array_equal(typo["matrix"], ok["matrix"])
|
|
124
|
+
self.assertEqual(typo_lifetimes, ok_lifetimes)
|
|
70
125
|
|
|
71
126
|
def test_parse_copy_numbers(self):
|
|
72
127
|
"""Test copy numbers file parsing."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ioNERDSS
|
|
3
|
-
Version: 2.2
|
|
3
|
+
Version: 2.2.2
|
|
4
4
|
Summary: Package for preparing NERDSS inputs and analysing outputs.
|
|
5
5
|
Author-email: Yue Moon Ying <yying7@jh.edu>, Mankun Sang <msang2@jhu.edu>, Samuel L Foley <sfoley13@jh.edu>, "Zixiu (Hugh) Liu" <zliu140@jhu.edu>, Sikao Guo <sikaoguo@gmail.com>
|
|
6
6
|
License: GPL-3.0
|
|
@@ -53,6 +53,7 @@ Requires-Dist: ipywidgets; extra == "jupyter"
|
|
|
53
53
|
Provides-Extra: simularium
|
|
54
54
|
Requires-Dist: simulariumio; extra == "simularium"
|
|
55
55
|
Requires-Dist: MDAnalysis; extra == "simularium"
|
|
56
|
+
Requires-Dist: pandas<3; extra == "simularium"
|
|
56
57
|
Provides-Extra: docs
|
|
57
58
|
Requires-Dist: mkdocs>=1.6; extra == "docs"
|
|
58
59
|
Provides-Extra: all
|
|
@@ -6,6 +6,38 @@ setup.py
|
|
|
6
6
|
benchmark/benchmark_subcomplexes.py
|
|
7
7
|
benchmark/build_pdbs.py
|
|
8
8
|
benchmark/run_validation_benchmark.py
|
|
9
|
+
developer_tests/graph_based/test_reactions_generation_pipeline.py
|
|
10
|
+
developer_tests/graph_based/test_subcomplexes_extraction.py
|
|
11
|
+
developer_tests/graph_based/test_symmetry_group_identification.py
|
|
12
|
+
developer_tests/integration/__init__.py
|
|
13
|
+
developer_tests/unit/analysis/test_api.py
|
|
14
|
+
developer_tests/unit/analysis/test_io.py
|
|
15
|
+
developer_tests/unit/analysis/test_processing.py
|
|
16
|
+
developer_tests/unit/model/test_platonic_solids.py
|
|
17
|
+
developer_tests/unit/model/components/test_instances.py
|
|
18
|
+
developer_tests/unit/model/components/test_reactions.py
|
|
19
|
+
developer_tests/unit/model/components/test_reference_coordinates.py
|
|
20
|
+
developer_tests/unit/model/components/test_registry.py
|
|
21
|
+
developer_tests/unit/model/components/test_types.py
|
|
22
|
+
developer_tests/unit/model/components/test_units.py
|
|
23
|
+
developer_tests/unit/model/pdb/test_chain_grouping.py
|
|
24
|
+
developer_tests/unit/model/pdb/test_coarse_graining.py
|
|
25
|
+
developer_tests/unit/model/pdb/test_file_manager.py
|
|
26
|
+
developer_tests/unit/model/pdb/test_hyperparameters.py
|
|
27
|
+
developer_tests/unit/model/pdb/test_nerdss_exporter.py
|
|
28
|
+
developer_tests/unit/model/pdb/test_parser.py
|
|
29
|
+
developer_tests/unit/model/pdb/test_ring_regularizer.py
|
|
30
|
+
developer_tests/unit/model/pdb/test_template_builder.py
|
|
31
|
+
developer_tests/unit/model/pdb/test_visualizer.py
|
|
32
|
+
developer_tests/unit/ode_solver/test_ode_solver.py
|
|
33
|
+
developer_tests/unit/utils/test_bond_geometry.py
|
|
34
|
+
developer_tests/unit/utils/test_coords.py
|
|
35
|
+
developer_tests/unit/utils/test_diffusion_constants.py
|
|
36
|
+
developer_tests/unit/utils/test_inertia_tensors.py
|
|
37
|
+
developer_tests/unit/utils/test_rigid_transform.py
|
|
38
|
+
developer_tests/unit/utils/test_rotations.py
|
|
39
|
+
developer_tests/unit/utils/test_steric_clash.py
|
|
40
|
+
developer_tests/unit/utils/test_string_similarity.py
|
|
9
41
|
ioNERDSS.egg-info/PKG-INFO
|
|
10
42
|
ioNERDSS.egg-info/SOURCES.txt
|
|
11
43
|
ioNERDSS.egg-info/dependency_links.txt
|
|
@@ -125,38 +157,4 @@ ionerdss/utils/rigid_transform.py
|
|
|
125
157
|
ionerdss/utils/rotations.py
|
|
126
158
|
ionerdss/utils/steric_clash.py
|
|
127
159
|
ionerdss/utils/string_similarity.py
|
|
128
|
-
ionerdss/utils/vectors.py
|
|
129
|
-
tests/graph_based/test_reactions_generation_pipeline.py
|
|
130
|
-
tests/graph_based/test_subcomplexes_extraction.py
|
|
131
|
-
tests/graph_based/test_symmetry_group_identification.py
|
|
132
|
-
tests/integration/__init__.py
|
|
133
|
-
tests/unit/analysis/test_api.py
|
|
134
|
-
tests/unit/analysis/test_io.py
|
|
135
|
-
tests/unit/analysis/test_processing.py
|
|
136
|
-
tests/unit/gillespie_simulation/test_simple_gillespie.py
|
|
137
|
-
tests/unit/model/test_platonic_solids.py
|
|
138
|
-
tests/unit/model/components/test_instances.py
|
|
139
|
-
tests/unit/model/components/test_reactions.py
|
|
140
|
-
tests/unit/model/components/test_reference_coordinates.py
|
|
141
|
-
tests/unit/model/components/test_registry.py
|
|
142
|
-
tests/unit/model/components/test_types.py
|
|
143
|
-
tests/unit/model/components/test_units.py
|
|
144
|
-
tests/unit/model/pdb/test_chain_grouping.py
|
|
145
|
-
tests/unit/model/pdb/test_coarse_graining.py
|
|
146
|
-
tests/unit/model/pdb/test_file_manager.py
|
|
147
|
-
tests/unit/model/pdb/test_hyperparameters.py
|
|
148
|
-
tests/unit/model/pdb/test_nerdss_exporter.py
|
|
149
|
-
tests/unit/model/pdb/test_parser.py
|
|
150
|
-
tests/unit/model/pdb/test_ring_regularizer.py
|
|
151
|
-
tests/unit/model/pdb/test_template_builder.py
|
|
152
|
-
tests/unit/model/pdb/test_visualizer.py
|
|
153
|
-
tests/unit/ode_solver/test_ode_solver.py
|
|
154
|
-
tests/unit/utils/test_angles.py
|
|
155
|
-
tests/unit/utils/test_bond_geometry.py
|
|
156
|
-
tests/unit/utils/test_coords.py
|
|
157
|
-
tests/unit/utils/test_diffusion_constants.py
|
|
158
|
-
tests/unit/utils/test_inertia_tensors.py
|
|
159
|
-
tests/unit/utils/test_rigid_transform.py
|
|
160
|
-
tests/unit/utils/test_rotations.py
|
|
161
|
-
tests/unit/utils/test_steric_clash.py
|
|
162
|
-
tests/unit/utils/test_string_similarity.py
|
|
160
|
+
ionerdss/utils/vectors.py
|
|
@@ -21,8 +21,9 @@ logger = logging.getLogger(__name__)
|
|
|
21
21
|
# Compiled regex patterns for performance
|
|
22
22
|
# Matches: "time: 0.123" or "Time (s): 0.123"
|
|
23
23
|
TIME_PATTERN = re.compile(r"(?:time|Time\s*\(s\)):\s*([-+]?\d*\.?\d+(?:[eE][-+]?\d+)?)")
|
|
24
|
-
# Matches: "transition matrix for each mol type:"
|
|
25
|
-
|
|
24
|
+
# Matches: "transition matrix for each mol type:", and the "transion" misspelling
|
|
25
|
+
# written by NERDSS builds predating the fix in write_transition.cpp
|
|
26
|
+
TRANSITION_HEADER_PATTERN = re.compile(r"transi(?:ti)?on\s+matrix\s+for\s+each\s+mol\s+type:", re.IGNORECASE)
|
|
26
27
|
# Matches: "lifetime for each mol type:"
|
|
27
28
|
LIFETIME_HEADER_PATTERN = re.compile(r"lifetime\s+for\s+each\s+mol\s+type:", re.IGNORECASE)
|
|
28
29
|
# Matches: "size of the cluster: 5"
|
|
@@ -62,6 +63,7 @@ def parse_transition_file(file_path: Path) -> Tuple[List[TransitionData], List[L
|
|
|
62
63
|
|
|
63
64
|
transitions: List[TransitionData] = []
|
|
64
65
|
lifetimes_list: List[LifetimeData] = []
|
|
66
|
+
blocks_without_matrix = 0
|
|
65
67
|
|
|
66
68
|
# Iterate in pairs of (time, block)
|
|
67
69
|
for i in range(1, len(parts), 2):
|
|
@@ -74,6 +76,8 @@ def parse_transition_file(file_path: Path) -> Tuple[List[TransitionData], List[L
|
|
|
74
76
|
# Only add if we have valid data
|
|
75
77
|
if matrix.size > 0:
|
|
76
78
|
transitions.append({"time": time_val, "matrix": matrix})
|
|
79
|
+
else:
|
|
80
|
+
blocks_without_matrix += 1
|
|
77
81
|
|
|
78
82
|
if lifetime_dict:
|
|
79
83
|
lifetimes_list.append({"time": time_val, "lifetimes": lifetime_dict})
|
|
@@ -82,6 +86,13 @@ def parse_transition_file(file_path: Path) -> Tuple[List[TransitionData], List[L
|
|
|
82
86
|
logger.debug(f"Skipping malformed block at index {i}: {e}")
|
|
83
87
|
continue
|
|
84
88
|
|
|
89
|
+
if blocks_without_matrix and not transitions:
|
|
90
|
+
logger.warning(
|
|
91
|
+
f"No transition matrix parsed from {file_path}: "
|
|
92
|
+
f"{blocks_without_matrix} time block(s) contained no matrix. "
|
|
93
|
+
f"Check that the file has a 'transition matrix for each mol type:' header."
|
|
94
|
+
)
|
|
95
|
+
|
|
85
96
|
return transitions, lifetimes_list
|
|
86
97
|
|
|
87
98
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "ioNERDSS"
|
|
7
|
-
version = "2.2"
|
|
7
|
+
version = "2.2.2"
|
|
8
8
|
description = "Package for preparing NERDSS inputs and analysing outputs."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "GPL-3.0" }
|
|
@@ -63,7 +63,12 @@ jupyter = ["jupyter", "jupyterlab", "ipykernel", "ipywidgets"]
|
|
|
63
63
|
|
|
64
64
|
simularium = [
|
|
65
65
|
"simulariumio",
|
|
66
|
-
"MDAnalysis"
|
|
66
|
+
"MDAnalysis", # for simulariumio reading NERDSS PDB files
|
|
67
|
+
# simulariumio 1.13.0 (latest on PyPI) writes in place into an array that
|
|
68
|
+
# pandas 3.0+ returns read-only, so its NERDSS converter raises
|
|
69
|
+
# "ValueError: assignment destination is read-only". The fix is on
|
|
70
|
+
# simulariumio's GitHub main branch but is not yet released to PyPI.
|
|
71
|
+
"pandas<3"
|
|
67
72
|
]
|
|
68
73
|
|
|
69
74
|
docs = [
|
|
@@ -91,4 +96,4 @@ include-package-data = true
|
|
|
91
96
|
where = ["."]
|
|
92
97
|
|
|
93
98
|
[tool.pytest.ini_options]
|
|
94
|
-
testpaths = ["
|
|
99
|
+
testpaths = ["developer_tests"]
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
test_simple_gillespie.py
|
|
3
|
-
|
|
4
|
-
Unit tests for `SimpleGillespieSimulator` in the `ionerdss` package.
|
|
5
|
-
|
|
6
|
-
Tested Components
|
|
7
|
-
-----------------
|
|
8
|
-
- `convert_to_microscopic_rate_constants`:
|
|
9
|
-
Converts macroscopic rate constants to molecule-based (microscopic) rates
|
|
10
|
-
based on Avogadro's number and reaction order.
|
|
11
|
-
|
|
12
|
-
- `calculate_propensity`:
|
|
13
|
-
Calculates the reaction propensities for a set of discrete molecular species.
|
|
14
|
-
|
|
15
|
-
- `gillespie_simulation`:
|
|
16
|
-
Runs the full stochastic simulation algorithm (SSA) using the Gillespie direct method.
|
|
17
|
-
|
|
18
|
-
Test Model
|
|
19
|
-
----------
|
|
20
|
-
The test reactions represent the following system:
|
|
21
|
-
R1: A + B → C with macroscopic rate k1 = 1.0e6
|
|
22
|
-
R2: 2C → A + 2B with macroscopic rate k2 = 5.0
|
|
23
|
-
|
|
24
|
-
Initial species concentrations:
|
|
25
|
-
y = [A, B, C] = [10, 5, 3]
|
|
26
|
-
Simulation volume:
|
|
27
|
-
1e-18 L
|
|
28
|
-
|
|
29
|
-
Author: yying7@jh.edu
|
|
30
|
-
-------
|
|
31
|
-
Part of the ioNERDSS modeling framework.
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
|
-
import unittest
|
|
35
|
-
import numpy as np
|
|
36
|
-
from ionerdss.gillespie_simulation import simple_gillespie as SimpleGillespie
|
|
37
|
-
from ionerdss.gillespie_simulation import adaptive_rates as AdaptiveRates
|
|
38
|
-
|
|
39
|
-
class TestReactionGillespie(unittest.TestCase):
|
|
40
|
-
|
|
41
|
-
def setUp(self):
|
|
42
|
-
# Example parameters for testing
|
|
43
|
-
self.macroscopic_rate_constants = np.array([1.0e6, 5.0])
|
|
44
|
-
self.reactant_matrix = np.array([[1, 1, 0], [0, 0, 2]])
|
|
45
|
-
self.product_matrix = np.array([[0, 0, 1], [1, 2, 1]])
|
|
46
|
-
self.volume = 1.0e-18 # Litre!
|
|
47
|
-
self.y = np.array([10, 5, 3])
|
|
48
|
-
self.sgs = SimpleGillespie
|
|
49
|
-
|
|
50
|
-
def test_convert_to_microscopic_rate_constants(self):
|
|
51
|
-
microscopic_rate_constants = self.sgs.convert_to_microscopic_rate_constants(
|
|
52
|
-
self.macroscopic_rate_constants, self.reactant_matrix, self.volume
|
|
53
|
-
)
|
|
54
|
-
expected_result = np.array([1.66053928e+00, 1.66053928e-05])
|
|
55
|
-
np.testing.assert_allclose(microscopic_rate_constants, expected_result)
|
|
56
|
-
|
|
57
|
-
def test_calculate_propensity(self):
|
|
58
|
-
microscopic_rate_constants = np.array([0.1 * 90, 0.05 * 5])
|
|
59
|
-
propensities = self.sgs.calculate_propensity(self.y, self.reactant_matrix, microscopic_rate_constants)
|
|
60
|
-
expected_result = np.array([450, 0.75])
|
|
61
|
-
np.testing.assert_allclose(propensities, expected_result)
|
|
62
|
-
|
|
63
|
-
def test_gillespie_simulation(self):
|
|
64
|
-
max_time = 10.0
|
|
65
|
-
y_init = np.array([10, 5, 3])
|
|
66
|
-
|
|
67
|
-
record_interval = 10
|
|
68
|
-
full_update_scheme = True
|
|
69
|
-
|
|
70
|
-
y_record, t_record = self.sgs.gillespie_simulation(
|
|
71
|
-
max_time, y_init, self.reactant_matrix, self.product_matrix,
|
|
72
|
-
self.macroscopic_rate_constants, record_interval, full_update_scheme
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
def test_gillespie_simulation_1D_adaptive_rate(self):
|
|
76
|
-
|
|
77
|
-
ratelist = np.array([10, 0.2])
|
|
78
|
-
y_init = np.array([10, 3])
|
|
79
|
-
reactant_matrix = np.array([[2, 0], [0, 1]])
|
|
80
|
-
product_matrix = np.array([[0, 1], [2, 0]])
|
|
81
|
-
Length = 50
|
|
82
|
-
diffusion_constants = np.array([0.1, 0.05])
|
|
83
|
-
sigmalist = np.array([1, 0])
|
|
84
|
-
reverse_reaction_pairs = {0:1}
|
|
85
|
-
|
|
86
|
-
max_time = 10.0
|
|
87
|
-
record_interval = 0.01
|
|
88
|
-
full_update_scheme = True
|
|
89
|
-
|
|
90
|
-
rate_update_rule = AdaptiveRates.get_rule(
|
|
91
|
-
AdaptiveRates.adaptive_bimolecular_rate_1D,
|
|
92
|
-
Length, diffusion_constants, sigmalist, reverse_reaction_pairs
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
y_record, t_record = self.sgs.run_Gillespie(
|
|
96
|
-
max_time, y_init, reactant_matrix, product_matrix,
|
|
97
|
-
ratelist, Length, macroscopic=True,
|
|
98
|
-
rate_update_rules=rate_update_rule,
|
|
99
|
-
record_interval=record_interval,
|
|
100
|
-
full_update_scheme=full_update_scheme
|
|
101
|
-
)
|
|
102
|
-
|
|
103
|
-
# You can add more assertions based on the expected behavior of your simulation
|
|
104
|
-
|
|
105
|
-
if __name__ == '__main__':
|
|
106
|
-
unittest.main()
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import unittest
|
|
2
|
-
import numpy as np
|
|
3
|
-
from numpy.testing import assert_allclose
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
from ionerdss.utils.angles import (
|
|
7
|
-
absolute_error_to_angle,
|
|
8
|
-
angles_between_vector_and_vectors,
|
|
9
|
-
angles_from_points,
|
|
10
|
-
dihedrals_from_points,
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
class TestAngles(unittest.TestCase):
|
|
14
|
-
|
|
15
|
-
def test_absolute_error_to_angle_basic(self):
|
|
16
|
-
points = np.array([[1, 0, 0], [0, 2, 0], [0, 0, 4]])
|
|
17
|
-
error = 0.1
|
|
18
|
-
expected = np.array([0.1 / 1, 0.1 / 2, 0.1 / 4])
|
|
19
|
-
result = absolute_error_to_angle(error, points)
|
|
20
|
-
np.testing.assert_allclose(result, expected, rtol=1e-6)
|
|
21
|
-
|
|
22
|
-
def test_absolute_error_to_angle_with_small_radius(self):
|
|
23
|
-
points = np.array([[0, 0, 0], [1e-12, 0, 0]])
|
|
24
|
-
error = 0.1
|
|
25
|
-
result = absolute_error_to_angle(error, points, tol=1e-8)
|
|
26
|
-
self.assertTrue(np.all(result >= 0))
|
|
27
|
-
self.assertAlmostEqual(result[0], 0.1 / 1e-8)
|
|
28
|
-
self.assertAlmostEqual(result[1], 0.1 / 1e-8)
|
|
29
|
-
|
|
30
|
-
def test_angles_between_vector_and_vectors_basic(self):
|
|
31
|
-
ref = np.array([1, 0, 0])
|
|
32
|
-
angle_deg = 47.3
|
|
33
|
-
angle_rad = np.deg2rad(angle_deg)
|
|
34
|
-
target_47_3 = np.array([np.cos(angle_rad), np.sin(angle_rad), 0])
|
|
35
|
-
|
|
36
|
-
targets = np.array([
|
|
37
|
-
[1, 0, 0], # 0 degrees
|
|
38
|
-
[0, 1, 0], # 90 degrees
|
|
39
|
-
[-1, 0, 0], # 180 degrees
|
|
40
|
-
[1, 1, 0], # ~45 degrees
|
|
41
|
-
target_47_3, # 47.3 degrees
|
|
42
|
-
])
|
|
43
|
-
|
|
44
|
-
result = angles_between_vector_and_vectors(ref, targets)
|
|
45
|
-
expected = np.array([
|
|
46
|
-
0.0,
|
|
47
|
-
np.pi / 2,
|
|
48
|
-
np.pi,
|
|
49
|
-
np.pi / 4,
|
|
50
|
-
angle_rad,
|
|
51
|
-
])
|
|
52
|
-
np.testing.assert_allclose(result, expected, rtol=1e-6)
|
|
53
|
-
|
|
54
|
-
def test_angles_between_vector_and_zero_vector(self):
|
|
55
|
-
ref = np.array([1, 0, 0])
|
|
56
|
-
targets = np.array([
|
|
57
|
-
[0, 0, 0], # zero norm
|
|
58
|
-
[0, 0, 0], # zero norm
|
|
59
|
-
])
|
|
60
|
-
result = angles_between_vector_and_vectors(ref, targets)
|
|
61
|
-
expected = np.array([0.0, 0.0])
|
|
62
|
-
np.testing.assert_array_equal(result, expected)
|
|
63
|
-
|
|
64
|
-
def test_angles_between_vector_and_vectors_with_tolerance(self):
|
|
65
|
-
ref = np.array([1e-12, 0, 0])
|
|
66
|
-
targets = np.array([[1, 0, 0]])
|
|
67
|
-
result = angles_between_vector_and_vectors(ref, targets, tol=1e-8)
|
|
68
|
-
expected = np.array([0.0]) # Denominator too small, treated as 0
|
|
69
|
-
np.testing.assert_array_equal(result, expected)
|
|
70
|
-
|
|
71
|
-
def test_angles_from_points(self):
|
|
72
|
-
|
|
73
|
-
# initialize list
|
|
74
|
-
p1 = []
|
|
75
|
-
p2 = []
|
|
76
|
-
p3 = []
|
|
77
|
-
|
|
78
|
-
# 90 degrees at vertex (1, 0, 0]
|
|
79
|
-
p1.append([1, 1, 0])
|
|
80
|
-
p2.append([1, 0, 0])
|
|
81
|
-
p3.append([2, 0, 0])
|
|
82
|
-
|
|
83
|
-
# 180 degrees at center
|
|
84
|
-
p1.append([0, 0, 0])
|
|
85
|
-
p2.append([1, 0, 0])
|
|
86
|
-
p3.append([2, 0, 0])
|
|
87
|
-
|
|
88
|
-
# 60 degrees at any vertex of equilateral triangle
|
|
89
|
-
p1.append([0, 0, 0])
|
|
90
|
-
p2.append([1, 0, 0])
|
|
91
|
-
p3.append([0.5, np.sqrt(3)/2, 0])
|
|
92
|
-
|
|
93
|
-
# colinear inward (0 deg)
|
|
94
|
-
p1.append([2, 0, 0])
|
|
95
|
-
p2.append([0, 0, 0])
|
|
96
|
-
p3.append([1, 0, 0])
|
|
97
|
-
|
|
98
|
-
# tetrahedron vertices
|
|
99
|
-
# Approx 70.53° angle between two bonds in tetrahedral geometry
|
|
100
|
-
p1.append([1, 1, 1])
|
|
101
|
-
p2.append([0, 0, 0])
|
|
102
|
-
p3.append([1, -1, -1])
|
|
103
|
-
|
|
104
|
-
# test numerical stability
|
|
105
|
-
p1.append([-1, 0, 0])
|
|
106
|
-
p2.append([0, 0, 0])
|
|
107
|
-
p3.append([1, 1e-7, 0])
|
|
108
|
-
|
|
109
|
-
# test
|
|
110
|
-
angle = angles_from_points(p1, p2, p3)
|
|
111
|
-
np.testing.assert_allclose(angle, np.array([np.pi/2.0,
|
|
112
|
-
0.0,
|
|
113
|
-
2 * np.pi/3.0,
|
|
114
|
-
np.pi,
|
|
115
|
-
np.pi-1.910633236249,
|
|
116
|
-
9.884312e-08]))
|
|
117
|
-
|
|
118
|
-
class TestDihedralsFromPoints(unittest.TestCase):
|
|
119
|
-
def test_known_dihedral(self):
|
|
120
|
-
"""
|
|
121
|
-
Test known values of dihedrals: planar and 90° configurations.
|
|
122
|
-
"""
|
|
123
|
-
# Dihedral angle 0 degrees
|
|
124
|
-
p1 = np.array([[1.0, 0.0, 0.0]])
|
|
125
|
-
p2 = np.array([[0.0, 0.0, 0.0]])
|
|
126
|
-
p3 = np.array([[0.0, 1.0, 0.0]])
|
|
127
|
-
p4 = np.array([[1.0, 1.0, 0.0]])
|
|
128
|
-
dihedrals = dihedrals_from_points(p1, p2, p3, p4)
|
|
129
|
-
assert_allclose(dihedrals, [np.pi], atol=1e-6)
|
|
130
|
-
|
|
131
|
-
# Dihedral angle 90 degrees
|
|
132
|
-
p4 = np.array([[0.0, 1.0, 1.0]])
|
|
133
|
-
dihedrals = dihedrals_from_points(p1, p2, p3, p4)
|
|
134
|
-
assert_allclose(dihedrals, [np.pi/2], atol=1e-6)
|
|
135
|
-
|
|
136
|
-
# Dihedral angle -90 degrees
|
|
137
|
-
p4 = np.array([[0.0, 1.0, -1.0]])
|
|
138
|
-
dihedrals = dihedrals_from_points(p1, p2, p3, p4)
|
|
139
|
-
assert_allclose(dihedrals, [-np.pi/2], atol=1e-6)
|
|
140
|
-
|
|
141
|
-
def test_batch_dihedrals(self):
|
|
142
|
-
"""
|
|
143
|
-
Test multiple dihedrals in a single call.
|
|
144
|
-
"""
|
|
145
|
-
p1 = np.array([[1.0, 0.0, 0.0],
|
|
146
|
-
[1.0, 0.0, 0.0]])
|
|
147
|
-
p2 = np.array([[0.0, 0.0, 0.0],
|
|
148
|
-
[0.0, 0.0, 0.0]])
|
|
149
|
-
p3 = np.array([[0.0, 1.0, 0.0],
|
|
150
|
-
[0.0, 1.0, 0.0]])
|
|
151
|
-
p4 = np.array([[1.0, 1.0, 0.0],
|
|
152
|
-
[0.0, 1.0, 1.0]])
|
|
153
|
-
|
|
154
|
-
dihedrals = dihedrals_from_points(p1, p2, p3, p4)
|
|
155
|
-
expected = np.array([np.pi, np.pi/2])
|
|
156
|
-
assert_allclose(dihedrals, expected, atol=1e-6)
|
|
157
|
-
|
|
158
|
-
if __name__ == "__main__":
|
|
159
|
-
unittest.main()
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if __name__ == "__main__":
|
|
163
|
-
unittest.main()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/graph_based/test_subcomplexes_extraction.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/components/test_instances.py
RENAMED
|
File without changes
|
{ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/components/test_reactions.py
RENAMED
|
File without changes
|
|
File without changes
|
{ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/components/test_registry.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/pdb/test_coarse_graining.py
RENAMED
|
File without changes
|
|
File without changes
|
{ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/pdb/test_hyperparameters.py
RENAMED
|
File without changes
|
{ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/pdb/test_nerdss_exporter.py
RENAMED
|
File without changes
|
|
File without changes
|
{ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/pdb/test_ring_regularizer.py
RENAMED
|
File without changes
|
{ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/model/pdb/test_template_builder.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ionerdss-2.2/tests → ionerdss-2.2.2/developer_tests}/unit/utils/test_diffusion_constants.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|