class Chem::Chain

Included Modules

Defined in:

chem/core/chain.cr

Constructors

Instance Method Summary

Instance methods inherited from module Chem::ResidueCollection

each_residue : Iterator(Residue)
each_residue(&block : Residue -> )
each_residue
, each_residue_fragment(& : ResidueView -> ) : Nil each_residue_fragment, each_secondary_structure(reuse : Bool | Array(Residue) = false, strict : Bool = true, handedness : Bool = true) : Iterator(ResidueView)
each_secondary_structure(reuse : Bool | Array(Residue) = false, strict : Bool = true, handedness : Bool = true, & : ResidueView, Protein::SecondaryStructure -> ) : Nil
each_secondary_structure
, link_bond : Templates::Bond | Nil link_bond, n_residues : Int32 n_residues, reset_secondary_structure : self reset_secondary_structure, residue_fragments : Array(ResidueView) residue_fragments, residues : ResidueView residues, sec=(seclist : Array(Protein::SecondaryStructure)) : Array(Protein::SecondaryStructure)
sec=(sec : Protein::SecondaryStructure) : Protein::SecondaryStructure
sec=
, secondary_structures(strict : Bool = true, handedness : Bool = true) : Array(ResidueView) secondary_structures

Instance methods inherited from module Chem::AtomCollection

atoms : AtomView atoms, bonds : Array(Bond) bonds, coords : Spatial::CoordinatesProxy coords, coords=(coords : Enumerable(Spatial::Vec3)) : Enumerable(Spatial::Vec3) coords=, each_atom : Iterator(Atom)
each_atom(&block : Atom -> )
each_atom
, each_fragment(& : AtomView -> ) : Nil each_fragment, formal_charge : Int32 formal_charge, formal_charges : Array(Int32) formal_charges, fragments : Array(AtomView) fragments, has_hydrogens? : Bool has_hydrogens?, n_atoms : Int32 n_atoms, to_gen(fractional : Bool = false) : String
to_gen(output : IO | Path | String, fractional : Bool = false) : Nil
to_gen
, to_mol2(output : IO | Path | String) : Nil
to_mol2 : String
to_mol2
, to_pdb(bonds : Chem::PDB::Writer::BondOptions = Chem::PDB::Writer::BondOptions.flags(Het, Disulfide), renumber : Bool = true, ter_on_fragment : Bool = false) : String
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
to_pdb
, to_xyz(extended : Bool = false, fields : Array(String) = [] of String) : String
to_xyz(output : IO | Path | String, extended : Bool = false, fields : Array(String) = [] of String) : Nil
to_xyz
, write(output : IO | Path | String, format : Chem::Format | String) : Nil
write(path : Path | String) : Nil
write

Constructor Detail

def self.new(top : Topology, id : Char) #

[View source]

Instance Method Detail

def <=>(rhs : self) : Int32 #

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 identifier.

chains = Structure.read("peptide.pdb").chains

chains[0] <=> chains[1] # => -1
chains[1] <=> chains[1] # => 0
chains[2] <=> chains[1] # => 1

[View source]
def [](number : Int32, insertion_code : Char | Nil = nil) : Residue #

[View source]
def []?(number : Int32, insertion_code : Char | Nil = nil) : Residue | Nil #

[View source]
def clear : self #

[View source]
def delete(residue : Residue) : Residue | Nil #

[View source]
def dig(number : Int32, insertion_code : Char | Nil) : Residue #

[View source]
def dig(number : Int32, insertion_code : Char | Nil, *subindexes) #

[View source]
def dig(number : Int32) : Residue #

[View source]
def dig(number : Int32, *subindexes) #

[View source]
def dig?(number : Int32, insertion_code : Char | Nil) : Residue | Nil #

[View source]
def dig?(number : Int32, insertion_code : Char | Nil, *subindexes) #

[View source]
def dig?(number : Int32) : Residue | Nil #

[View source]
def dig?(number : Int32, *subindexes) #

[View source]
def each_atom : Iterator(Atom) #

[View source]
def each_atom(&block : Atom -> ) #

[View source]
def each_residue : Iterator(Residue) #

[View source]
def each_residue(&block : Residue -> ) #

[View source]
def id : Char #

[View source]
def n_atoms : Int32 #

[View source]
def n_residues : Int32 #

[View source]
def polymer? : Bool #

[View source]
def renumber_residues_by(& : Residue -> _) : Nil #

Renumber residues based on the order by the output value of the block.


[View source]
def renumber_residues_by_connectivity : Nil #

Renumber residues based on bond information. Residue ordering is computed based on the link bond if available.


[View source]
def reset_cache : Nil #

[View source]
def spec(io : IO) : Nil #

Writes the chain specification to the given IO.

Chain specification is a short string representation encoding chain information including the id.


[View source]
def spec : String #

Returns the chain specification.

Chain specification is a short string representation encoding chain information including the id.


[View source]
def structure(*args, **options) #

[View source]
def structure(*args, **options, &) #

[View source]
def to_s(io : IO) #
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 top : Topology #

[View source]