[−][src]Struct pdbtbx::Model
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. This disregards all Hetero Chains.
pub fn residue_count(&self) -> usize
[src]
Get the amount of Residues making up this Model. This disregards all Hetero Residues.
pub fn atom_count(&self) -> usize
[src]
Get the amount of Atoms making up this Model. This disregards all Hetero Atoms.
pub fn total_chain_count(&self) -> usize
[src]
Get the amount of Chains making up this Model. This includes all Hetero Chains.
pub fn total_residue_count(&self) -> usize
[src]
Get the amount of Residues making up this Model. This includes all Hetero Residues.
pub fn total_atom_count(&self) -> usize
[src]
Get the amount of Atoms making up this Model. This includes all Hetero Atoms.
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 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. This disregards all Hetero Chains. 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. This disregards all Hetero Chains. 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. This disregards all Hetero Residues. 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. This disregards all Hetero Residues. 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. This disregards all Hetero Atoms. 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. This disregards all Hetero Atoms. Double ended so iterating from the end is just as fast as from the start.
pub fn hetero_chains(&self) -> impl DoubleEndedIterator<Item = &Chain> + '_
[src]
Get the list of Chains making up this Model. This disregards all Normal Chains. Double ended so iterating from the end is just as fast as from the start.
pub fn hetero_chains_mut(
&mut self
) -> impl DoubleEndedIterator<Item = &mut Chain> + '_
[src]
&mut self
) -> impl DoubleEndedIterator<Item = &mut Chain> + '_
Get the list of Chains as mutable references making up this Model. This disregards all Normal Chains. Double ended so iterating from the end is just as fast as from the start.
pub fn hetero_residues(&self) -> impl DoubleEndedIterator<Item = &Residue> + '_
[src]
Get the list of Residues making up this Model. This disregards all Normal Residues. Double ended so iterating from the end is just as fast as from the start.
pub fn hetero_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. This disregards all Normal Residues Double ended so iterating from the end is just as fast as from the start.
pub fn hetero_atoms(&self) -> impl DoubleEndedIterator<Item = &Atom> + '_
[src]
Get the list of Atoms making up this Model. This disregards all Normal Atoms. Double ended so iterating from the end is just as fast as from the start.
pub fn hetero_atoms_mut(
&mut self
) -> impl DoubleEndedIterator<Item = &mut Atom> + '_
[src]
&mut self
) -> impl DoubleEndedIterator<Item = &mut Atom> + '_
Get the list of Atoms as mutable references making up this Model. This disregards all Normal Atoms. Double ended so iterating from the end is just as fast as from the start.
pub fn all_chains(&self) -> impl DoubleEndedIterator<Item = &Chain> + '_
[src]
Get the list of Chains making up this Model. This includes all Normal and Hetero Chains. Double ended so iterating from the end is just as fast as from the start.
pub fn all_chains_mut(
&mut self
) -> impl DoubleEndedIterator<Item = &mut Chain> + '_
[src]
&mut self
) -> impl DoubleEndedIterator<Item = &mut Chain> + '_
Get the list of Chains as mutable references making up this Model. This includes all Normal and Hetero Chains. Double ended so iterating from the end is just as fast as from the start.
pub fn all_residues(&self) -> impl DoubleEndedIterator<Item = &Residue> + '_
[src]
Get the list of Residues making up this Model. This includes all Normal and Hetero Residues. Double ended so iterating from the end is just as fast as from the start.
pub fn all_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. This includes all Normal and Hetero Residues Double ended so iterating from the end is just as fast as from the start.
pub fn all_atoms(&self) -> impl DoubleEndedIterator<Item = &Atom> + '_
[src]
Get the list of Atoms making up this Model. This includes all Normal and Hetero Atoms. Double ended so iterating from the end is just as fast as from the start.
pub fn all_atoms_mut(
&mut self
) -> impl DoubleEndedIterator<Item = &mut Atom> + '_
[src]
&mut self
) -> impl DoubleEndedIterator<Item = &mut Atom> + '_
Get the list of Atoms as mutable references making up this Model. This includes all Normal and Hetero Atoms. 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: char,
residue_serial_number: usize,
residue_name: [char; 3]
)
[src]
&mut self,
new_atom: Atom,
chain_id: char,
residue_serial_number: usize,
residue_name: [char; 3]
)
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_serial_number
- the serial number of the Residue to add the Atom toresidue_name
- the name of the Residue to add the Atom to, only used to create a new Residue if needed
Panics
It panics if the Chain id or Residue name contains any invalid characters.
pub fn add_hetero_atom(
&mut self,
new_atom: Atom,
chain_id: char,
residue_serial_number: usize,
residue_name: [char; 3]
)
[src]
&mut self,
new_atom: Atom,
chain_id: char,
residue_serial_number: usize,
residue_name: [char; 3]
)
Add a new Atom to the hetero Atoms of 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_serial_number
- the serial number of the Residue to add the Atom toresidue_name
- the name of the Residue to add the Atom to, only used to create a new Residue if needed
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 add_hetero_chain(&mut self, chain: Chain)
[src]
Add a Chain to the list of Hetero 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. The predicate will be run on all Atoms (Normal and Hetero). As this is done in place this is the fastest way to remove Atoms 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. The predicate will be run on all Residues (Normal and Hetero). 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. The predicate will be run on all Chains (Normal and Hetero). 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)
[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_id(&mut self, id: char) -> 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 apply_transformation(&mut self, transformation: &TransformationMatrix)
[src]
Apply a transformation to the position of all atoms (Normal and Hetero) 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.
Trait Implementations
impl Clone for Model
[src]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Model
[src]
impl Display for Model
[src]
impl PartialEq<Model> for Model
[src]
Auto Trait Implementations
impl RefUnwindSafe for Model
[src]
impl Send for Model
[src]
impl Sync for Model
[src]
impl Unpin for Model
[src]
impl UnwindSafe for Model
[src]
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>,