class Chem::Templates::Builder
- Chem::Templates::Builder
- Reference
- Object
Overview
TODO add docs (include checks)
Defined in:
chem/templates/builder.crConstructors
Class Method Summary
-
.guess_root(atoms : Array(Atom), bonds : Array(Bond), link_bond : Bond | Nil) : String
Returns the atom with the highest bonding complexity.
Instance Method Summary
- #build : Residue
- #code(char : Char) : self
- #description(name : String) : self
- #link_adjacent_by(bond_spec : String) : self
- #name(*names : String) : self
- #names(names : Enumerable(String)) : self
- #names(*names : String) : self
- #root(atom_name : String) : self
- #spec(spec : String) : self
- #symmetry(pairs : Enumerable(Tuple(String, String))) : self
- #symmetry(*pairs : Tuple(String, String)) : self
- #type(type : ResidueType) : self
Constructor Detail
Class Method Detail
Returns the atom with the highest bonding complexity.
The bonding complexity of an atom depends on the nature of the atom, the bonds, and the bonds of its neighbors.
First, carbon atoms are the most frequent so they have the lowest complexity (0), followed by non-carbon atoms (+1), and then non-organic (not CHON) atoms (+2). Hydrogen atoms are ignored.
The complexity is further increased by the number of bonds with other heavy atoms, i.e., bonds X-H are ignored.
The total complexity of an atom is computed as the sum of its complexity and the complexities of the bonded atoms.