module Bio::PDB::ChainFinder

methods to access chains

XXX#each_model must be defined.

Bio::PDB::ChainFinder is included by Bio::PDB::PDB and Bio::PDB::Model.

Public Instance Methods

chains() click to toggle source

returns all chains

# File lib/bio/db/pdb/utils.rb, line 272
def chains
  array = []
  self.each_model { |model| array.concat(model.chains) }
  return array
each_chain() { |chain| ... } click to toggle source

iterates over each chain

# File lib/bio/db/pdb/utils.rb, line 267
def each_chain(&x) #:yields: chain
  self.each_model { |model| model.each(&x) }
find_chain() { |chain| ... } click to toggle source

returns an array containing all chains for which given block is not false (similar to Enumerable#find_all).

# File lib/bio/db/pdb/utils.rb, line 258
def find_chain
  array = []
  self.each_chain do |chain|
    array.push(chain) if yield(chain)
  return array