class Chem::Templates::Residue
- Chem::Templates::Residue
- Reference
- Object
Defined in:
chem/templates/residue.crConstructors
- .build(&) : 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.
- .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)
Instance Method Summary
-
#[](atom_t : Atom, other : Atom) : Bond
Returns the bond template between the given atoms.
-
#[](name : String, other : String) : Bond
Returns the bond template between the given atoms.
- #[](name : String) : Atom
-
#[]?(atom_t : Atom, other : Atom) : Bond | Nil
Returns the bond template between the given atoms if exists, else
nil
. -
#[]?(name : String, other : String) : Bond | Nil
Returns the bond template between the given atoms if exists, else
nil
. - #[]?(name : String) : Atom | Nil
- #atoms : Array::View(Atom)
- #bonds : Array::View(Bond)
- #code : Char | Nil
- #description : String | Nil
- #formal_charge : Int32
- #link_bond : Bond | Nil
-
#name : String
Returns the designated residue name.
- #names : Array(String)
- #polymer? : Bool
- #root : Atom
- #symmetric_atom_groups : Array(Array(Tuple(String, String))) | Nil
-
#to_s(io : IO) : Nil
Appends a short String representation of this object which includes its class name and its object address.
- #type : ResidueType
Constructor Detail
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).
Instance Method Detail
Returns the bond template between the given atoms. Raises KeyError
if the bond does not exist.
Returns the bond template between the given atoms. Raises KeyError
if the bond does not exist.
Returns the bond template between the given atoms if exists, else
nil
.
Returns the bond template between the given atoms if exists, else
nil
.
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>