class
Chem::Chain
- Chem::Chain
- Reference
- Object
Included Modules
- Comparable(Chem::Chain)
Defined in:
chem/core/chain.crConstructors
Class Method Summary
-
.succ_id(id : Char | Nil = nil) : Char
Returns the next alphanumeric chain identifier after id.
Instance Method Summary
-
#<=>(rhs : self) : Int32
The comparison operator.
- #[](number : Int32, insertion_code : Char | Nil = nil) : Residue
- #[]?(number : Int32, insertion_code : Char | Nil = nil) : Residue | Nil
- #atoms : AtomView
- #clear : self
- #delete(residue : Residue) : Residue | Nil
- #delete : Nil
- #dig(number : Int32, insertion_code : Char | Nil) : Residue
- #dig(number : Int32, insertion_code : Char | Nil, *subindexes)
- #dig(number : Int32) : Residue
- #dig(number : Int32, *subindexes)
- #dig?(number : Int32, insertion_code : Char | Nil) : Residue | Nil
- #dig?(number : Int32, insertion_code : Char | Nil, *subindexes)
- #dig?(number : Int32) : Residue | Nil
- #dig?(number : Int32, *subindexes)
- #id : Char
-
#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.
-
#matches?(id : Char) : Bool
Returns
trueif the chain id equals the given character, elsefalse. -
#matches?(ids : Enumerable(Char)) : Bool
Returns
trueif the chain id is included in the given characters, elsefalse. - #polymer? : Bool
-
#renumber_residues_by(& : Residue -> _) : Nil
Renumber residues based on the order by the output value of the block.
-
#renumber_residues_by_connectivity : Nil
Renumber residues based on bond information.
- #residues : ResidueView
-
#spec(io : IO) : Nil
Writes the chain specification to the given IO.
-
#spec : String
Returns the chain specification.
- #structure : Structure
-
#structure(*args, **options)
TODO remove this nonsensical line
-
#structure(*args, **options, &)
TODO remove this nonsensical line
-
#succ_id : Char
Returns the next alphanumeric chain identifier after this chain.
-
#to_s(io : IO)
Appends a short String representation of this object which includes its class name and its object address.
Constructor Detail
Class Method Detail
Returns the next alphanumeric chain identifier after id.
The sequence is A–Z, then a–z, then 0–9. Returns 'A'
if id is nil. Raises if there is no next identifier.
Chain.succ_id # => 'A'
Chain.succ_id('A') # => 'B'
Chain.succ_id('Z') # => 'a'
Chain.succ_id('z') # => '0'
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 identifier.
chains = Structure.read("peptide.pdb").chains
chains[0] <=> chains[1] # => -1
chains[1] <=> chains[1] # => 0
chains[2] <=> chains[1] # => 1
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 if the chain id equals the given character, else
false.
Returns true if the chain id is included in the given
characters, else false.
Renumber residues based on the order by the output value of the block.
Renumber residues based on bond information. Residue ordering is computed based on the link bond if available.
Writes the chain specification to the given IO.
Chain specification is a short string representation encoding chain information including the id.
Returns the chain specification.
Chain specification is a short string representation encoding chain information including the id.
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>