Struct pdbtbx::Residue[][src]

pub struct Residue { /* fields omitted */ }

A Residue containing multiple Residues

Implementations

impl Residue[src]

pub fn new(
    number: isize,
    insertion_code: Option<&str>,
    conformer: Option<Conformer>
) -> Option<Residue>
[src]

Create a new Residue

Arguments

  • number - the serial number
  • insertion_code - the insertion code
  • conformer - if available it can already add an conformer

Fails

It fails if any of the characters making up the insertion_code are invalid.

pub fn serial_number(&self) -> isize[src]

The serial number of the Residue

pub fn set_serial_number(&mut self, new_number: isize)[src]

Set the serial number of the Residue

pub fn insertion_code(&self) -> Option<&str>[src]

The insertion code of the Residue

pub fn set_insertion_code(&mut self, new_code: &str) -> bool[src]

Set the insertion code of the Residue It returns false if the new_code contains invalid characters

pub fn remove_insertion_code(&mut self)[src]

Set the insertion code of the Residue to None

pub fn id(&self) -> (isize, Option<&str>)[src]

Returns the uniquely identifying construct for this Residue. It consists of the serial number and the insertion code.

pub fn name(&self) -> Option<&str>[src]

The ID or name of the Residue, it will only give a value if there is only one conformer or if all conformers have the same name

pub fn conformer_count(&self) -> usize[src]

The amount of Conformers making up this Residue

pub fn atom_count(&self) -> usize[src]

Get the amount of Atoms making up this Residue

pub fn conformer(&self, index: usize) -> Option<&Conformer>[src]

Get a specific conformer from list of conformers making up this Residue.

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 Residue.

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 list of Atoms making up this Residue.

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 list of Atoms making up this Residue.

Arguments

  • index - the index of the Atom

Fails

It fails when the index is outside bounds.

pub fn conformers(&self) -> impl DoubleEndedIterator<Item = &Conformer> + '_[src]

Get the list of conformers making up this Residue. 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 Residue. 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 Residue. 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 Residue. Double ended so iterating from the end is just as fast as from the start.

pub fn add_conformer(&mut self, new_conformer: Conformer)[src]

Add a new conformer to the list of conformers making up this Residue.

Arguments

  • new_conformer - the new conformer to add

pub fn add_atom(&mut self, new_atom: Atom, conformer_id: (&str, Option<&str>))[src]

Add a new Atom to this Residue. 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_serial_number - the serial number of the Residue to add the Atom to
  • residue_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 Residue name contains any invalid characters.

pub fn remove_empty(&mut self)[src]

Remove all empty Conformers from this Residue.

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 Residue.

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 Residue.

pub fn remove_conformer(&mut self, index: usize)[src]

Remove the conformer specified.

Arguments

  • index - the index of the conformer to remove

Panics

It panics when the index is outside bounds.

pub fn remove_conformer_by_id(&mut self, id: (&str, Option<&str>)) -> bool[src]

Remove the conformer specified. It returns true if it found a matching conformer and removed it. It removes the first matching conformer from the list.

Arguments

  • id - the identifying construct of the Conformer to remove

Panics

It panics when the index is outside bounds.

pub fn apply_transformation(&mut self, transformation: &TransformationMatrix)[src]

Apply a transformation to the position of all conformers making up this Residue, the new position is immediately set.

pub fn join(&mut self, other: Residue)[src]

Join this Residue with another Residue, this moves all conformers from the other Residue to this Residue. All other (meta) data of this Residue will stay the same.

pub fn extend<T: IntoIterator<Item = Conformer>>(&mut self, iter: T)[src]

Extend the conformers on this Residue by the given iterator.

pub fn sort(&mut self)[src]

Sort the conformers of this Residue

Trait Implementations

impl Clone for Residue[src]

impl Debug for Residue[src]

impl Display for Residue[src]

impl Eq for Residue[src]

impl Ord for Residue[src]

impl PartialEq<Residue> for Residue[src]

impl PartialOrd<Residue> for Residue[src]

impl StructuralEq for Residue[src]

impl StructuralPartialEq for Residue[src]

Auto Trait Implementations

impl RefUnwindSafe for Residue

impl Send for Residue

impl Sync for Residue

impl Unpin for Residue

impl UnwindSafe for Residue

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.