Skip to content

Commit

Permalink
added all the functions, but with warnings, saying input tests correc…
Browse files Browse the repository at this point in the history
…tness is not checked.
  • Loading branch information
bc118 committed Aug 23, 2024
1 parent f61a550 commit eb0fe44
Show file tree
Hide file tree
Showing 8 changed files with 905 additions and 374 deletions.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ The official VMD web page is http://www.ks.uiuc.edu/Research/vmd
:maxdepth: 2

topic_guides/data_structures
topic_guides/secondary_structures

.. toctree::
:caption: Reference
Expand Down
5 changes: 4 additions & 1 deletion docs/topic_guides/data_structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ Calculate a Dihedral Angle

.. automodule:: mosdef_dihedral_fit.utils.math_operations
:members: dihedral_angle


Fit a Dihedral
--------------

.. automodule:: mosdef_dihedral_fit.dihedral_fit.fit_dihedral_with_gomc
:members: fit_dihedral_with_gomc



50 changes: 50 additions & 0 deletions docs/topic_guides/secondary_structures.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.. _secondary_data_structures:

=========================
Secondary Data Structures
=========================

.. warning::
These secondary functions, mostly from the **utils** folder,=
**do not contain Type or Value Input Checks**. Therefore, they are being
listed with a warning that only advanced users should use these functions, as
they were not designed with input error checks.

Advanced users who wish to use these functions can find them
`here <https://github.com/GOMC-WSU/MoSDeF-dihedral-fit/tree/main/mosdef_dihedral_fit/utils>`_.


Read and Write Functions (For Advanded Users)
---------------------------------------------

.. warning::
These secondary functions, mostly from the **utils** folder,=
**do not contain Type or Value Input Checks**. Therefore, they are being
listed with a warning that only advanced users should use these functions, as
they were not designed with input error checks.

Advanced users who wish to use these functions can find them
`here <https://github.com/GOMC-WSU/MoSDeF-dihedral-fit/tree/main/mosdef_dihedral_fit/utils>`_.


.. automodule:: mosdef_dihedral_fit.utils.file_read_and_write
:members: get_atom_names_and_elements_from_mol2, get_atom_names_and_elements_from_pdb, write_xyz_file_from_gaussian_coordinates, write_restart_coor_from_xyz_file, check_gaussian_angle_energy_file_correct, check_gaussian_optimized_coordinate_file_correct, get_final_gaussian_output_file_data, get_gaussian_log_file_data, write_qm_data_files, get_matching_dihedral_info_and_opls_fitting_data


Math and Operation Functions (For Advanded Users)
-------------------------------------------------

.. warning::
These secondary functions, mostly from the **utils** folder,=
**do not contain Type or Value Input Checks**. Therefore, they are being
listed with a warning that only advanced users should use these functions, as
they were not designed with input error checks.

Advanced users who wish to use these functions can find them
`here <https://github.com/GOMC-WSU/MoSDeF-dihedral-fit/tree/main/mosdef_dihedral_fit/utils>`_.


.. automodule:: mosdef_dihedral_fit.utils.math_operations
:noindex: dihedral_angle
:members: round_to_sig_figs, normalize_vector, angle_between_2_vectors, check_previous_qm_values_match, sum_opls_const_1_plus_or_minus_cos_n_values, periodic_dihedral_n_1_2_3_4_5, RB_torsion_n_1_2_3_4_5, opls_dihedral_n_1_2_3_4

Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ DIHEDRALS * CHARMM
! Boltzmann = 0.0019872041 kcal / (mol * K)
!
! type_1 type_2 type_3 type_4 Kchi n delta ! extended_type_1 extended_type_2 extended_type_3 extended_type_4
HC CT CT HC 0.5 0 90.0 ! TMP_opls_140 TMP_opls_135 TMP_opls_135 TMP_opls_140
HC CT CT HC 0.5 0 90.0 ! TMP_opls_140 TMP_opls_135 TMP_opls_135 TMP_opls_140
! The input dihedral to periodic dihedral conversion error is OK [error <= 10^(-10)]
! Maximum( |(input dihedral calc)-(periodic dihedral calc)| ) = 3.608224830031759e-16

Expand Down
11 changes: 6 additions & 5 deletions mosdef_dihedral_fit/tests/test_file_read_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def test_write_qm_data_files(self):
out_indices = []
write_qm_data_files({full_path: out_indices})
assert os.path.exists("extracted_gaussian_data/dihedral.txt")

def test_get_matching_dihedral_info_and_opls_fitting_data(self):
out = get_matching_dihedral_info_and_opls_fitting_data(
fit_dihedral_atom_types=["HC", "CT", "CT", "HC"],
Expand Down Expand Up @@ -304,7 +304,7 @@ def test_get_matching_dihedral_info_and_opls_fitting_data(self):
[4, 1, 2, 8],
[5, 1, 2, 6],
[5, 1, 2, 7],
[5, 1, 2, 8],
[5, 1, 2, 8]
]
assert dihedral_numsList == expected_dihedralnumsList

Expand All @@ -327,7 +327,7 @@ def test_get_matching_dihedral_info_and_opls_fitting_data(self):
[-1.012159, 1.156346, 0.0],
[0.0, 0.76376, 0.0],
[-0.0, -0.76376, 0.0],
[1.012159, -1.156346, 0.0],
[1.012159, -1.156346, 0.0]
]
assert np.allclose(coordsList[0][0], expected_coords)
assert np.shape(coordsList) == (37, 9, 4, 3)
Expand All @@ -351,10 +351,10 @@ def test_get_matching_dihedral_info_and_opls_fitting_data(self):
8.999999999999845,
8.99999999999938,
2.780442542871242e-12,
8.99999999999753,
8.99999999999753
]
assert np.allclose(opls_paramsList[0], expected_opls_params)

def test_change_gomc_ff_file_dihedral_values(self):
new_file = self.get_fn(
"gaussian/HC_CT_CT_HC/output/GOMC_pdb_psf_ff_files_dihedrals_zeroed.inp"
Expand All @@ -379,3 +379,4 @@ def test_change_gomc_ff_file_dihedral_values(self):
break

assert checkFile

Loading

0 comments on commit eb0fe44

Please sign in to comment.