Skip to content

Commit

Permalink
Merge pull request #511 from carlocamilloni/new_sigma_prior
Browse files Browse the repository at this point in the history
New sigma prior
  • Loading branch information
carlocamilloni authored Dec 12, 2024
2 parents bf861ae + 4e02eba commit 4b3c5e9
Show file tree
Hide file tree
Showing 6 changed files with 1,817 additions and 1,811 deletions.
12 changes: 7 additions & 5 deletions src/multiego/ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ def init_LJ_datasets(meGO_ensemble, matrices, pairs14, exclusion_bonds14, args):

pairwise_c12 = np.where(
oxygen_mask,
11.4 * np.sqrt(type_ai_mapped.map(type_to_c12) * type_aj_mapped.map(type_to_c12)),
(11.4 / 0.9**12) * np.sqrt(type_ai_mapped.map(type_to_c12) * type_aj_mapped.map(type_to_c12)),
np.sqrt(
train_dataset["ai"].map(meGO_ensemble["sbtype_c12_dict"])
* train_dataset["aj"].map(meGO_ensemble["sbtype_c12_dict"])
Expand All @@ -792,7 +792,7 @@ def init_LJ_datasets(meGO_ensemble, matrices, pairs14, exclusion_bonds14, args):

pairwise_mg_sigma = np.where(
oxygen_mask,
(11.4 * np.sqrt(type_ai_mapped.map(type_to_c12) * type_aj_mapped.map(type_to_c12))) ** (1 / 12),
((11.4 / 0.9**12) * np.sqrt(type_ai_mapped.map(type_to_c12) * type_aj_mapped.map(type_to_c12))) ** (1 / 12),
(
train_dataset["ai"].map(meGO_ensemble["sbtype_mg_c12_dict"])
* train_dataset["aj"].map(meGO_ensemble["sbtype_mg_c12_dict"])
Expand All @@ -807,7 +807,7 @@ def init_LJ_datasets(meGO_ensemble, matrices, pairs14, exclusion_bonds14, args):

pairwise_mg_epsilon = np.where(
oxygen_mask,
-11.4 * np.sqrt(type_ai_mapped.map(type_to_c12) * type_aj_mapped.map(type_to_c12)),
-(11.4 / 0.9**12) * np.sqrt(type_ai_mapped.map(type_to_c12) * type_aj_mapped.map(type_to_c12)),
(
train_dataset["ai"].map(meGO_ensemble["sbtype_mg_c6_dict"])
* train_dataset["aj"].map(meGO_ensemble["sbtype_mg_c6_dict"])
Expand Down Expand Up @@ -841,7 +841,7 @@ def generate_OO_LJ(meGO_ensemble):
rc_LJ = pd.DataFrame(combinations, columns=["ai", "aj"])
rc_LJ["type"] = 1
rc_LJ["c6"] = 0.0
rc_LJ["c12"] = 11.4 * np.sqrt(
rc_LJ["c12"] = (11.4 / 0.9**12) * np.sqrt(
rc_LJ["ai"].map(meGO_ensemble["sbtype_c12_dict"]) * rc_LJ["aj"].map(meGO_ensemble["sbtype_c12_dict"])
)
rc_LJ["same_chain"] = False
Expand Down Expand Up @@ -1540,7 +1540,9 @@ def make_pairs_exclusion_topology(meGO_ensemble, meGO_LJ_14, args):
| (df["aj"].map(meGO_ensemble["sbtype_type_dict"]) == "O")
),
"c12",
] *= 11.4
] *= (
11.4 / 0.9**12
)
df["same_chain"] = True
df["probability"] = 1.0
df["rc_probability"] = 1.0
Expand Down
134 changes: 68 additions & 66 deletions src/multiego/resources/type_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
mg_eps = 0.110
mg_eps_ch2 = 0.100
mg_eps_ch1 = 0.090
sig6 = 0.9**6
sig12 = 0.9**12
# Dataframe with GROMOS atom types and associated parameters
gromos_atp = pd.DataFrame(
{
Expand Down Expand Up @@ -35,76 +37,76 @@
],
"at.num": [8, 8, 8, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 16, 6, 15, 8, 6, 20],
"rc_c12": [
2.631580e-07, # "O",
1.724403e-07, # "OM",
5.018430e-07, # "OA",
8.752940e-07, # "N",
2.596154e-06, # "NT",
8.752940e-07, # "NL",
1.506347e-06, # "NR",
8.752940e-07, # "NZ",
8.752940e-07, # "NE",
2.598570e-06, # "C",
2.598570e-06, # "CH"
6.555574e-05, # "CH1"
6.555574e-05, # "CH1a"
1.543890e-05, # "CH2"
8.595562e-06, # "CH3"
1.193966e-05, # "CH2r"
2.724050e-06, # "S",
8.736473e-06, # "CH3p"
3.893600e-06, # "P",
3.558824e-07, # "OE",
6.298560e-06, # "CR1",
2.659360e-07, # "C0",
2.631580e-07 * sig12, # "O",
1.724403e-07 * sig12, # "OM",
5.018430e-07 * sig12, # "OA",
8.752940e-07 * sig12, # "N",
2.596154e-06 * sig12, # "NT",
8.752940e-07 * sig12, # "NL",
1.506347e-06 * sig12, # "NR",
8.752940e-07 * sig12, # "NZ",
8.752940e-07 * sig12, # "NE",
2.598570e-06 * sig12, # "C",
2.598570e-06 * sig12, # "CH"
6.555574e-05 * sig12, # "CH1"
6.555574e-05 * sig12, # "CH1a"
1.543890e-05 * sig12, # "CH2"
8.595562e-06 * sig12, # "CH3"
1.193966e-05 * sig12, # "CH2r"
2.724050e-06 * sig12, # "S",
8.736473e-06 * sig12, # "CH3p"
3.893600e-06 * sig12, # "P",
3.558824e-07 * sig12, # "OE",
6.298560e-06 * sig12, # "CR1",
2.659360e-07 * sig12, # "C0",
],
"mg_c12": [
1e-06 / 1.27911 * mg_eps, # "O",
7.4149321e-07 / 1.72504 * mg_eps, # "OM",
1.505529e-06 / 0.84961 * mg_eps, # "OA",
2.319529e-06 / 0.63980 * mg_eps, # "N",
5.0625e-06 / 0.29314 * mg_eps, # "NT",
2.319529e-06 / 0.63980 * mg_eps, # "NL",
3.389281e-06 / 0.43786 * mg_eps, # "NR",
2.319529e-06 / 0.63980 * mg_eps, # "NZ",
2.319529e-06 / 0.63980 * mg_eps, # "NE",
4.937284e-06 / 0.27741 * mg_eps, # "C",
4.937284e-06 / 0.27741 * mg_eps, # "CH"
9.70225e-05 / 0.09489 * mg_eps_ch1, # "CH1"
9.70225e-05 / 0.09489 * mg_eps_ch1, # "CH1a"
3.3965584e-05 / 0.4105 * mg_eps_ch2, # "CH2"
2.6646244e-05 / 0.8671 * mg_eps, # "CH3"
2.8058209e-05 / 0.4792 * mg_eps_ch2, # "CH2r"
1.3075456e-05 / 1.90587 * mg_eps, # "S",
2.6646244e-05 / 0.86715 * mg_eps, # "CH3p"
2.2193521e-05 / 2.44674 * mg_eps, # "P",
1.21e-06 / 1.05711 * mg_eps, # "OE",
1.5116544e-05 / 0.50266 * mg_eps, # "CR1",
0 * mg_eps, # "C0",
1e-06 / 1.27911 * mg_eps * sig12, # "O",
7.4149321e-07 / 1.72504 * mg_eps * sig12, # "OM",
1.505529e-06 / 0.84961 * mg_eps * sig12, # "OA",
2.319529e-06 / 0.63980 * mg_eps * sig12, # "N",
5.0625e-06 / 0.29314 * mg_eps * sig12, # "NT",
2.319529e-06 / 0.63980 * mg_eps * sig12, # "NL",
3.389281e-06 / 0.43786 * mg_eps * sig12, # "NR",
2.319529e-06 / 0.63980 * mg_eps * sig12, # "NZ",
2.319529e-06 / 0.63980 * mg_eps * sig12, # "NE",
4.937284e-06 / 0.27741 * mg_eps * sig12, # "C",
4.937284e-06 / 0.27741 * mg_eps * sig12, # "CH"
9.70225e-05 / 0.09489 * mg_eps_ch1 * sig12, # "CH1"
9.70225e-05 / 0.09489 * mg_eps_ch1 * sig12, # "CH1a"
3.3965584e-05 / 0.4105 * mg_eps_ch2 * sig12, # "CH2"
2.6646244e-05 / 0.8671 * mg_eps * sig12, # "CH3"
2.8058209e-05 / 0.4792 * mg_eps_ch2 * sig12, # "CH2r"
1.3075456e-05 / 1.90587 * mg_eps * sig12, # "S",
2.6646244e-05 / 0.86715 * mg_eps * sig12, # "CH3p"
2.2193521e-05 / 2.44674 * mg_eps * sig12, # "P",
1.21e-06 / 1.05711 * mg_eps * sig12, # "OE",
1.5116544e-05 / 0.50266 * mg_eps * sig12, # "CR1",
0 * mg_eps * sig12, # "C0",
],
"mg_c6": [
0.0022619536 / 1.27911 * mg_eps, # "O",
0.0022619536 / 1.72504 * mg_eps, # "OM",
0.0022619536 / 0.84961 * mg_eps, # "OA",
0.0024364096 / 0.63980 * mg_eps, # "N",
0.0024364096 / 0.29314 * mg_eps, # "NT",
0.0024364096 / 0.63980 * mg_eps, # "NL",
0.0024364096 / 0.43786 * mg_eps, # "NR",
0.0024364096 / 0.63980 * mg_eps, # "NZ",
0.0024364096 / 0.63980 * mg_eps, # "NE",
0.0023406244 / 0.27741 * mg_eps, # "C",
0.0023406244 / 0.27741 * mg_eps, # "CH"
0.00606841 / 0.09489 * mg_eps_ch1, # "CH1"
0.00606841 / 0.09489 * mg_eps_ch1, # "CH1a"
0.0074684164 / 0.41054 * mg_eps_ch2, # "CH2"
0.0096138025 / 0.86715 * mg_eps, # "CH3"
0.0073342096 / 0.47928 * mg_eps_ch2, # "CH2r"
0.0099840064 / 1.90587 * mg_eps, # "S",
0.0096138025 / 0.86715 * mg_eps, # "CH3p"
0.01473796 / 2.44674 * mg_eps, # "P",
0.0022619536 / 1.05711 * mg_eps, # "OE",
0.0055130625 / 0.50266 * mg_eps, # "CR1",
0 * mg_eps, # "C0",
0.0022619536 / 1.27911 * mg_eps * sig6, # "O",
0.0022619536 / 1.72504 * mg_eps * sig6, # "OM",
0.0022619536 / 0.84961 * mg_eps * sig6, # "OA",
0.0024364096 / 0.63980 * mg_eps * sig6, # "N",
0.0024364096 / 0.29314 * mg_eps * sig6, # "NT",
0.0024364096 / 0.63980 * mg_eps * sig6, # "NL",
0.0024364096 / 0.43786 * mg_eps * sig6, # "NR",
0.0024364096 / 0.63980 * mg_eps * sig6, # "NZ",
0.0024364096 / 0.63980 * mg_eps * sig6, # "NE",
0.0023406244 / 0.27741 * mg_eps * sig6, # "C",
0.0023406244 / 0.27741 * mg_eps * sig6, # "CH"
0.00606841 / 0.09489 * mg_eps_ch1 * sig6, # "CH1"
0.00606841 / 0.09489 * mg_eps_ch1 * sig6, # "CH1a"
0.0074684164 / 0.41054 * mg_eps_ch2 * sig6, # "CH2"
0.0096138025 / 0.86715 * mg_eps * sig6, # "CH3"
0.0073342096 / 0.47928 * mg_eps_ch2 * sig6, # "CH2r"
0.0099840064 / 1.90587 * mg_eps * sig6, # "S",
0.0096138025 / 0.86715 * mg_eps * sig6, # "CH3p"
0.01473796 / 2.44674 * mg_eps * sig6, # "P",
0.0022619536 / 1.05711 * mg_eps * sig6, # "OE",
0.0055130625 / 0.50266 * mg_eps * sig6, # "CR1",
0 * mg_eps * sig6, # "C0",
],
}
)
Expand Down
2 changes: 1 addition & 1 deletion src/multiego/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def create_pairs_14_dataframe(atomtype1, atomtype2, c6=0.0, shift=0, prefactor=N
if constant is not None:
pairs_14_c12.append(constant)
if prefactor is not None:
pairs_14_c12.append(prefactor * np.sqrt(line_atomtype1["c12"] * line_atomtype2["c12"]))
pairs_14_c12.append((prefactor / 0.9**12) * np.sqrt(line_atomtype1["c12"] * line_atomtype2["c12"]))

pairs_14 = pd.DataFrame(
columns=[
Expand Down
Binary file modified test/test_inputs/ttrref/ref_inter/intermat_1_1.ndx.gz
Binary file not shown.
Loading

0 comments on commit 4b3c5e9

Please sign in to comment.