Struct pdbtbx::Atom[][src]

pub struct Atom { /* fields omitted */ }

A struct to represent a single Atom in a protein

Implementations

impl Atom[src]

pub fn new(
    hetero: bool,
    serial_number: usize,
    atom_name: &str,
    x: f64,
    y: f64,
    z: f64,
    occupancy: f64,
    b_factor: f64,
    element: &str,
    charge: isize
) -> Option<Atom>
[src]

Create a new Atom

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

Get if this atom is an hetero atom (true), a non standard atom, or a normal atom (false)

pub fn set_hetero(&mut self, new_hetero: bool)[src]

Set if this atom is an hetero atom (true), a non standard atom, or a normal atom (false)

pub fn pos(&self) -> (f64, f64, f64)[src]

Get the position of the atom as a tuple of f64, in the following order: (x, y, z) Returned in the units of the PDB file, which is defined to be orthogonal coordinate system in Å

pub fn set_pos(&mut self, new_pos: (f64, f64, f64)) -> Result<(), String>[src]

Set the position of the atom as a tuple of f64, in the following order: (x, y, z)

Panics

It panics if one or more of the numbers are not finite (f64.is_finite())

pub fn x(&self) -> f64[src]

Get the X position of the atom Returned in the units of the PDB file, which is defined to be orthogonal coordinate system in Å

pub fn set_x(&mut self, new_pos: f64) -> Result<(), String>[src]

Set the X position of the atom

Panics

It panics if new_pos is not finite (f64.is_finite())

pub fn y(&self) -> f64[src]

Get the Y position of the atom Returned in the units of the PDB file, which is defined to be orthogonal coordinate system in Å

pub fn set_y(&mut self, new_pos: f64) -> Result<(), String>[src]

Set the Y position of the atom

Panics

It panics if new_pos is not finite (f64.is_finite())

pub fn z(&self) -> f64[src]

Get the Z position of the atom Returned in the units of the PDB file, which is defined to be orthogonal coordinate system in Å

pub fn set_z(&mut self, new_pos: f64) -> Result<(), String>[src]

Set the Z position of the atom

Panics

It panics if new_pos is not finite (f64.is_finite())

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

Get the serial number of the atom This number is defined to be unique in the containing model, which is not enforced

pub fn set_serial_number(&mut self, new_serial_number: usize)[src]

Set the serial number of the atom This number is defined to be unique in the containing model, which is not enforced

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

Get the name of the atom The name is max 4 characters and is trimmed

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

Set the name of the atom. The name will be changed to uppercase as requested by PDB/PDBx standard. If the name is invalid an error message is provided.

Errors

The name can only contain valid characters, the ASCII graphic characters (char.is_ascii_graphic() || char == ’ ’)

pub fn occupancy(&self) -> f64[src]

Get the occupancy of the atom

pub fn set_occupancy(&mut self, new_occupancy: f64) -> Result<(), String>[src]

Set the occupancy of the atom

Panics

It panics if new_occupancy is not finite (f64.is_finite())

pub fn b_factor(&self) -> f64[src]

Get the b-factor or temperature factor of the atom

pub fn set_b_factor(&mut self, new_b_factor: f64) -> Result<(), String>[src]

Set the b-factor of the atom

Panics

It panics if new_b_factor is not finite (f64.is_finite())

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

Get the element of this atom

pub fn atomic_number(&self) -> Option<usize>[src]

Get the atomic number of this atom. If defined it uses self.element(), otherwise it uses self.name() of the atom.

Fails

It fails when the element() or name() is not a valid element name.

pub fn atomic_radius(&self) -> Option<f64>[src]

Get the atomic radius of this Atom in Å. The radius is defined up to ‘Cm’ or 96. Source: Martin Rahm, Roald Hoffmann, and N. W. Ashcroft. Atomic and Ionic Radii of Elements 1-96. Chemistry - A European Journal, 22(41):14625–14632, oct 2016. URL: http://doi.org/10.1002/chem.201602949. Updated to the corrigendum: https://doi.org/10.1002/chem.201700610

Fails

It fails if the element name if this Atom is not defined (see self.atomic_number()). It also fails when the atomic radius is not defined for the given atomic number, so if the atomic number is higher than 96.

pub fn vanderwaals_radius(&self) -> Option<f64>[src]

