Skip to main content

AtomData

Struct AtomData 

Source
pub struct AtomData {
    pub atomic_num: u8,
    pub formal_charge: i8,
    pub isotope: u16,
    pub num_explicit_hs: u8,
    pub num_implicit_hs: u8,
    pub num_radical_electrons: u8,
    pub atom_map: u16,
    pub chiral_tag: ChiralTag,
    pub stereo_perm: u8,
    pub hybridization: Hybridization,
    pub flags: AtomFlags,
}
Expand description

单个原子的可变数据。

字段与 MolBatch 的列一一对应 —— 增加字段时两处必须同步。

Fields§

§atomic_num: u8

原子序数。0 表示 SMILES 通配原子 *

§formal_charge: i8

形式电荷

§isotope: u16

同位素质量数。0 表示未指定(即天然丰度)。

§num_explicit_hs: u8

方括号中显式书写的氢数。仅当 AtomFlags::NO_IMPLICIT 置位时有意义。

§num_implicit_hs: u8

隐式氢数。由 L2 的价键计算填充,解析阶段恒为 0。

§num_radical_electrons: u8

自由基电子数。由 L2 第 6 步 FINDRADICALS 填充,在那之前恒为 0。

隐式氢推断会读它,所以两者的先后顺序有实际后果 —— 净化管线里第 6 步排在第 3 步之后,故第 3 步看到的必然是 0。

§atom_map: u16

反应原子映射号(SMILES 中的 :n)。0 表示无映射。

§chiral_tag: ChiralTag

立体标记的几何类别

§stereo_perm: u8

立体标记的类内排列序号,与 chiral_tag 配套。

0 表示未指定。四面体的两种排列由 chiral_tag 自身表达,此处恒为 0 —— 两处都记就有了两个可以互相矛盾的真相来源。

§这是书写时的字面值,尚未归一到存储序

@TB15 存 15。序号的含义依赖“配体按什么顺序排列“,而解析会重排邻居 (环闭合键统一追加到末尾),方括号里的氢也占一个配体位 —— 两件事都会 让同一个几何构型对应到不同的序号。

把序号换算到存储序的参照系需要一张查找表:序号枚举的是配体在多面体 位置上的排法(模掉该多面体的转动群),邻居每做一次对换,序号就按表 跳到另一个值。这张表尚未实现,所以本字段只是原样保管书写值, 不声称它相对任何其它顺序成立;写出时这类标记直接丢弃。

不做的理由是实测的:8839 条真实语料里含配位几何的分子 0 条。 (同属立体化学的双键顺反已经做了,见 BondData::stereo。)

也因此,拿这个字段与任何“已归一“的表示逐值比对都没有意义 —— 两者只在 “没有重排且配体齐全“时才碰巧相等。

§hybridization: Hybridization

杂化状态。由净化第 9 步填充,在那之前为 Unspecified

§flags: AtomFlags

标志位

Implementations§

Source§

impl AtomData

Source

pub fn new(atomic_num: u8) -> Self

构造一个只指定了元素的原子,其余字段取默认值。

Trait Implementations§

Source§

impl Clone for AtomData

Source§

fn clone(&self) -> AtomData

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 Copy for AtomData

Source§

impl Debug for AtomData

Source§

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

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

impl Default for AtomData

Source§

fn default() -> Self

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

impl Eq for AtomData

Source§

impl PartialEq for AtomData

Source§

fn eq(&self, other: &AtomData) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AtomData

Auto Trait Implementations§

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