nomodeco_classes
- class nomodeco_classes.Molecule(iterable=(), /)
Nomodeco molecule class
Attributes:
a list of of atoms
- class Atom(symbol, coordinates)
The atom class in nomodeco
Attributes:
- symbol:
Enumerated atomic symbol of the molecule
- coordinates:
3D coordinates of a atom in a tuple
- is_donor() bool
Checks if a given atom is a donor molecule
- Attributes:
self: a object of the Atom class
- Returns:
True if a atom is a donor atom
- is_hydrogen() bool
Checks if a given atom is a hydrogen atom
- Attributes:
self: a object of the Atom class
- Returns:
True if the atom is hydrogen
- swap_deuterium() self
Swaps a given hydrogen atom with a deuterium atom
- Attributes:
self: a object of the Atom class
- Returns:
a object of the atom class with H swapped to D
- actual_length(symbol1, symbol2) float
Calculates the actual bond length between two atoms
- Attributes:
- self:
a object of the Molecule Class
- symbol1: str
a string of the first atom in question
- symbol2: str
a string of the second atom in question
- Returns:
a floating point number with the actual bond length
- append(value)
Appends a given atom to the Molecule Class
- Attributes:
self: a object of the Molecule Class value: a object of the Atom Class
- bond_angle(symbol1, symbol2, symbol3) float
Calculates the bond angle between three atoms in the Molecule object
- Attributes:
- self:
a object of the Molecule class
- symbol1: str
a string of the atom
- symbol2: str
a string of the atom
- symbol3: str
a string of the atom
- Returns:
The angle between the three atoms (ABC) in radiant
- bond_dict(bonds) dict
Created a dictionary where for each atom the corresponding “bonded” atoms are stored
- Attributes:
- self:
a object of the Molecule class
- bonds:
a list of tuples containing the bonds which are used for the dict creation
- Returns:
A dictionary containing the bonded atom for each atom e.q {H1: [O1,O2]}
- static count_connected_components(graph) int
Using the dfs algorithm counts the fully covalently connected components inside a molecule
- Attributes:
- graph:
a molecular graph created by Molecule.graph_rep()
- Returns:
a integer which represents the total count of connected components ranges from 1..N
- covalent_bonds(degofc_table) list
Searches for covalent bonds between two atoms. A covalent bond is found when the degree of covalence is greater than 0.75
- Attributes:
- self:
a object of the Molecule class
- degofc_table: dict
a dictionary containing the degrees of covalence
- Returns:
a list of possible bonds e.q [(O1,H2), …]
- degree_of_covalance() dict
Calculates the degree of covalance between all the combinations of two atoms
Reference https://doi.org/10.1002/qua.21049
- Returns:
a python dictionary with the two atoms as a tuple and the value of the degree of covalance
- detect_submolecules()
A graph theory oriented function to detect the covalent submolecules
- Attributes:
- self:
a object of the molecule class
- Returns:
connected_components: more information see networkx.connected_components submolecules: a dictionary containing the subgraphs of the molecule submolecule_symbols: a list of the atomic symbols of the submolecules
- static dfs(graph, start, visited)
A static method that applies dfs algorithm on a given graph
- Attributes:
- graph:
a molecular graph created by Molecule.graph_rep()
- start:
start node for the dfs algorithm
- visitied:
visited list for the dfs algorithm
- get_atom_coords_by_symbol(symbol)
Retries a atom by specifying a atomic symbol
- Attributes:
- self:
a object of the Molecule class
- symbol:
a atomic symbol as a string
- get_donor_atoms() list
Returns the class variable donor_atom of the Atom class
- graph_rep()
Generates the covalent bonds and using the covalent bonds a graph representation of a molecule
- Attributes:
- self:
a object of the Molecule class
- Returns:
a dictionary where the graph representation of the molecule is stored
- idof_general() int
Returns the degrees of freedom in the general case 3N-6
- idof_linear() int
Returns the degrees of freedom in the linear case 3N-5
- static is_connected(graph)
Uses the dfs method and a molecular graph to check if a graph is connected
- Attributes:
- graph:
a molecular graph created by Molecule.graph_rep()
- Returns:
True if the length of the visited list is equal in length of the total graph
- list_of_atom_symbols() list
Returns a list of just the symbols in the given Molecule
e.q [‘H1’,’O2’,’H2’]
- list_of_atom_symbols_xyz() list
Special function that is used for printing of B and D matrix
Returns a list of Symbols, xyz
- num_atoms() int
Returns the number of atoms given of the given Molecule
- theoretical_length(symbol1, symbol2) float
Returns the theoretical covalent bond length between two atoms
- Attributes:
- self:
a object of the Molecule Class
- symbol1: str
a string of the first atom in question
- symbol2: str
a string of the second atom in question
- Returns:
a floating point number with the covalent bond length
- theoretical_length_vdw(symbol1, symbol2) float
Returns the theoretical vdw length between two atoms
- Attributes:
- self:
a object of the Molecule Class
- symbol1: str
a string of the first atom in question
- symbol2: str
a string of the second atom in question
- Returns:
a floating point number with the vdw bond length