class Chem::Templates::Residue

Defined in:

chem/templates/residue.cr

Constructors

Instance Method Summary

Constructor Detail

def self.build(&) : self #

[View source]
def self.build(residue : Chem::Residue, description : String | Nil = nil, link_bond : Bond | Nil = nil, symmetric_atom_groups : Array(Array(Tuple(String, String))) | Nil = nil) : self #

Creates a new residue template from an existing residue.

Every atom and bond is converted to a template, which are then passed down to the constructor along with the optional arguments. Information such as name, code, etc. is obtained from the residue.

If link_bond is nil, it will be obtained from the associated residue template if exists. Otherwise, it will be guessed from the connectivity. If the residue is connected to two other residues by equivalent bonds, one of them will be chosen. The sense of the link bond will be infered from the residue numbering.

Raises Error if there is missing connectivity (no bonds).


[View source]
def self.new(names : Array(String), code : Char | Nil, type : ResidueType, description : String | Nil, atoms : Array(Atom), bonds : Array(Bond), root root_name : String, link_bond : Bond | Nil = nil, symmetric_atom_groups : Array(Array(Tuple(String, String))) | Nil = nil) #

[View source]

Instance Method Detail

def [](atom_t : Atom, other : Atom) : Bond #

Returns the bond template between the given atoms. Raises KeyError if the bond does not exist.


[View source]
def [](name : String, other : String) : Bond #

Returns the bond template between the given atoms. Raises KeyError if the bond does not exist.


[View source]
def [](name : String) : Atom #

[View source]
def []?(atom_t : Atom, other : Atom) : Bond | Nil #

Returns the bond template between the given atoms if exists, else nil.


[View source]
def []?(name : String, other : String) : Bond | Nil #

Returns the bond template between the given atoms if exists, else nil.


[View source]
def []?(name : String) : Atom | Nil #

[View source]
def atoms : Array::View(Atom) #

[View source]
def bonds : Array::View(Bond) #

[View source]
def code : Char | Nil #

[View source]
def description : String | Nil #

[View source]
def formal_charge : Int32 #

[View source]
def link_bond : Bond | Nil #

[View source]
def name : String #

Returns the designated residue name.


[View source]
def names : Array(String) #

[View source]
def polymer? : Bool #

[View source]
def root : Atom #

[View source]
def symmetric_atom_groups : Array(Array(Tuple(String, String))) | Nil #

[View source]
def to_s(io : IO) : Nil #
Description copied from class Reference

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>

[View source]
def type : ResidueType #

[View source]