Skip to main content

Rotamer

Struct Rotamer 

Source
#[repr(C)]
pub struct Rotamer<const N: usize> { pub r: [u8; N], pub prob: f32, pub chi_mean: [f32; N], pub chi_sigma: [f32; N], }
Expand description

A backbone-dependent rotamer entry.

Each rotamer describes a discrete side-chain conformation at a specific backbone (φ, ψ) grid point, or the bilinearly interpolated result at an arbitrary (φ, ψ) query. The const generic N encodes the number of χ dihedral angles for the residue type.

§Layout

#[repr(C)] guarantees a stable, deterministic field layout across compiler versions. This is beneficial for reproducible binary output and cache-line alignment predictability.

§Examples

use dunbrack::{Residue, Rotamer, Val};

let rots: Vec<Rotamer<1>> = Val::rotamers(-60.0, -40.0).collect();
assert_eq!(rots.len(), 3);
assert!(rots[0].prob > 0.0);
assert!(rots[0].chi_sigma[0] > 0.0);

Fields§

§r: [u8; N]

Rotamer bin indices (1-based).

For a residue with N χ angles, only r[0..N] carry meaningful values. Each element identifies, for its corresponding χ angle, which discrete bin (gauche+, trans, gauche−, etc.) the rotamer belongs to.

§prob: f32

Prior probability P(r | φ, ψ).

At exact grid points this is the raw value from the Dunbrack 2010 library. After bilinear interpolation the probabilities are re-normalized so that Σ prob = 1.0 across all rotamers.

§chi_mean: [f32; N]

Mean χ dihedral angles in degrees.

After interpolation, these are computed via circular weighted mean (using sin/cos decomposition) to correctly handle the ±180° wraparound.

§chi_sigma: [f32; N]

Standard deviations of the χ angles in degrees.

Always positive. Interpolated via standard (linear) bilinear weighting — no circular treatment is needed for positive scalars.

Trait Implementations§

Source§

impl<const N: usize> Clone for Rotamer<N>

Source§

fn clone(&self) -> Rotamer<N>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const N: usize> Debug for Rotamer<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> PartialEq for Rotamer<N>

Source§

fn eq(&self, other: &Rotamer<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N: usize> Copy for Rotamer<N>

Source§

impl<const N: usize> StructuralPartialEq for Rotamer<N>

Auto Trait Implementations§

§

impl<const N: usize> Freeze for Rotamer<N>

§

impl<const N: usize> RefUnwindSafe for Rotamer<N>

§

impl<const N: usize> Send for Rotamer<N>

§

impl<const N: usize> Sync for Rotamer<N>

§

impl<const N: usize> Unpin for Rotamer<N>

§

impl<const N: usize> UnsafeUnpin for Rotamer<N>

§

impl<const N: usize> UnwindSafe for Rotamer<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.