Skip to main content

Atom

Struct Atom 

Source
pub struct Atom {
Show 14 fields pub name: AtomStr, pub resname: AtomStr, pub resid: i32, pub resindex: usize, pub atomic_number: u8, pub mass: Float, pub charge: Float, pub chain: char, pub bfactor: Float, pub occupancy: Float, pub type_name: Option<AtomStr>, pub type_id: Option<u32>, pub formal_charge: Option<i32>, pub flags: Option<AtomFlags>,
}
Expand description

Information about the atom except its coordinates.

Retained as the detached, densely-packed construction/interchange row even though Topology stores atoms column-wise (Struct-of-Arrays). The four optional force-field/chemistry fields are OptionNone means “never assigned”.

Fields§

§name: AtomStr

Atom name.

§resname: AtomStr

Residue name.

§resid: i32

Residue id (aka residue number). This could be negative!

§resindex: usize

Residue index. Assigned when reading the topology. Unique for each contigous span of resid. Starts from zero.

§atomic_number: u8

Atomic number in the periodic table.

§mass: Float

Mass in atomic units

§charge: Float

Partial (working) charge in electron charges. The integer formal charge is stored separately in formal_charge.

§chain: char§bfactor: Float§occupancy: Float

PDB occupancy.

§type_name: Option<AtomStr>

Name of the atom type (force field).

§type_id: Option<u32>

Unique id of the atom type.

§formal_charge: Option<i32>

Integer formal charge (e.g. from an SDF M CHG record).

§flags: Option<AtomFlags>

Perceived-chemistry flags (ring membership, aromaticity, …).

Implementations§

Source§

impl Atom

Source

pub fn new() -> Self

Source

pub fn with_name(self, name: &str) -> Self

Source

pub fn with_resname(self, resname: &str) -> Self

Source

pub fn with_resid(self, resid: i32) -> Self

Source

pub fn with_resindex(self, resindex: usize) -> Self

Source

pub fn with_atomic_number(self, n: u8) -> Self

Source

pub fn with_mass(self, mass: Float) -> Self

Source

pub fn with_charge(self, charge: Float) -> Self

Source

pub fn with_chain(self, chain: char) -> Self

Source

pub fn with_bfactor(self, bfactor: Float) -> Self

Source

pub fn with_occupancy(self, occupancy: Float) -> Self

Source

pub fn with_type_name(self, type_name: &str) -> Self

Source

pub fn with_type_id(self, type_id: u32) -> Self

Source

pub fn with_formal_charge(self, formal_charge: i32) -> Self

Source

pub fn with_flags(self, flags: AtomFlags) -> Self

Source

pub fn guess(self) -> Self

Chainable version of guess_element_and_mass_from_name().

Source

pub fn hydrogen() -> Self

Source

pub fn carbon() -> Self

Source

pub fn nitrogen() -> Self

Source

pub fn oxygen() -> Self

Source

pub fn phosphorus() -> Self

Source

pub fn sulfur() -> Self

Source

pub fn guess_element_from_name(&mut self)

Source

pub fn guess_element_and_mass_from_name(&mut self)

Trait Implementations§

Source§

impl AtomLike for Atom

Source§

fn get_name(&self) -> &str

Atom name.
Source§

fn get_resname(&self) -> &str

Residue name.
Source§

fn get_resid(&self) -> isize

Residue id (aka residue number). This could be negative!
Source§

fn get_resindex(&self) -> usize

Residue index. Unique for each contiguous span of resid. Starts from zero.
Source§

fn get_atomic_number(&self) -> u8

Atomic number in the periodic table.
Source§

fn get_mass(&self) -> Float

Mass in atomic units.
Source§

fn get_charge(&self) -> Float

Partial (working) charge in electron charges.
Source§

fn get_chain(&self) -> char

PDB chain identifier.
Source§

fn get_bfactor(&self) -> Float

PDB B-factor.
Source§

fn get_occupancy(&self) -> Float

PDB occupancy.
Source§

fn get_type_name(&self) -> Option<&str>

Name of the atom type (force field).
Source§

fn get_type_id(&self) -> Option<u32>

Unique id of the atom type.
Source§

fn get_formal_charge(&self) -> Option<i32>

Integer formal charge (e.g. from an SDF M CHG record).
Source§

fn get_flags(&self) -> Option<AtomFlags>

Perceived-chemistry flags.
Source§

fn is_in_ring(&self) -> bool

Whether the atom is a member of some ring (false when flags are unset).
Source§

fn is_aromatic(&self) -> bool

Whether the atom belongs to an aromatic ring (false when flags are unset).
Source§

fn vdw(&self) -> Float

Van der Waals radius (nm) from the atomic number; 0.15 nm for unknown (Z=0).
Source§

impl AtomLikeMut for Atom

Source§

fn set_name(&mut self, name: &str)

Source§

fn set_resname(&mut self, resname: &str)

Source§

fn set_resid(&mut self, resid: isize)

Source§

fn set_resindex(&mut self, resindex: usize)

Source§

fn set_atomic_number(&mut self, atomic_number: u8)

Source§

fn set_mass(&mut self, mass: Float)

Source§

fn set_charge(&mut self, charge: Float)

Source§

fn set_chain(&mut self, chain: char)

Source§

fn set_bfactor(&mut self, bfactor: Float)

Source§

fn set_occupancy(&mut self, occupancy: Float)

Source§

fn set_type_name(&mut self, type_name: &str)

Source§

fn set_type_id(&mut self, type_id: u32)

Source§

fn set_formal_charge(&mut self, formal_charge: i32)

Source§

fn set_flags(&mut self, flags: AtomFlags)

Source§

fn set_in_ring(&mut self, v: bool)

Source§

fn set_aromatic(&mut self, v: bool)

Source§

impl Clone for Atom

Source§

fn clone(&self) -> Atom

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Atom

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Atom

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'a> Extend<&'a Atom> for AtomStorage

Source§

fn extend<I: IntoIterator<Item = &'a Atom>>(&mut self, iter: I)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl Extend<Atom> for AtomStorage

Source§

fn extend<I: IntoIterator<Item = Atom>>(&mut self, iter: I)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<T: AtomLike> From<&T> for Atom

Source§

fn from(a: &T) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<Atom> for AtomStorage

Source§

fn from_iter<I: IntoIterator<Item = Atom>>(iter: I) -> Self

Creates a value from an iterator. Read more

Auto Trait Implementations§

§

impl Freeze for Atom

§

impl RefUnwindSafe for Atom

§

impl Send for Atom

§

impl Sync for Atom

§

impl Unpin for Atom

§

impl UnsafeUnpin for Atom

§

impl UnwindSafe for Atom

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.