pub struct TopologyBuilder { /* private fields */ }Expand description
Builder responsible for creating Topology objects from a Structure.
The builder can augment the internal template database with additional
hetero templates and tweak geometric cutoffs for disulfide, peptide, and
nucleic bonds before running TopologyBuilder::build.
Implementations§
Source§impl TopologyBuilder
impl TopologyBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a builder that uses default cutoffs and no extra templates.
Default cutoffs were chosen to capture typical covalent geometry in Ångström. They can be overridden through the builder-style setters.
Sourcepub fn add_hetero_template(self, template: Template) -> Self
pub fn add_hetero_template(self, template: Template) -> Self
Registers a new template that will be used for hetero residues.
§Arguments
template- Template describing atoms and bonds for a residue that is classified asResidueCategory::Hetero.
Sourcepub fn disulfide_cutoff(self, cutoff: f64) -> Self
pub fn disulfide_cutoff(self, cutoff: f64) -> Self
Configures the maximum SG···SG distance allowed for disulfide bonds.
§Arguments
cutoff- Maximum distance in Ångström for connecting cysteine SG atoms.
Sourcepub fn build(self, structure: Structure) -> Result<Topology, Error>
pub fn build(self, structure: Structure) -> Result<Topology, Error>
Builds a Topology for the provided structure.
All intra-residue bonds are taken from templates and terminal rules, while inter-residue bonds rely on distance checks using the configured cutoffs.
§Arguments
structure- Structure for which to build the bond topology.
§Returns
A Result containing the built Topology or an Error.
§Errors
Returns Error when a required template or atom is missing.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TopologyBuilder
impl RefUnwindSafe for TopologyBuilder
impl Send for TopologyBuilder
impl Sync for TopologyBuilder
impl Unpin for TopologyBuilder
impl UnsafeUnpin for TopologyBuilder
impl UnwindSafe for TopologyBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.