Struct pdbtbx::Conformer[][src]

pub struct Conformer { /* fields omitted */ }

A Conformer of a Conformer containing multiple atoms, analogous to ‘atom_group’ in cctbx

Implementations

impl Conformer[src]

pub fn new(
    name: &str,
    alt_loc: Option<&str>,
    atom: Option<Atom>
) -> Option<Conformer>
[src]

Create a new Conformer

Arguments

  • name - the name
  • alt_loc - the alternative location identifier, if not blank
  • atom - if available it can already add an atom

Fails

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

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

The name of the Conformer

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

Set the name of the Conformer

Fails

It fails if any of the characters of the new name are invalid.

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

The alternative location of the Conformer

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

Set the alternative location of the Conformer

Fails

It fails if any of the characters of the new alternative location are invalid.

pub fn remove_alternative_location(&mut self)[src]

Set the alternative location of the Conformer to None

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

Returns the uniquely identifying construct for this Conformer. It consists of the name and the alternative location.

pub fn modification(&self) -> Option<&(String, String)>[src]

Get the modification of this Conformer e.g., chemical or post-translational. These will be saved in the MODRES records in the PDB file

pub fn set_modification(
    &mut self,
    new_modification: (String, String)
) -> Result<(), String>
[src]

Set the modification of this Conformer e.g., chemical or post-translational. These will be saved in the MODRES records in the PDB file

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

The amount of atoms making up this Conformer

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

Get a specific atom from list of atoms making up this Conformer.

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

Arguments

  • index - the index of the atom

Fails

It fails when the index is outside bounds.

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

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

pub fn add_atom(&mut self, new_atom: Atom)[src]

Add a new atom to the list of atoms making up this Conformer.

Arguments

  • new_atom - the new Atom to add

pub fn amino_acid(&self) -> bool[src]

Returns if this Conformer is an amino acid

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

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

Remove the Atom specified.

Arguments

  • index - the index of the atom to remove

Panics

It panics when the index is outside bounds.

pub fn remove_atom_by_serial_number(&mut self, serial_number: usize) -> bool[src]

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

Arguments

  • serial_number - the serial number of the Atom to remove

Panics

It panics when the index is outside bounds.

pub fn remove_atom_by_name(&mut self, name: String) -> bool[src]

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

Arguments

  • name - the name of the Atom 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 atoms making up this Conformer, the new position is immediately set.

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

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

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

Extend the Atoms on this Conformer by the given iterator.

pub fn sort(&mut self)[src]

Sort the Atoms of this Conformer

Trait Implementations

impl Clone for Conformer[src]

impl Debug for Conformer[src]

impl Display for Conformer[src]

impl Eq for Conformer[src]

impl Ord for Conformer[src]

impl PartialEq<Conformer> for Conformer[src]

impl PartialOrd<Conformer> for Conformer[src]

impl StructuralEq for Conformer[src]

impl StructuralPartialEq for Conformer[src]

Auto Trait Implementations

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.