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 Option — None means “never assigned”.
Fields§
§name: AtomStrAtom name.
resname: AtomStrResidue name.
resid: i32Residue id (aka residue number). This could be negative!
resindex: usizeResidue index. Assigned when reading the topology. Unique for each contigous span of resid. Starts from zero.
atomic_number: u8Atomic number in the periodic table.
mass: FloatMass in atomic units
charge: FloatPartial (working) charge in electron charges. The integer formal charge is stored
separately in formal_charge.
chain: char§bfactor: Float§occupancy: FloatPDB 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
impl Atom
pub fn new() -> Self
pub fn with_name(self, name: &str) -> Self
pub fn with_resname(self, resname: &str) -> Self
pub fn with_resid(self, resid: i32) -> Self
pub fn with_resindex(self, resindex: usize) -> Self
pub fn with_atomic_number(self, n: u8) -> Self
pub fn with_mass(self, mass: Float) -> Self
pub fn with_charge(self, charge: Float) -> Self
pub fn with_chain(self, chain: char) -> Self
pub fn with_bfactor(self, bfactor: Float) -> Self
pub fn with_occupancy(self, occupancy: Float) -> Self
pub fn with_type_name(self, type_name: &str) -> Self
pub fn with_type_id(self, type_id: u32) -> Self
pub fn with_formal_charge(self, formal_charge: i32) -> Self
pub fn with_flags(self, flags: AtomFlags) -> Self
pub fn hydrogen() -> Self
pub fn carbon() -> Self
pub fn nitrogen() -> Self
pub fn oxygen() -> Self
pub fn phosphorus() -> Self
pub fn sulfur() -> Self
pub fn guess_element_from_name(&mut self)
pub fn guess_element_and_mass_from_name(&mut self)
Trait Implementations§
Source§impl AtomLike for Atom
impl AtomLike for Atom
Source§fn get_resname(&self) -> &str
fn get_resname(&self) -> &str
Source§fn get_resindex(&self) -> usize
fn get_resindex(&self) -> usize
Source§fn get_atomic_number(&self) -> u8
fn get_atomic_number(&self) -> u8
Source§fn get_charge(&self) -> Float
fn get_charge(&self) -> Float
Source§fn get_bfactor(&self) -> Float
fn get_bfactor(&self) -> Float
Source§fn get_occupancy(&self) -> Float
fn get_occupancy(&self) -> Float
Source§fn get_type_name(&self) -> Option<&str>
fn get_type_name(&self) -> Option<&str>
Source§fn get_type_id(&self) -> Option<u32>
fn get_type_id(&self) -> Option<u32>
Source§fn get_formal_charge(&self) -> Option<i32>
fn get_formal_charge(&self) -> Option<i32>
M CHG record).Source§fn is_in_ring(&self) -> bool
fn is_in_ring(&self) -> bool
Source§fn is_aromatic(&self) -> bool
fn is_aromatic(&self) -> bool
Source§impl AtomLikeMut for Atom
impl AtomLikeMut for Atom
fn set_name(&mut self, name: &str)
fn set_resname(&mut self, resname: &str)
fn set_resid(&mut self, resid: isize)
fn set_resindex(&mut self, resindex: usize)
fn set_atomic_number(&mut self, atomic_number: u8)
fn set_mass(&mut self, mass: Float)
fn set_charge(&mut self, charge: Float)
fn set_chain(&mut self, chain: char)
fn set_bfactor(&mut self, bfactor: Float)
fn set_occupancy(&mut self, occupancy: Float)
fn set_type_name(&mut self, type_name: &str)
fn set_type_id(&mut self, type_id: u32)
fn set_formal_charge(&mut self, formal_charge: i32)
fn set_flags(&mut self, flags: AtomFlags)
fn set_in_ring(&mut self, v: bool)
fn set_aromatic(&mut self, v: bool)
Source§impl<'a> Extend<&'a Atom> for AtomStorage
impl<'a> Extend<&'a Atom> for AtomStorage
Source§fn extend<I: IntoIterator<Item = &'a Atom>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = &'a Atom>>(&mut self, iter: I)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl Extend<Atom> for AtomStorage
impl Extend<Atom> for AtomStorage
Source§fn extend<I: IntoIterator<Item = Atom>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = Atom>>(&mut self, iter: I)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl FromIterator<Atom> for AtomStorage
impl FromIterator<Atom> for AtomStorage
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.