Struct pdbtbx::Chain [−][src]
A Chain containing multiple Residues
Implementations
impl Chain
[src]
pub fn new(id: &str) -> Option<Chain>
[src]
Create a new Chain
Arguments
id
- the identifier
Fails
It fails if the identifier is an invalid character.
pub fn id(&self) -> &str
[src]
The ID of the Chain
pub fn set_id(&mut self, new_id: &str) -> bool
[src]
Set the ID of the Chain, returns false
if the new id is an invalid character.
The ID will be changed to uppercase as requested by PDB/PDBx standard.
pub fn database_reference(&self) -> Option<&DatabaseReference>
[src]
Get the database reference, if any, for this chain.
pub fn database_reference_mut(&mut self) -> Option<&mut DatabaseReference>
[src]
Get the database reference mutably, if any, for this chain.
pub fn set_database_reference(&mut self, reference: DatabaseReference)
[src]
Set the database reference for this chain.
pub fn residue_count(&self) -> usize
[src]
Get the amount of Residues making up this Chain
pub fn conformer_count(&self) -> usize
[src]
Get the amount of Conformers making up this Chain
pub fn atom_count(&self) -> usize
[src]
Get the amount of Atoms making up this Chain
pub fn residue(&self, index: usize) -> Option<&Residue>
[src]
Get a specific Residue from list of Residues making up this Chain.
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 list of Residues making up this Chain.
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 list of Conformers making up this Chain.
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 list of Conformers making up this Chain.
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 Chain.
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 Chain.
Arguments
index
- the index of the Atom
Fails
It fails when the index is outside bounds.
pub fn residues(&self) -> impl DoubleEndedIterator<Item = &Residue> + '_
[src]
Get the list of Residues making up this Chain. 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 Chain. 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 Chain. 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 Chain. 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 Chain. 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 Chain. Double ended so iterating from the end is just as fast as from the start.
pub fn add_atom(
&mut self,
new_atom: Atom,
residue_id: (isize, Option<&str>),
conformer_id: (&str, Option<&str>)
)
[src]
&mut self,
new_atom: Atom,
residue_id: (isize, Option<&str>),
conformer_id: (&str, Option<&str>)
)
Add a new Atom to this Chain. It finds if there already is a Residue with the given serial number if there is it will add this atom to that Residue, otherwise it will create a new Residue and add that to the list of Residues making up this Chain.
Arguments
new_atom
- the new Atom to addresidue_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 Residue name contains any invalid characters.
pub fn add_residue(&mut self, residue: Residue)
[src]
Add a Residue end of to the list of Residues making up this Chain. This does not detect any duplicates of names or serial numbers in the list of Residues.
pub fn insert_residue(&mut self, index: usize, residue: Residue)
[src]
Inserts a Residue to the index in the list of Residues making up this Chain. This does not detect any duplicates of names or serial numbers in the list of Residues.
This panics if index > len
.
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 Chain.
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 Chain.
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 Chain.
pub fn remove_residue(&mut self, index: usize)
[src]
Remove the Residue specified.
Arguments
index
- the index of the Residue to remove
Panics
It panics when the index is outside bounds.
pub fn remove_residue_by_id(&mut self, id: (isize, Option<&str>)) -> bool
[src]
Remove the Residue specified. It returns true
if it found a matching Residue and removed it.
It removes the first matching Residue from the list.
Arguments
id
- the id construct of the Residue to remove (see Residue.id())
pub fn remove_empty(&mut self)
[src]
Remove all empty Residues from this Chain, and all empty Conformers from the Residues.
pub fn apply_transformation(&mut self, transformation: &TransformationMatrix)
[src]
Apply a transformation to the position of all atoms making up this Chain, the new position is immediately set.
pub fn join(&mut self, other: Chain)
[src]
Join this Chain with another Chain, this moves all atoms from the other Chain to this Chain. All other (meta) data of this Chain will stay the same.
pub fn extend<T: IntoIterator<Item = Residue>>(&mut self, iter: T)
[src]
Extend the Residues on this Chain by the given iterator.
pub fn sort(&mut self)
[src]
Sort the residues of this chain
Trait Implementations
impl Clone for Chain
[src]
impl Debug for Chain
[src]
impl Display for Chain
[src]
impl Eq for Chain
[src]
impl Ord for Chain
[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<Chain> for Chain
[src]
impl PartialOrd<Chain> for Chain
[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 Chain
[src]
impl StructuralPartialEq for Chain
[src]
Auto Trait Implementations
impl RefUnwindSafe for Chain
impl Send for Chain
impl Sync for Chain
impl Unpin for Chain
impl UnwindSafe for Chain
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>,