module Bio::PDB::AtomFinder

methods to access atoms

XXX#each_residue must be defined.

Public Instance Methods

atoms() click to toggle source

returns all atoms

# File lib/bio/db/pdb/utils.rb, line 331
def atoms
  array = []
  self.each_residue { |residue| array.concat(residue.atoms) }
  return array
end
each_atom() { |atom| ... } click to toggle source

iterates over each atom

# File lib/bio/db/pdb/utils.rb, line 326
def each_atom(&x) #:yields: atom
  self.each_residue { |residue| residue.each(&x) }
end
find_atom() { |atom| ... } click to toggle source

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

# File lib/bio/db/pdb/utils.rb, line 317
def find_atom
  array = []
  self.each_atom do |atom|
    array.push(atom) if yield(atom)
  end
  return array
end