module Bio::PDB::HeterogenFinder
methods to access heterogens (compounds or ligands)
XXX#each_chain must be defined.
Bio::PDB::HeterogenFinder
is included by Bio::PDB::PDB, Bio::PDB::Model
, and Bio::PDB::Chain
.
Public Instance Methods
each_heterogen() { |heterogen| ... }
click to toggle source
iterates over each heterogens
# File lib/bio/db/pdb/utils.rb 388 def each_heterogen(&x) #:yields: heterogen 389 self.each_chain { |chain| chain.each_heterogen(&x) } 390 end
find_heterogen() { |heterogen| ... }
click to toggle source
returns an array containing all heterogens for which given block is not false
(similar to Enumerable#find_all).
# File lib/bio/db/pdb/utils.rb 379 def find_heterogen 380 array = [] 381 self.each_heterogen do |heterogen| 382 array.push(heterogen) if yield(heterogen) 383 end 384 return array 385 end
heterogens()
click to toggle source
returns all heterogens
# File lib/bio/db/pdb/utils.rb 393 def heterogens 394 array = [] 395 self.each_chain { |chain| array.concat(chain.heterogens) } 396 return array 397 end