class Chem::Templates::Builder

Overview

TODO add docs (include checks)

Defined in:

chem/templates/builder.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(spec_aliases : Hash(String, String) | Nil = nil) #

[View source]

Class Method Detail

def self.guess_root(atoms : Array(Atom), bonds : Array(Bond), link_bond : Bond | Nil) : String #

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.


[View source]

Instance Method Detail

def build : Residue #

[View source]
def code(char : Char) : self #

[View source]
def description(name : String) : self #

[View source]
def link_adjacent_by(bond_spec : String) : self #

[View source]
def name(*names : String) : self #

[View source]
def names(names : Enumerable(String)) : self #

[View source]
def names(*names : String) : self #

[View source]
def root(atom_name : String) : self #

[View source]
def spec(spec : String) : self #

[View source]
def symmetry(pairs : Enumerable(Tuple(String, String))) : self #

[View source]
def symmetry(*pairs : Tuple(String, String)) : self #

[View source]
def type(type : ResidueType) : self #

[View source]