class Chem::Residue
- Chem::Residue
- Reference
- Object
Included Modules
- Comparable(Chem::Residue)
Defined in:
chem/core/residue.crchem/register_format.cr
Constructors
- .new(chain : Chain, number : Int32, insertion_code : Char | Nil, name : String)
- .new(chain : Chain, number : Int32, name : String) : self
Instance Method Summary
-
#<=>(other : self) : Int32
The comparison operator.
-
#==(rhs : self) : Bool
Returns
true
if this residue is the same as rhs, elsefalse
. -
#[](atom_t : Templates::Atom) : Atom
Returns the atom that matches atom_t.
-
#[](*args, **options)
TODO Remove this delegate.
-
#[](*args, **options, &)
TODO Remove this delegate.
-
#[]?(atom_t : Templates::Atom) : Atom | Nil
Returns the atom that matches atom_t.
-
#[]?(*args, **options)
TODO Remove this delegate.
-
#[]?(*args, **options, &)
TODO Remove this delegate.
- #atoms : AtomView
-
#bonded?(other : self, bond_t : Templates::Bond, strict : Bool = true) : Bool
Returns true if
self
is bonded to other through bond_t, otherwise false. -
#bonded?(other : self, lhs : Templates::Atom | String, rhs : Templates::Atom | String, order : BondOrder | Nil = nil) : Bool
Returns true if
self
is bonded to other through a bond between lhs and rhs, otherwise false. -
#bonded?(other : self, lhs : Templates::Atom | String, rhs : Element, order : BondOrder | Nil = nil) : Bool
Returns true if
self
is bonded to other through a bond between lhs and rhs, otherwise false. -
#bonded?(other : self, lhs : Element, rhs : Templates::Atom | String, order : BondOrder | Nil = nil) : Bool
Returns true if
self
is bonded to other through a bond between lhs and rhs, otherwise false. -
#bonded?(other : self, lhs : Element, rhs : Element, order : BondOrder | Nil = nil) : Bool
Returns true if
self
is bonded to other through a bond between lhs and rhs, otherwise false. -
#bonded?(other : self) : Bool
Returns true if
self
is bonded to other, otherwise false. -
#bonded_residues(bond_t : Templates::Bond, forward_only : Bool = true, strict : Bool = true) : Array(Residue)
Returns residues bonded through bond_t.
-
#bonded_residues : Array(Residue)
Returns bonded residues.
- #chain : Chain
- #chain=(new_chain : Chain) : Chain
- #cis? : Bool
- #clear : self
-
#code(default : Char = 'X') : Char
Returns a single-letter code associated with the residue's template.
- #delete(atom : Atom) : Atom | Nil
-
#dextro? : Bool
Returns
true
is residue is dextrorotatory, otherwisefalse
. - #dig(name : String) : Atom
- #dig?(name : String) : Atom | Nil
-
#dna? : Bool
Returns
true
if the residue is a DNA residue, elsefalse
. -
#each_bonded_residue(bond_t : Templates::Bond, forward_only : Bool = true, strict : Bool = true, & : Residue -> ) : Nil
Yields each residue bonded through bond_t.
-
#each_bonded_residue(& : Residue -> ) : Nil
Yields each bonded residue.
- #has_backbone? : Bool
-
#het? : Bool
Returns
true
if the residue is a non-standard (HET) residue, elsefalse
. - #hlxparams : Protein::HlxParams | Nil
-
#includes?(atom : Atom) : Bool
Returns
true
if the residue contains atom, elsefalse
. - #insertion_code : Char | Nil
- #insertion_code=(insertion_code : Char | Nil) : Char | Nil
-
#inspect(io : IO) : Nil
Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.
-
#ion? : Bool
Returns
true
if the residue is a ion residue, elsefalse
. -
#levo? : Bool
Returns
true
is residue is levorotatory, otherwisefalse
. -
#matches?(number : Int) : Bool
Returns
true
if the residue number equals the given number, elsefalse
. -
#matches?(str : String) : Bool
Returns
true
if the residue name equals the given name, elsefalse
. -
#matches?(code : Char) : Bool
Returns
true
if the residue code equals the given character, elsefalse
. -
#matches?(pattern : Regex) : Bool
Returns
true
if the residue name matches the given pattern, elsefalse
. -
#matches?(numbers : Range(Int, Int) | Range(Nil, Int) | Range(Int, Nil) | Range(Nil, Nil)) : Bool
Returns
true
if the residue number is included in the given range, elsefalse
. -
#matches?(numbers : Enumerable(Int)) : Bool
Returns
true
if the residue number is included in the given numbers, elsefalse
. -
#matches?(names : Enumerable(String)) : Bool
Returns
true
if the residue name is included in the given names, elsefalse
. -
#matches?(codes : Enumerable(Char)) : Bool
Returns
true
if the residue code is included in the given characters, elsefalse
. -
#membrane? : Bool
Returns
true
if the residue is a membrane residue, elsefalse
. - #name : String
- #name=(str : String) : String
- #number : Int32
- #number=(number : Int32) : Int32
- #omega : Float64
- #omega? : Float64 | Nil
-
#other? : Bool
Returns
true
if the residue is an unknown residue, elsefalse
. - #phi : Float64
- #phi? : Float64 | Nil
- #polymer? : Bool
-
#pred(strict : Bool = true, use_numbering : Bool = true) : Residue
Returns the preceding residue if exists, else raises
Error
. -
#pred?(strict : Bool = true, use_numbering : Bool = true) : Residue | Nil
Returns the preceding residue if exists, otherwise
nil
. -
#protein? : Bool
Returns
true
if the residue is a protein residue, elsefalse
. - #psi : Float64
- #psi? : Float64 | Nil
- #ramachandran_angles : Tuple(Float64, Float64)
- #sec : Protein::SecondaryStructure
- #sec=(sec : Protein::SecondaryStructure)
-
#solvent? : Bool
Returns
true
if the residue is a solvent residue, elsefalse
. -
#spec(io : IO) : Nil
Writes the residue specification to the given IO.
-
#spec : String
Returns the residue specification.
- #structure(*args, **options)
- #structure(*args, **options, &)
-
#succ(strict : Bool = true, use_numbering : Bool = true) : Residue
Returns the following residue if exists, else raises
Error
. -
#succ?(strict : Bool = true, use_numbering : Bool = true) : Residue | Nil
Returns the following residue if exists, otherwise
nil
. -
#template : Templates::Residue | Nil
Returns associated residue template if registered, otherwise nil.
-
#to_gen(fractional : Bool = false) : String
Returns a string representation of the residue using the
Chem::Gen
file format. -
#to_gen(output : IO | Path | String, fractional : Bool = false) : Nil
Writes the residue to output using the
Chem::Gen
file format. -
#to_mol(variant : Chem::Mol::Variant = :v2000) : String
Returns a string representation of the residue using the
Chem::Mol
file format. -
#to_mol(output : IO | Path | String, variant : Chem::Mol::Variant = :v2000) : Nil
Writes the residue to output using the
Chem::Mol
file format. -
#to_mol2(output : IO | Path | String) : Nil
Writes the residue to output using the
Chem::Mol2
file format. -
#to_mol2 : String
Returns a string representation of the residue using the
Chem::Mol2
file format. -
#to_pdb(bonds : Chem::PDB::Writer::BondOptions = Chem::PDB::Writer::BondOptions.flags(Het, Disulfide), renumber : Bool = true, ter_on_fragment : Bool = false) : String
Returns a string representation of the residue using the
Chem::PDB
file format. -
#to_pdb(output : IO | Path | String, bonds : Chem::PDB::Writer::BondOptions = Chem::PDB::Writer::BondOptions.flags(Het, Disulfide), renumber : Bool = true, ter_on_fragment : Bool = false) : Nil
Writes the residue to output using the
Chem::PDB
file format. -
#to_s(io : IO)
Appends a short String representation of this object which includes its class name and its object address.
-
#to_xyz(extended : Bool = false, fields : Array(String) = [] of String) : String
Returns a string representation of the residue using the
Chem::XYZ
file format. -
#to_xyz(output : IO | Path | String, extended : Bool = false, fields : Array(String) = [] of String) : Nil
Writes the residue to output using the
Chem::XYZ
file format. - #trans? : Bool
- #type : ResidueType
- #type=(type : ResidueType)
-
#water? : Bool
Returns
true
if the residue is a water residue, elsefalse
. -
#write(output : IO | Path | String, format : Chem::Format | String) : Nil
Writes the residue to output using format.
-
#write(path : Path | String) : Nil
Writes the residue to the specified file.
Constructor Detail
Instance Method Detail
The comparison operator.
Returns -1
, 0
or 1
depending on whether self
precedes
rhs, equals to rhs or comes after rhs. The comparison is
done based on chain id, residue number, and insertion code if
present.
residues = Structure.read "peptide.pdb"
residues[0] # => <Residue A:TRP1>
residues[1] # => <Residue A:GLY1A>
residues[2] # => <Residue A:SER1B>
residues[3] # => <Residue A:ASN1C>
residues[4] # => <Residue A:VAL2>
residues[5] # => <Residue B:THR1>
residues[6] # => <Residue B:ASN2>
residues[0] <=> residues[1] # => -1
residues[1] <=> residues[1] # => 0
residues[2] <=> residues[1] # => 1
residues[0] <=> residues[5] # => -1
residues[5] <=> residues[6] # => -1
Returns true
if this residue is the same as rhs, else false
.
NOTE overrides the equality operator included by Comparable
,
which uses the <=>
operator thus returning true for two
different residues that have the same chain id, number and
insertion code.
Returns the atom that matches atom_t.
Atom must match both atom template's name and element, otherwise
it raises IndexError
.
residue = Structure.read("peptide.pdb").residues[0]
residue[Templates::Atom("CA")] # => <Atom A:TRP1:CA(2)
residue[Templates::Atom("CA", element: "N")] # raises IndexError
residue[Templates::Atom("CX")] # raises IndexError
TODO Move to Templates or other namespace
Returns the atom that matches atom_t.
Atom must match both atom template's name and element, otherwise
it returns nil
.
residue = Structure.read("peptide.pdb").residues[0]
residue[Templates::Atom("CA")] # => <Atom A:TRP1:CA(2)
residue[Templates::Atom("CA", element: "N")] # => nil
residue[Templates::Atom("CX")] # => nil
TODO Move to Templates or other namespace
Returns true if self
is bonded to other through bond_t,
otherwise false.
# Covalent ligand (JG7) is bonded to CYS sidechain
residues = Structure.read("ala-cys-thr-jg7.pdb").residues
bond_t = Templates::Bond.new "C", "N"
residues[0].bonded?(residues[1], bond_t) # => true
residues[1].bonded?(residues[2], bond_t) # => true
residues[2].bonded?(residues[3], bond_t) # => false
residues[1].bonded?(residues[3], bond_t) # => false
Bond check follows the directionality of bond_t, that is, the
left and right atoms are looked up in self
and other,
respectively:
residues[0].bonded?(residues[1], bond_t) # => true
residues[1].bonded?(residues[0], bond_t) # => false
Note that bond order is taken into account, e.g.:
bond_t = Templates::Bond.new "C", "N", order: 2
residues[0].bonded?(residues[1], bond_t) # => false
If strict is false, it uses elements only instead to look for bonded atoms, and bond order is ignored.
bond_t = Templates::Bond.new "C", "NX", order: 2
residues[0].bonded?(residues[1], bond_t) # => false
residues[0].bonded?(residues[1], bond_t, strict: false) # => true
Returns true if self
is bonded to other through a bond between
lhs and rhs, otherwise false.
# Covalent ligand (JG7) is bonded to CYS sidechain
residues = Structure.read("ala-cys-thr-jg7.pdb").residues
One can use atom names, atom template, or elements:
a, b = Templates::Atom.new("C"), Templates::Atom.new("N")
residues[0].bonded? residues[1], "C", "N" # => true
residues[0].bonded? residues[1], a, b # => true
residues[0].bonded? residues[1], a, PeriodicTable::N # => true
residues[0].bonded? residues[1], PeriodicTable::C, b # => true
residues[1].bonded? residues[2], a, b # => true
residues[1].bonded? residues[3], a, b # => false
residues[2].bonded? residues[3], a, b # => false
Note that lhs and rhs are looked up in self
and other,
respectively, i.e., the arguments are not interchangeable:
residues[0].bonded? residues[1], "C", "N" # => true
residues[0].bonded? residues[1], "N", "C" # => false
When atom names or atom template are specified, this method returns false if missing:
missing_atom_t = Templates::Atom.new("OZ5")
residues[0].bonded? residues[1], "CX1", "N" # => false
residues[0].bonded? residues[1], missing_atom_t, "N" # => false
residues[0].bonded? residues[1], "C", PeriodicTable::Mg # => false
When elements are specified, all atoms of that element are tested:
residues[1].bonded? residues[2], "C", PeriodicTable::N # => true
residues[1].bonded? residues[2], "SG", PeriodicTable::C # => true
If order is specified, it also check for bond order, otherwise it is ignored:
residues[0].bonded? residues[1], "C", "N" # => true
residues[0].bonded? residues[1], "C", "N", 1 # => true
residues[0].bonded? residues[1], "C", "N", 2 # => false
Returns true if self
is bonded to other through a bond between
lhs and rhs, otherwise false.
# Covalent ligand (JG7) is bonded to CYS sidechain
residues = Structure.read("ala-cys-thr-jg7.pdb").residues
One can use atom names, atom template, or elements:
a, b = Templates::Atom.new("C"), Templates::Atom.new("N")
residues[0].bonded? residues[1], "C", "N" # => true
residues[0].bonded? residues[1], a, b # => true
residues[0].bonded? residues[1], a, PeriodicTable::N # => true
residues[0].bonded? residues[1], PeriodicTable::C, b # => true
residues[1].bonded? residues[2], a, b # => true
residues[1].bonded? residues[3], a, b # => false
residues[2].bonded? residues[3], a, b # => false
Note that lhs and rhs are looked up in self
and other,
respectively, i.e., the arguments are not interchangeable:
residues[0].bonded? residues[1], "C", "N" # => true
residues[0].bonded? residues[1], "N", "C" # => false
When atom names or atom template are specified, this method returns false if missing:
missing_atom_t = Templates::Atom.new("OZ5")
residues[0].bonded? residues[1], "CX1", "N" # => false
residues[0].bonded? residues[1], missing_atom_t, "N" # => false
residues[0].bonded? residues[1], "C", PeriodicTable::Mg # => false
When elements are specified, all atoms of that element are tested:
residues[1].bonded? residues[2], "C", PeriodicTable::N # => true
residues[1].bonded? residues[2], "SG", PeriodicTable::C # => true
If order is specified, it also check for bond order, otherwise it is ignored:
residues[0].bonded? residues[1], "C", "N" # => true
residues[0].bonded? residues[1], "C", "N", 1 # => true
residues[0].bonded? residues[1], "C", "N", 2 # => false
Returns true if self
is bonded to other through a bond between
lhs and rhs, otherwise false.
# Covalent ligand (JG7) is bonded to CYS sidechain
residues = Structure.read("ala-cys-thr-jg7.pdb").residues
One can use atom names, atom template, or elements:
a, b = Templates::Atom.new("C"), Templates::Atom.new("N")
residues[0].bonded? residues[1], "C", "N" # => true
residues[0].bonded? residues[1], a, b # => true
residues[0].bonded? residues[1], a, PeriodicTable::N # => true
residues[0].bonded? residues[1], PeriodicTable::C, b # => true
residues[1].bonded? residues[2], a, b # => true
residues[1].bonded? residues[3], a, b # => false
residues[2].bonded? residues[3], a, b # => false
Note that lhs and rhs are looked up in self
and other,
respectively, i.e., the arguments are not interchangeable:
residues[0].bonded? residues[1], "C", "N" # => true
residues[0].bonded? residues[1], "N", "C" # => false
When atom names or atom template are specified, this method returns false if missing:
missing_atom_t = Templates::Atom.new("OZ5")
residues[0].bonded? residues[1], "CX1", "N" # => false
residues[0].bonded? residues[1], missing_atom_t, "N" # => false
residues[0].bonded? residues[1], "C", PeriodicTable::Mg # => false
When elements are specified, all atoms of that element are tested:
residues[1].bonded? residues[2], "C", PeriodicTable::N # => true
residues[1].bonded? residues[2], "SG", PeriodicTable::C # => true
If order is specified, it also check for bond order, otherwise it is ignored:
residues[0].bonded? residues[1], "C", "N" # => true
residues[0].bonded? residues[1], "C", "N", 1 # => true
residues[0].bonded? residues[1], "C", "N", 2 # => false
Returns true if self
is bonded to other through a bond between
lhs and rhs, otherwise false.
# Covalent ligand (JG7) is bonded to CYS sidechain
residues = Structure.read("ala-cys-thr-jg7.pdb").residues
One can use atom names, atom template, or elements:
a, b = Templates::Atom.new("C"), Templates::Atom.new("N")
residues[0].bonded? residues[1], "C", "N" # => true
residues[0].bonded? residues[1], a, b # => true
residues[0].bonded? residues[1], a, PeriodicTable::N # => true
residues[0].bonded? residues[1], PeriodicTable::C, b # => true
residues[1].bonded? residues[2], a, b # => true
residues[1].bonded? residues[3], a, b # => false
residues[2].bonded? residues[3], a, b # => false
Note that lhs and rhs are looked up in self
and other,
respectively, i.e., the arguments are not interchangeable:
residues[0].bonded? residues[1], "C", "N" # => true
residues[0].bonded? residues[1], "N", "C" # => false
When atom names or atom template are specified, this method returns false if missing:
missing_atom_t = Templates::Atom.new("OZ5")
residues[0].bonded? residues[1], "CX1", "N" # => false
residues[0].bonded? residues[1], missing_atom_t, "N" # => false
residues[0].bonded? residues[1], "C", PeriodicTable::Mg # => false
When elements are specified, all atoms of that element are tested:
residues[1].bonded? residues[2], "C", PeriodicTable::N # => true
residues[1].bonded? residues[2], "SG", PeriodicTable::C # => true
If order is specified, it also check for bond order, otherwise it is ignored:
residues[0].bonded? residues[1], "C", "N" # => true
residues[0].bonded? residues[1], "C", "N", 1 # => true
residues[0].bonded? residues[1], "C", "N", 2 # => false
Returns true if self
is bonded to other, otherwise false.
Residues may be bonded by any two atoms.
# Covalent ligand (JG7) is bonded to CYS sidechain
residues = Structure.read("ala-cys-thr-jg7.pdb").residues
residues[0].bonded?(residues[1]) # => true
residues[1].bonded?(residues[2]) # => true
residues[2].bonded?(residues[3]) # => false
residues[1].bonded?(residues[3]) # => true
Returns residues bonded through bond_t. Residues are ordered by their chain id, residue number and insertion code if present (refer to #<=>).
# Covalent ligand (JG7) is bonded to CYS sidechain
residues = Structure.read("ala-cys-thr-jg7.pdb").residues
bond_t = Templates::Bond.new("C", "N")
residues[0].bonded_residues(bond_t).map(&.name) # => ["CYS"]
residues[1].bonded_residues(bond_t).map(&.name) # => ["THR"]
residues[2].bonded_residues(bond_t).map(&.name) # => []
residues[3].bonded_residues(bond_t).map(&.name) # => []
If forward_only is false
, then bond directionality is ignored:
residues[0].bonded_residues(bond_t, forward_only: false).map(&.name) # => ["CYS"]
residues[1].bonded_residues(bond_t, forward_only: false).map(&.name) # => ["ALA", "THR"]
residues[2].bonded_residues(bond_t, forward_only: false).map(&.name) # => ["CYS"]
residues[3].bonded_residues(bond_t, forward_only: false).map(&.name) # => []
If strict is false
, bond search checks elements only, and bond
order is ignored (fuzzy search). In the following example, using
strict: false
makes that any C-N bond is accepted regardless of
atom names or bond order:
bond_t = Templates::Bond.new "C", "NX", order: 2
residues[0].bonded_residues(bond_t, strict: false).map(&.name) # => ["CYS"]
residues[1].bonded_residues(bond_t, strict: false).map(&.name) # => ["THR"]
residues[2].bonded_residues(bond_t, strict: false).map(&.name) # => []
residues[3].bonded_residues(bond_t, strict: false).map(&.name) # => []
Returns bonded residues. Residues may be bonded through any atom. Residues are ordered by their chain id, residue number and insertion code if present (refer to #<=>).
# Covalent ligand (JG7) is bonded to CYS sidechain
residues = Structure.read("ala-cys-thr-jg7.pdb").residues
residues[0].bonded_residues.map(&.name) # => ["CYS"]
residues[1].bonded_residues.map(&.name) # => ["ALA", "THR", "JG7"]
residues[2].bonded_residues.map(&.name) # => ["CYS"]
residues[3].bonded_residues.map(&.name) # => ["CYS"]
Returns a single-letter code associated with the residue's template. If the residue has no associated template or it doesn't have a code, the method returns default.
Returns true
is residue is dextrorotatory, otherwise false
.
A residue is considered to be dextrorotatory if the improper angle C-CA-C-CB is negative.
Note that this method returns false
if the residue doesn't have
any of such atoms, therefore it's not always equal to the inverse
of #levo?
.
Yields each residue bonded through bond_t.
If forward_only is false
, then bond directionality is ignored.
If strict is false
, bond search checks elements only, and bond
order is ignored (fuzzy search).
See #bonded_residues(bond_t, forward_only, strict)
for examples.
Yields each bonded residue. Residues may be bonded through any atom.
See #bonded_residues
for examples.
Returns true
if the residue contains atom, else false
.
The check is done by name first, and then by atom equality.
Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
Returns true
is residue is levorotatory, otherwise false
.
A residue is considered to be levorotatory if the improper angle C-CA-C-CB is positive.
Note that this method returns false
if the residue doesn't have
any of such atoms, therefore it's not always equal to the inverse
of #dextro?
.
Returns true
if the residue number equals the given number, else
false
.
Returns true
if the residue name equals the given name, else
false
.
Returns true
if the residue code equals the given character, else
false
.
Returns true
if the residue name matches the given pattern, else
false
.
Returns true
if the residue number is included in the given range,
else false
.
Returns true
if the residue number is included in the given
numbers, else false
.
Returns true
if the residue name is included in the given
names, else false
.
Returns true
if the residue code is included in the given
characters, else false
.
Returns the preceding residue if exists, otherwise nil
.
It uses the link bond type of the associated residue template, if
present, to search for the previous residue. Thus, link bond
determines the direction, e.g., C(i-1)-N(i). Be aware that atom
types must match exactly to find a residue unless strict is
false
.
Otherwise, it returns a bonded residue whose number and insertion
code come just before those of self
. This fallback can be
disabled by setting use_numbering to false
.
Note that when multiple residues can be connected to the same residue (e.g., branched polymers), it returns the last residue among them.
Writes the residue specification to the given IO.
Residue specification is a short string representation encoding residue information including chain, name, number, and insertion code.
Returns the residue specification.
Residue specification is a short string representation encoding residue information including chain, name, number, and insertion code.
Returns the following residue if exists, otherwise nil
.
It uses the link bond type of the associated residue template, if
present, to search for the next residue. Thus, link bond
determines the direction, e.g., C(i)-N(i+1). Be aware that atom
types must match exactly to find a residue unless strict is
false
.
Otherwise, it returns a bonded residue whose number and insertion
code come just after those of self
. This fallback can be
disabled by setting use_numbering to false
.
Note that when multiple residues can be connected to the same residue (e.g., branched polymers), it returns the first residue among them.
Returns associated residue template if registered, otherwise nil.
The template is fetched by the residue name.
Returns a string representation of the residue using
the Chem::Gen
file format. Arguments are forwarded to
Chem::Gen::Writer.open
.
Writes the residue to output using the Chem::Gen
file format. Arguments are forwarded to Chem::Gen::Writer.open
.
Returns a string representation of the residue using
the Chem::Mol
file format. Arguments are forwarded to
Chem::Mol::Writer.open
.
Writes the residue to output using the Chem::Mol
file format. Arguments are forwarded to Chem::Mol::Writer.open
.
Writes the residue to output using the Chem::Mol2
file format. Arguments are forwarded to Chem::Mol2::Writer.open
.
Returns a string representation of the residue using
the Chem::Mol2
file format. Arguments are forwarded to
Chem::Mol2::Writer.open
.
Returns a string representation of the residue using
the Chem::PDB
file format. Arguments are forwarded to
Chem::PDB::Writer.open
.
Writes the residue to output using the Chem::PDB
file format. Arguments are forwarded to Chem::PDB::Writer.open
.
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>
Returns a string representation of the residue using
the Chem::XYZ
file format. Arguments are forwarded to
Chem::XYZ::Writer.open
.
Writes the residue to output using the Chem::XYZ
file format. Arguments are forwarded to Chem::XYZ::Writer.open
.
Returns true
if the residue is a water residue, else false
.
This is done by checking if the associated residue template (if
any) correspond to the water template.
Writes the residue to output using format. Raises
ArgumentError
if format has required arguments or cannot
write Chem::Residue
.
The supported file formats are Chem::Gen
, Chem::Mol2
, Chem::Mol
, Chem::PDB
, Chem::XYZ
. Use the
#to_*
methods to customize how the object is written in the
corresponding file format if possible.
Writes the residue to the specified file. The file
format is chosen based on the filename (see
Chem::Format#from_filename
). Raises ArgumentError
if the
file format cannot be determined.
The supported file formats are the following:
Chem::Gen
(.gen)Chem::Mol
(.mol)Chem::Mol2
(.mol2)Chem::PDB
(.ent, .pdb)Chem::XYZ
(.xyz)
Use the #to_*
methods to customize how the object is written
in the corresponding file format if possible.