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 272 def chains 273 array = [] 274 self.each_model { |model| array.concat(model.chains) } 275 return array 276 end
each_chain() { |chain| ... }
click to toggle source
iterates over each chain
# File lib/bio/db/pdb/utils.rb 267 def each_chain(&x) #:yields: chain 268 self.each_model { |model| model.each(&x) } 269 end
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 258 def find_chain 259 array = [] 260 self.each_chain do |chain| 261 array.push(chain) if yield(chain) 262 end 263 return array 264 end