Struct pdbtbx::Chain[][src]

pub struct Chain { /* fields omitted */ }

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]

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]

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]

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 add
  • residue_id - the id construct of the Residue to add the Atom to
  • conformer_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]

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]

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]

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]

impl PartialEq<Chain> for Chain[src]

impl PartialOrd<Chain> for Chain[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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.