Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tmol/database/default/scoring/ljlk.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
global_parameters:
max_dis : 6.0
spline_start : 4.5 #max_dis - 1.5
lj_switch_dis2sigma : 0.6
lj_dlin_sigma_factor : 0.6
lj_hbond_OH_donor_dis : 2.6
lj_hbond_hdis : 1.75
lj_hbond_dis : 3.0
Expand Down
2 changes: 1 addition & 1 deletion tmol/database/scoring/ljlk.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class LJLKGlobalParameters:
lj_hbond_OH_donor_dis: float
lj_hbond_dis: float
lj_hbond_hdis: float
lj_switch_dis2sigma: float
lj_dlin_sigma_factor: float
lk_min_dis2sigma: float
lkb_water_dist: float
lkb_water_angle_sp2: Angle
Expand Down
1 change: 1 addition & 0 deletions tmol/score/ljlk/ljlk_energy_term.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def _t(ts):
global_params = torch.stack(
_t(
[
self.global_params.lj_dlin_sigma_factor,
self.global_params.lj_hbond_dis,
self.global_params.lj_hbond_OH_donor_dis,
self.global_params.lj_hbond_hdis,
Expand Down
2 changes: 1 addition & 1 deletion tmol/score/ljlk/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
class LJLKGlobalParams(TensorGroup):
max_dis: Tensor[torch.float32][...]
spline_start: Tensor[torch.float32][...]
lj_dlin_sigma_factor: Tensor[torch.float32][...]
lj_hbond_OH_donor_dis: Tensor[torch.float32][...]
lj_hbond_dis: Tensor[torch.float32][...]
lj_hbond_hdis: Tensor[torch.float32][...]
lj_switch_dis2sigma: Tensor[torch.float32][...]
lk_min_dis2sigma: Tensor[torch.float32][...]

# not clear if this belongs here or in a separate class
Expand Down
6 changes: 4 additions & 2 deletions tmol/score/ljlk/potentials/lj.hh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ struct lj_score {
} else {
Real sigma = lj_sigma<Real>(i, j, global);
Real epsilon = std::sqrt(i.lj_wdepth * j.lj_wdepth);
Real d_lin = sigma * 0.6;
Real d_lin = sigma * global.lj_dlin_sigma_factor;
Real cpoly_dmin =
sigma > 4.5 ? (sigma > cpoly_dmax - 0.1 ? cpoly_dmax - 0.1 : sigma)
: 4.5;
Expand Down Expand Up @@ -122,7 +122,9 @@ struct lj_score {
Real weight = connectivity_weight<Real, Real>(bonded_path_length);
Real epsilon = std::sqrt(i.lj_wdepth * j.lj_wdepth);

Real d_lin = sigma * 0.6;
// Real d_lin = sigma * 0.6;
Real d_lin = sigma * global.lj_dlin_sigma_factor;

Real cpoly_dmin = 4.5;
if (sigma > cpoly_dmin) cpoly_dmin = sigma;

Expand Down
7 changes: 6 additions & 1 deletion tmol/score/ljlk/potentials/params.hh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ struct LJLKTypeParams {

template <typename Real>
struct LJGlobalParams {
Real lj_dlin_sigma_factor;
Real lj_hbond_dis;
Real lj_hbond_OH_donor_dis;
Real lj_hbond_hdis;
Expand Down Expand Up @@ -115,14 +116,18 @@ struct LKTypeParamTensors {

template <typename Real, tmol::Device D>
struct LJGlobalParamTensors {
TView<Real, 1, D> lj_dlin_sigma_factor;
TView<Real, 1, D> lj_hbond_dis;
TView<Real, 1, D> lj_hbond_OH_donor_dis;
TView<Real, 1, D> lj_hbond_hdis;

template <typename Idx>
auto operator[](Idx i) const {
return LJGlobalParams<Real>{
lj_hbond_dis[i], lj_hbond_OH_donor_dis[i], lj_hbond_hdis[i]};
lj_dlin_sigma_factor[i],
lj_hbond_dis[i],
lj_hbond_OH_donor_dis[i],
lj_hbond_hdis[i]};
}
};

Expand Down
2 changes: 2 additions & 0 deletions tmol/score/ljlk/potentials/params.pybind.hh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ struct type_caster<tmol::score::ljlk::potentials::LJGlobalParams<Real>> {
bool load(handle src, bool convert) {
nvtx_range_function();

CAST_ATTR(src, value, lj_dlin_sigma_factor);
CAST_ATTR(src, value, lj_hbond_dis);
CAST_ATTR(src, value, lj_hbond_OH_donor_dis);
CAST_ATTR(src, value, lj_hbond_hdis);
Expand All @@ -133,6 +134,7 @@ struct type_caster<
bool load(handle src, bool convert) {
nvtx_range_function();

CAST_ATTR(src, value, lj_dlin_sigma_factor);
CAST_ATTR(src, value, lj_hbond_dis);
CAST_ATTR(src, value, lj_hbond_OH_donor_dis);
CAST_ATTR(src, value, lj_hbond_hdis);
Expand Down
Loading