module Bio::PDB::ResidueFinder

methods to access residues

XXX#each_chain must be defined.

Bio::PDB::ResidueFinder is included by Bio::PDB::PDB, Bio::PDB::Model, and Bio::PDB::Chain.

Public Instance Methods

each_residue() { |residue| ... } click to toggle source

iterates over each residue

# File lib/bio/db/pdb/utils.rb, line 299
def each_residue(&x) #:yields: residue
  self.each_chain { |chain| chain.each(&x) }
end
find_residue() { |residue| ... } click to toggle source

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

# File lib/bio/db/pdb/utils.rb, line 290
def find_residue
  array = []
  self.each_residue do |residue|
    array.push(residue) if yield(residue)
  end
  return array
end
residues() click to toggle source

returns all residues

# File lib/bio/db/pdb/utils.rb, line 304
def residues
  array = []
  self.each_chain { |chain| array.concat(chain.residues) }
  return array
end