CGRtools.periodictable package
Contains classes of all elements used in containers: common for MoleculeContainer, Dynamic for CGRContainer, Query and DynamicQuery for QueryContainer and QueryCGRContainer respectively. Also available 3 special query atom types: AnyElement, DynamicAnyElement and ListElement
Below only carbon atom classes shown.
- class CGRtools.periodictable.C(isotope: Optional[int] = None)
Bases:
Element
,PeriodII
,GroupXIV
Element object with specified isotope
- Parameters
isotope – Isotope number of element
- __eq__(other)
compare attached to molecules elements
- __hash__()
Return hash(self).
- __int__()
Same as hash
- property atomic_mass: float
- property atomic_number
Element number
- property atomic_radius
Valence radius of atom
- property atomic_symbol: str
- property charge: int
Charge of atom
- copy() Core
Detached from graph copy of element
- property explicit_hydrogens: int
- classmethod from_atom(atom: Element) Element
get Element copy
- classmethod from_atomic_number(number: int) Type[Element]
get Element class by its number
- classmethod from_symbol(symbol: str) Type[Element]
get Element class by its symbol
- property heteroatoms: int
- property hybridization
1 - if atom has zero or only single bonded neighbors, 2 - if has only one double bonded neighbor and any amount of single bonded, 3 - if has one triple bonded and any amount of double and single bonded neighbors or two double bonded and any amount of single bonded neighbors, 4 - if atom in aromatic ring.
- property implicit_hydrogens: Optional[int]
- property in_ring: bool
Atom in any ring.
- property is_radical: bool
Radical state of atoms
- property isotope: Optional[int]
Isotope number
- property isotopes_distribution
Isotopes distribution in earth
- property isotopes_masses
Isotopes masses
- property neighbors: int
Neighbors count of atom
- property ring_sizes: Tuple[int, ...]
Atom rings sizes.
- property total_hydrogens: int
- valence_rules(charge: int, is_radical: bool, valence: int) List[Tuple[Set[Tuple[int, Element]], Dict[Tuple[int, Element], int], int]]
valence rules for element with specific charge/radical state
- property x: float
X coordinate of atom on 2D plane
- property xy: Tuple[float, float]
(X, Y) coordinates of atom on 2D plane
- property y: float
Y coordinate of atom on 2D plane
- class CGRtools.periodictable.DynamicC(isotope: Optional[int] = None)
Bases:
DynamicElement
,PeriodII
,GroupXIV
Element object with specified isotope
- Parameters
isotope – Isotope number of element
- __eq__(other)
compare attached to molecules dynamic elements
- __hash__()
Return hash(self).
- __int__()
Same as hash
- property atomic_mass: float
- property atomic_number
Element number
- property atomic_radius
Valence radius of atom
- property atomic_symbol: str
- property charge: int
Charge of atom
- copy() Core
Detached from graph copy of element
- classmethod from_atom(atom: Union[Element, DynamicElement]) DynamicElement
get DynamicElement object from Element object or copy of DynamicElement object
- classmethod from_atomic_number(number: int) Type[DynamicElement]
get DynamicElement class by its number
- classmethod from_symbol(symbol: str) Type[DynamicElement]
get DynamicElement class by its symbol
- property hybridization
1 - if atom has zero or only single bonded neighbors, 2 - if has only one double bonded neighbor and any amount of single bonded, 3 - if has one triple bonded and any amount of double and single bonded neighbors or two double bonded and any amount of single bonded neighbors, 4 - if atom in aromatic ring.
- property in_ring: bool
Atom in any ring.
- property is_radical: bool
Radical state of atoms
- property isotope: Optional[int]
Isotope number
- property isotopes_distribution
Isotopes distribution in earth
- property isotopes_masses
Isotopes masses
- property neighbors
Neighbors count of atom
- property p_charge: int
- property p_hybridization
Product state hybridization of atom
- property p_is_radical: bool
- property p_neighbors
- property ring_sizes: Tuple[int, ...]
Atom rings sizes.
- property x: float
X coordinate of atom on 2D plane
- property xy: Tuple[float, float]
(X, Y) coordinates of atom on 2D plane
- property y: float
Y coordinate of atom on 2D plane
- class CGRtools.periodictable.QueryC(isotope: Optional[int] = None)
Bases:
QueryElement
,PeriodII
,GroupXIV
Element object with specified isotope
- Parameters
isotope – Isotope number of element
- __eq__(other)
compare attached to molecules elements and query elements
- __hash__()
Return hash(self).
- __int__()
Same as hash
- property atomic_mass: float
- property atomic_number
Element number
- property atomic_radius
Valence radius of atom
- property atomic_symbol: str
- property charge: int
Charge of atom
- copy() Core
Detached from graph copy of element
- classmethod from_atom(atom: Union[Element, QueryElement, AnyElement]) Union[QueryElement, AnyElement]
get QueryElement or AnyElement object from Element object or copy of QueryElement or AnyElement
- classmethod from_atomic_number(number: int) Type[Union[QueryElement, AnyElement]]
get Element class by its number
- classmethod from_symbol(symbol: str) Type[Union[QueryElement, AnyElement]]
get Element class by its symbol
- property heteroatoms: Tuple[int, ...]
- property hybridization
1 - if atom has zero or only single bonded neighbors, 2 - if has only one double bonded neighbor and any amount of single bonded, 3 - if has one triple bonded and any amount of double and single bonded neighbors or two double bonded and any amount of single bonded neighbors, 4 - if atom in aromatic ring.
- property implicit_hydrogens: Tuple[int, ...]
- property in_ring: bool
Atom in any ring.
- property is_radical: bool
Radical state of atoms
- property isotope: Optional[int]
Isotope number
- property isotopes_distribution
Isotopes distribution in earth
- property isotopes_masses
Isotopes masses
- property neighbors: Tuple[int, ...]
Neighbors count of atom
- property ring_sizes: Tuple[int, ...]
Atom rings sizes.
- property x: float
X coordinate of atom on 2D plane
- property xy: Tuple[float, float]
(X, Y) coordinates of atom on 2D plane
- property y: float
Y coordinate of atom on 2D plane
- class CGRtools.periodictable.DynamicQueryC(isotope: Optional[int] = None)
Bases:
DynamicQueryElement
,PeriodII
,GroupXIV
Element object with specified isotope
- Parameters
isotope – Isotope number of element
- __eq__(other)
Return self==value.
- __hash__()
Return hash(self).
- __int__()
Same as hash
- property atomic_mass: float
- property atomic_number
Element number
- property atomic_radius
Valence radius of atom
- property atomic_symbol: str
- property charge: int
Charge of atom
- copy() Core
Detached from graph copy of element
- classmethod from_atom(atom: Union[Element, DynamicElement, DynamicQueryElement, DynamicAnyElement, QueryElement, AnyElement]) Union[DynamicQueryElement, DynamicAnyElement]
get DynamicQueryElement or DynamicAnyElement object from Element or DynamicElement or QueryElement object or copy of DynamicQueryElement or DynamicAnyElement
- classmethod from_atomic_number(number: int) Type[Union[DynamicQueryElement, DynamicAnyElement]]
get Element class by its number
- classmethod from_symbol(symbol: str) Type[Union[DynamicQueryElement, DynamicAnyElement]]
get Element class by its symbol
- property hybridization
1 - if atom has zero or only single bonded neighbors, 2 - if has only one double bonded neighbor and any amount of single bonded, 3 - if has one triple bonded and any amount of double and single bonded neighbors or two double bonded and any amount of single bonded neighbors, 4 - if atom in aromatic ring.
- property in_ring: bool
Atom in any ring.
- property is_radical: bool
Radical state of atoms
- property isotope: Optional[int]
Isotope number
- property isotopes_distribution
Isotopes distribution in earth
- property isotopes_masses
Isotopes masses
- property neighbors: Tuple[int, ...]
Number of neighbors of atom in reactant state.
- property p_charge: int
- property p_hybridization
Product state hybridization of atom
- property p_is_radical: bool
- property p_neighbors: Tuple[int, ...]
Number of neighbors of atom in product state.
- property ring_sizes: Tuple[int, ...]
Atom rings sizes.
- property x: float
X coordinate of atom on 2D plane
- property xy: Tuple[float, float]
(X, Y) coordinates of atom on 2D plane
- property y: float
Y coordinate of atom on 2D plane
- class CGRtools.periodictable.AnyElement(*args, **kwargs)
Bases:
Query
Element object with specified isotope
- Parameters
isotope – Isotope number of element
- __eq__(other)
Compare attached to molecules elements and query elements
- __hash__()
Return hash(self).
- __int__()
Same as hash
- property atomic_mass: float
- property atomic_number: int
Element number
- property atomic_radius
Valence radius of atom
- property atomic_symbol: str
- property charge: int
Charge of atom
- copy() Core
Detached from graph copy of element
- property heteroatoms: Tuple[int, ...]
- property hybridization
1 - if atom has zero or only single bonded neighbors, 2 - if has only one double bonded neighbor and any amount of single bonded, 3 - if has one triple bonded and any amount of double and single bonded neighbors or two double bonded and any amount of single bonded neighbors, 4 - if atom in aromatic ring.
- property implicit_hydrogens: Tuple[int, ...]
- property in_ring: bool
Atom in any ring.
- property is_radical: bool
Radical state of atoms
- property isotope: Optional[int]
Isotope number
- property isotopes_distribution: Dict[int, float]
Isotopes distribution in earth
- property isotopes_masses: Dict[int, float]
Isotopes masses
- property neighbors: Tuple[int, ...]
Neighbors count of atom
- property ring_sizes: Tuple[int, ...]
Atom rings sizes.
- property x: float
X coordinate of atom on 2D plane
- property xy: Tuple[float, float]
(X, Y) coordinates of atom on 2D plane
- property y: float
Y coordinate of atom on 2D plane
- class CGRtools.periodictable.DynamicAnyElement(*args, **kwargs)
Bases:
DynamicQuery
Element object with specified isotope
- Parameters
isotope – Isotope number of element
- __eq__(other)
Return self==value.
- __hash__()
Return hash(self).
- __int__()
Same as hash
- property atomic_mass: float
- property atomic_number: int
Element number
- property atomic_radius
Valence radius of atom
- property atomic_symbol: str
- property charge: int
Charge of atom
- copy() Core
Detached from graph copy of element
- property hybridization
1 - if atom has zero or only single bonded neighbors, 2 - if has only one double bonded neighbor and any amount of single bonded, 3 - if has one triple bonded and any amount of double and single bonded neighbors or two double bonded and any amount of single bonded neighbors, 4 - if atom in aromatic ring.
- property in_ring: bool
Atom in any ring.
- property is_radical: bool
Radical state of atoms
- property isotope: Optional[int]
Isotope number
- property isotopes_distribution: Dict[int, float]
Isotopes distribution in earth
- property isotopes_masses: Dict[int, float]
Isotopes masses
- property neighbors: Tuple[int, ...]
Number of neighbors of atom in reactant state.
- property p_charge: int
- property p_hybridization
Product state hybridization of atom
- property p_is_radical: bool
- property p_neighbors: Tuple[int, ...]
Number of neighbors of atom in product state.
- property ring_sizes: Tuple[int, ...]
Atom rings sizes.
- property x: float
X coordinate of atom on 2D plane
- property xy: Tuple[float, float]
(X, Y) coordinates of atom on 2D plane
- property y: float
Y coordinate of atom on 2D plane
- class CGRtools.periodictable.ListElement(elements: List[str], *args, **kwargs)
Bases:
AnyElement
Elements list
- __eq__(other)
Compare attached to molecules elements and query elements
- __hash__()
13bit = 4bit | 1bit | 4bit | 4bit
- __int__()
Same as hash
- property atomic_mass: float
- property atomic_number: int
Element number
- property atomic_radius
Valence radius of atom
- property atomic_symbol: str
- property charge: int
Charge of atom
- copy() ListElement
Detached from graph copy of element
- property heteroatoms: Tuple[int, ...]
- property hybridization
1 - if atom has zero or only single bonded neighbors, 2 - if has only one double bonded neighbor and any amount of single bonded, 3 - if has one triple bonded and any amount of double and single bonded neighbors or two double bonded and any amount of single bonded neighbors, 4 - if atom in aromatic ring.
- property implicit_hydrogens: Tuple[int, ...]
- property in_ring: bool
Atom in any ring.
- property is_radical: bool
Radical state of atoms
- property isotope: Optional[int]
Isotope number
- property isotopes_distribution: Dict[int, float]
Isotopes distribution in earth
- property isotopes_masses: Dict[int, float]
Isotopes masses
- property neighbors: Tuple[int, ...]
Neighbors count of atom
- property ring_sizes: Tuple[int, ...]
Atom rings sizes.
- property x: float
X coordinate of atom on 2D plane
- property xy: Tuple[float, float]
(X, Y) coordinates of atom on 2D plane
- property y: float
Y coordinate of atom on 2D plane