Gets the van der Waals radius for this Atom in Å.The radius is defined up until ‘Es’ or 99. Source: Alvarez, S. (2013). A cartography of the van der Waals territories. Dalton Transactions, 42(24), 8617. https://doi.org/10.1039/c3dt50599e

Fails

It fails if the element name if this Atom is not defined (see self.atomic_number()). It also fails when the atomic radius is not defined for the given atomic number, so if the atomic number is higher than 99.

pub fn covalent_bond_radii(
    &self
) -> Option<(usize, Option<usize>, Option<usize>)>
[src]

Gets the covalent bond radii for this Atom. The result is the radius for a single, double and triple bond, where the last two are optional. All values are given in picometers. Sources:

  • P. Pyykkö; M. Atsumi (2009). “Molecular Single-Bond Covalent Radii for Elements 1-118”. Chemistry: A European Journal. 15 (1): 186–197. doi:10.1002/chem.200800987
  • P. Pyykkö; M. Atsumi (2009). “Molecular Double-Bond Covalent Radii for Elements Li–E112”. Chemistry: A European Journal. 15 (46): 12770–12779. doi:10.1002/chem.200901472
  • P. Pyykkö; S. Riedel; M. Patzschke (2005). “Triple-Bond Covalent Radii”. Chemistry: A European Journal. 11 (12): 3511–3520. doi:10.1002/chem.200401299

Fails

It fails if the element name if this Atom is not defined (see self.atomic_number()).

pub fn set_element(&mut self, new_element: &str) -> Result<(), String>[src]

Set the element of this atom. The element will be changed to uppercase as requested by PDB/PDBx standard.

Fails

It fails if the element contains invalid characters (only ASCII graphic and space is allowed). It also fails if the string is too ling, the max length is 2 characters.

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

Get the charge of the atom

pub fn pdb_charge(&self) -> String[src]

Get the charge in the PDB format [0-9][-+]

pub fn set_charge(&mut self, new_charge: isize)[src]

Set the charge of this atom

pub fn anisotropic_temperature_factors(&self) -> Option<[[f64; 3]; 3]>[src]

Get the anisotropic temperature factors, if available

pub fn set_anisotropic_temperature_factors(&mut self, factors: [[f64; 3]; 3])[src]

Set the anisotropic temperature factors

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

Get if this atom is likely to be a part of the backbone of a protein

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

Apply a transformation to the position of this atom, the new position is immediately set.

pub fn corresponds(&self, other: &Atom) -> bool[src]

See if the other Atom corresponds with this Atom. Which means that the Atoms are equal except for the position, occupancy, and b_factor. Used to validate that multiple models contain the same atoms, but with different positional data.

pub fn distance_wrapping(&self, other: &Atom, cell: &UnitCell) -> f64[src]

Gives the distance between the centers of two atoms. Wrapping around the unit cell if needed.

pub fn distance(&self, other: &Atom) -> f64[src]

Gives the distance between the centers of two atoms.

pub fn overlaps(&self, other: &Atom) -> Option<bool>[src]

Checks if this Atom overlaps with the given atom. It overlaps if the sphere defined as sitting at the atom position with a radius of the atomic radius (atom.atomic_radius()) intersect with this sphere from the other Atom.

Fails

It fails if for any one of the two atoms the radius (.atomic_radius()) is not defined.

pub fn overlaps_wrapping(&self, other: &Atom, cell: &UnitCell) -> Option<bool>[src]

Checks if this Atom overlaps with the given atom. It overlaps if the sphere defined as sitting at the atom position with a radius of the atomic radius (atom.atomic_radius()) intersect with this sphere from the other Atom. Wrapping around the unit cell if needed.

Fails

It fails if for any one of the two atoms the radius (.atomic_radius()) is not defined.

Trait Implementations

impl Clone for Atom[src]

impl Debug for Atom[src]

impl Display for Atom[src]

impl Eq for Atom[src]

As there are a lot of checks to make sure only ‘normal’ f64 values are used Atom satisfies the properties needed for Eq while having f64 values.

impl Ord for Atom[src]

impl PartialEq<Atom> for Atom[src]

impl PartialOrd<Atom> for Atom[src]

impl StructuralPartialEq for Atom[src]

Auto Trait Implementations

impl RefUnwindSafe for Atom

impl Send for Atom

impl Sync for Atom

impl Unpin for Atom

impl UnwindSafe for Atom

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.