Struct pdbtbx::Model [−][src]
A Model containing multiple Chains
Implementations
impl Model
[src]
pub fn new(serial_number: usize) -> Model
[src]
pub fn serial_number(&self) -> usize
[src]
The serial number of this Model
pub fn set_serial_number(&mut self, new_number: usize)
[src]
Set the serial number of this Model
pub fn chain_count(&self) -> usize
[src]
Get the amount of Chains making up this Model.
pub fn residue_count(&self) -> usize
[src]
Get the amount of Residues making up this Model.
pub fn conformer_count(&self) -> usize
[src]
Get the amount of Conformers making up this Model.
pub fn atom_count(&self) -> usize
[src]
Get the amount of Atoms making up this Model.
pub fn chain(&self, index: usize) -> Option<&Chain>
[src]
Get a specific Chain from list of Chains making up this Model.
Arguments
index
- the index of the Chain
Fails
It fails when the index is outside bounds.
pub fn chain_mut(&mut self, index: usize) -> Option<&mut Chain>
[src]
Get a specific Chain as a mutable reference from list of Chains making up this Model.
Arguments
index
- the index of the Chain
Fails
It fails when the index is outside bounds.
pub fn residue(&self, index: usize) -> Option<&Residue>
[src]
Get a specific Residue from the Residues making up this Model.
Arguments
index
- the index of the Residue
Fails
It fails when the index is outside bounds.
pub fn residue_mut(&mut self, index: usize) -> Option<&mut Residue>
[src]
Get a specific Residue as a mutable reference from the Residues making up this Model.
Arguments
index
- the index of the Residue
Fails
It fails when the index is outside bounds.
pub fn conformer(&self, index: usize) -> Option<&Conformer>
[src]
Get a specific Conformer from the Conformers making up this Model.
Arguments
index
- the index of the Conformer
Fails
It fails when the index is outside bounds.
pub fn conformer_mut(&mut self, index: usize) -> Option<&mut Conformer>
[src]
Get a specific Conformer as a mutable reference from the Conformers making up this Model.
Arguments
index
- the index of the Conformer
Fails
It fails when the index is outside bounds.
pub fn atom(&self, index: usize) -> Option<&Atom>
[src]
Get a specific Atom from the Atoms making up this Model.
Arguments
index
- the index of the Atom
Fails
It fails when the index is outside bounds.
pub fn atom_mut(&mut self, index: usize) -> Option<&mut Atom>
[src]
Get a specific Atom as a mutable reference from the Atoms making up this Model.
Arguments
index
- the index of the Atom
Fails
It fails when the index is outside bounds.
pub fn chains(&self) -> impl DoubleEndedIterator<Item = &Chain> + '_
[src]
Get the list of Chains making up this Model. Double ended so iterating from the end is just as fast as from the start.
pub fn chains_mut(&mut self) -> impl DoubleEndedIterator<Item = &mut Chain> + '_
[src]
Get the list of Chains as mutable references making up this Model. Double ended so iterating from the end is just as fast as from the start.
pub fn residues(&self) -> impl DoubleEndedIterator<Item = &Residue> + '_
[src]
Get the list of Residues making up this Model. Double ended so iterating from the end is just as fast as from the start.
pub fn residues_mut(
&mut self
) -> impl DoubleEndedIterator<Item = &mut Residue> + '_
[src]
&mut self
) -> impl DoubleEndedIterator<Item = &mut Residue> + '_
Get the list of Residues as mutable references making up this Model. Double ended so iterating from the end is just as fast as from the start.
pub fn conformers(&self) -> impl DoubleEndedIterator<Item = &Conformer> + '_
[src]
Get the list of Conformers making up this Model. Double ended so iterating from the end is just as fast as from the start.
pub fn conformers_mut(
&mut self
) -> impl DoubleEndedIterator<Item = &mut Conformer> + '_
[src]
&mut self
) -> impl DoubleEndedIterator<Item = &mut Conformer> + '_
Get the list of Conformers as mutable references making up this Model. Double ended so iterating from the end is just as fast as from the start.
pub fn atoms(&self) -> impl DoubleEndedIterator<Item = &Atom> + '_
[src]
Get the list of Atoms making up this Model. Double ended so iterating from the end is just as fast as from the start.
pub fn atoms_mut(&mut self) -> impl DoubleEndedIterator<Item = &mut Atom> + '_
[src]
Get the list of Atoms as mutable references making up this Model. Double ended so iterating from the end is just as fast as from the start.
pub fn add_atom(
&mut self,
new_atom: Atom,
chain_id: &str,
residue_id: (isize, Option<&str>),
conformer_id: (&str, Option<&str>)
)
[src]
&mut self,
new_atom: Atom,
chain_id: &str,
residue_id: (isize, Option<&str>),
conformer_id: (&str, Option<&str>)
)
Add a new Atom to this Model. It finds if there already is a Chain with the given chain_id
if there is it will add this atom to that Chain, otherwise it will create a new Chain and add that to the list of Chains making up this Model. It does the same for the Residue, so it will create a new one if there does not yet exist a Residue with the given serial number.
Arguments
new_atom
- the new Atom to addchain_id
- the id of the Chain to add the Atom toresidue_id
- the id construct of the Residue to add the Atom toconformer_id
- the id construct of the Conformer to add the Atom to
Panics
It panics if the Chain id or Residue name contains any invalid characters.
pub fn add_chain(&mut self, chain: Chain)
[src]
Add a Chain to the list of Chains making up this Model. This does not detect any duplicates of names or serial numbers in the list of Chains.
pub fn remove_atoms_by<F>(&mut self, predicate: F) where
F: Fn(&Atom) -> bool,
[src]
F: Fn(&Atom) -> bool,
Remove all Atoms matching the given predicate. As this is done in place this is the fastest way to remove Atoms from this Model.
pub fn remove_conformers_by<F>(&mut self, predicate: F) where
F: Fn(&Conformer) -> bool,
[src]
F: Fn(&Conformer) -> bool,
Remove all Conformers matching the given predicate. As this is done in place this is the fastest way to remove Conformers from this Model.
pub fn remove_residues_by<F>(&mut self, predicate: F) where
F: Fn(&Residue) -> bool,
[src]
F: Fn(&Residue) -> bool,
Remove all Residues matching the given predicate. As this is done in place this is the fastest way to remove Residues from this Model.
pub fn remove_chains_by<F>(&mut self, predicate: F) where
F: Fn(&Chain) -> bool,
[src]
F: Fn(&Chain) -> bool,
Remove all Chains matching the given predicate. As this is done in place this is the fastest way to remove Chains from this Model.
pub fn remove_chain(&mut self, index: usize) -> Chain
[src]
Remove the Chain specified.
Arguments
index
- the index of the Chain to remove
Panics
It panics when the index is outside bounds.
pub fn remove_chain_by_id(&mut self, id: String) -> bool
[src]
Remove the Chain specified. It returns true
if it found a matching Chain and removed it.
It removes the first matching Chain from the list.
Arguments
id
- the id of the Chain to remove
pub fn remove_empty(&mut self)
[src]
Remove all empty Chain from this Model, and all empty Residues from the Chains.
pub fn apply_transformation(&mut self, transformation: &TransformationMatrix)
[src]
Apply a transformation to the position of all atoms making up this Model, the new position is immediately set.
pub fn join(&mut self, other: Model)
[src]
Join this Model with another Model, this moves all atoms from the other Model to this Model. All other (meta) data of this Model will stay the same. It will add new Chains and Residues as defined in the other model.
pub fn extend<T: IntoIterator<Item = Chain>>(&mut self, iter: T)
[src]
Extend the Chains on this Model by the given iterator.
pub fn sort(&mut self)
[src]
Sort the Chains of this Model
Trait Implementations
impl Clone for Model
[src]
impl Debug for Model
[src]
impl Display for Model
[src]
impl Eq for Model
[src]
impl Ord for Model
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Model> for Model
[src]
impl PartialOrd<Model> for Model
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Model
[src]
impl StructuralPartialEq for Model
[src]
Auto Trait Implementations
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnwindSafe for Model
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,