Skip to content

Commit

Permalink
less output
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocamilloni committed Dec 10, 2024
1 parent eb6cae8 commit c5bc9d3
Show file tree
Hide file tree
Showing 9 changed files with 160,355 additions and 160,399 deletions.
48 changes: 2 additions & 46 deletions src/multiego/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,10 +850,8 @@ def generate_OO_LJ(meGO_ensemble):
rc_LJ["md_threshold"] = 1.0
rc_LJ["epsilon"] = -rc_LJ["c12"]
rc_LJ["sigma"] = rc_LJ["c12"] ** (1.0 / 12.0)
rc_LJ["cutoff"] = 1.45 * rc_LJ["c12"] ** (1.0 / 12.0)
rc_LJ["mg_sigma"] = rc_LJ["c12"] ** (1 / 12)
rc_LJ["mg_epsilon"] = -rc_LJ["c12"]
rc_LJ["distance"] = rc_LJ["cutoff"]
rc_LJ["learned"] = 0
rc_LJ["1-4"] = "1>4"
molecule_names_dictionary = {name.split("_", 1)[1]: name for name in meGO_ensemble["molecules_idx_sbtype_dictionary"]}
Expand All @@ -867,7 +865,7 @@ def generate_OO_LJ(meGO_ensemble):
return rc_LJ


def set_sig_epsilon(meGO_LJ, needed_fields, parameters):
def set_sig_epsilon(meGO_LJ, parameters):
"""
Set the epsilon parameter for LJ interactions based on probability and distance.
Expand Down Expand Up @@ -991,41 +989,9 @@ def set_sig_epsilon(meGO_LJ, needed_fields, parameters):
# add a flag to identify learned contacts
meGO_LJ.loc[:, "learned"] = 1

# keep only needed fields
meGO_LJ = meGO_LJ[needed_fields]
return meGO_LJ


def consistency_checks(meGO_LJ):
"""
Perform consistency checks on LJ parameters.
This function performs consistency checks on LJ (Lennard-Jones) parameters to avoid data inconsistencies.
Parameters
----------
meGO_LJ : pd.DataFrame
DataFrame containing LJ parameters such as repulsive term (rep) and cutoff distance (cutoff).
Raises
------
RuntimeError
If inconsistencies are found between the calculated cutoff distance and the provided cutoff values.
Notes
-----
This function is primarily used for debugging purposes to ensure data integrity and consistency.
"""
# This is a debug check to avoid data inconsistencies
if (np.abs(1.45 * meGO_LJ["rep"] ** (1 / 12) - meGO_LJ["cutoff"])).max() > 10e-6:
print(
meGO_LJ[["ai", "aj", "same_chain", "source", "rep", "cutoff"]]
.loc[(np.abs(1.45 * meGO_LJ["rep"] ** (1 / 12) - meGO_LJ["cutoff"]) > 10e-6)]
.to_string()
)
exit("HERE SOMETHING BAD HAPPEND: There are inconsistent cutoff/c12 values")


def apply_symmetries(meGO_ensemble, meGO_input, symmetry):
"""
Apply symmetries to the molecular ensemble.
Expand Down Expand Up @@ -1135,8 +1101,6 @@ def generate_LJ(meGO_ensemble, train_dataset, parameters):
"sigma",
"epsilon",
"1-4",
"distance",
"cutoff",
"rep",
"mg_sigma",
"mg_epsilon",
Expand All @@ -1146,7 +1110,7 @@ def generate_LJ(meGO_ensemble, train_dataset, parameters):
]

# generate attractive and repulsive interactions
meGO_LJ = set_sig_epsilon(meGO_LJ, needed_fields, parameters)
meGO_LJ = set_sig_epsilon(meGO_LJ, parameters)[needed_fields]

et = time.time()
elapsed_time = et - st
Expand All @@ -1165,8 +1129,6 @@ def generate_LJ(meGO_ensemble, train_dataset, parameters):
print("\t- Done in:", elapsed_time, "seconds")

print("\t- Merging multiple states (training, symmetries, inter/intra)")
# meGO consistency checks
consistency_checks(meGO_LJ)

# Merging of multiple simulations:
# Here we sort all the atom pairs based on the distance and the probability.
Expand Down Expand Up @@ -1337,10 +1299,6 @@ def generate_LJ(meGO_ensemble, train_dataset, parameters):
meGO_LJ_14["epsilon"] < 0.0, -meGO_LJ_14["epsilon"], 4 * meGO_LJ_14["epsilon"] * (meGO_LJ_14["sigma"] ** 12)
)

# meGO consistency checks
consistency_checks(meGO_LJ)
consistency_checks(meGO_LJ_14)

et = time.time()
elapsed_time = et - st
print("\t- Done in:", elapsed_time, "seconds")
Expand Down Expand Up @@ -1440,8 +1398,6 @@ def sort_LJ(meGO_ensemble, meGO_LJ):
"rc_probability",
"md_threshold",
"rc_threshold",
"rep",
"cutoff",
"same_chain",
"source",
"number_ai",
Expand Down
89,748 changes: 44,874 additions & 44,874 deletions test/test_outputs/abetaref/case_1/ffnonbonded.itp

Large diffs are not rendered by default.

3,946 changes: 1,973 additions & 1,973 deletions test/test_outputs/gpref/case_1/ffnonbonded.itp

Large diffs are not rendered by default.

21,072 changes: 10,536 additions & 10,536 deletions test/test_outputs/gpref/case_2/ffnonbonded.itp

Large diffs are not rendered by default.

210 changes: 105 additions & 105 deletions test/test_outputs/het_trim/case_1/ffnonbonded.itp

Large diffs are not rendered by default.

676 changes: 338 additions & 338 deletions test/test_outputs/het_trim/case_2/ffnonbonded.itp

Large diffs are not rendered by default.

99,616 changes: 49,808 additions & 49,808 deletions test/test_outputs/lyso-bnz_ref/case_1/ffnonbonded.itp

Large diffs are not rendered by default.

99,616 changes: 49,808 additions & 49,808 deletions test/test_outputs/lyso-bnz_ref/case_2/ffnonbonded.itp

Large diffs are not rendered by default.

5,822 changes: 2,911 additions & 2,911 deletions test/test_outputs/ttrref/case_1/ffnonbonded.itp

Large diffs are not rendered by default.

0 comments on commit c5bc9d3

Please sign in to comment.