use crate::model::residue::ResidueType;
pub const VDW_CUTOFF: f32 = 6.0;
pub const VDW_CUTOFF_SQ: f32 = VDW_CUTOFF * VDW_CUTOFF;
pub const HBOND_CUTOFF: f32 = 4.5;
pub const HBOND_CUTOFF_SQ: f32 = HBOND_CUTOFF * HBOND_CUTOFF;
pub const COULOMB_CUTOFF: f32 = 8.0;
pub const COULOMB_CUTOFF_SQ: f32 = COULOMB_CUTOFF * COULOMB_CUTOFF;
pub const COULOMB_CONST: f32 = 332.0637;
pub const HBOND_N: usize = 4;
pub const ROTAMER_BIAS_CAP: f32 = 8.0;
const _: () = assert!(
VDW_CUTOFF <= COULOMB_CUTOFF,
"cutoff invariant violated: VDW_CUTOFF ≤ COULOMB_CUTOFF"
);
pub fn max_interaction_cutoff(electrostatics: Option<f32>) -> f32 {
let main = match electrostatics {
None => VDW_CUTOFF,
Some(_) => COULOMB_CUTOFF,
};
main.max(HBOND_CUTOFF)
}
pub fn rotamer_weight(rt: ResidueType) -> f32 {
use ResidueType as T;
match rt {
T::Cys | T::Cym | T::Cyx => 16.5,
T::Asp | T::Ash => 6.0,
T::Glu | T::Glh => 3.0,
T::Phe => 4.5,
T::Hid | T::Hie | T::Hip => 9.0,
T::Ile => 3.0,
T::Lys | T::Lyn => 6.0,
T::Leu => 6.0,
T::Met => 4.5,
T::Asn => 6.0,
T::Pro => 4.5,
T::Gln => 7.5,
T::Arg | T::Arn => 4.5,
T::Ser => 4.5,
T::Thr => 6.0,
T::Val => 6.0,
T::Trp => 10.5,
T::Tyr | T::Tym => 4.5,
T::Gly | T::Ala => 0.0,
}
}