lib/PDB.rb
# active_set array of atoms that are in use
#
# :molecule => holds a hash, key is chain and value is Molecule class
#
active_set array of atoms that are in use
:molecule => holds a hash, key is chain and value is Molecule class
active_set array of atoms that are in use : molecule = > holds a hash key is chain and value is Molecule class
def select_from_active_set_false(array_of_atoms, selection_hash)
       attribute == :atom_type, :chain, etc
       keys must be attributes in Atom class
      temp=[]
      selection_hash.each_pair do |attribute, parameters|
         iterate over each molecule, concatenate for each time it is true
        raise ArgumentError.new("Property not found in Atom Class {attribute}") unless PDB::Atom.method_defined? attribute
           type_symbol = :CA, :CB, :CHAIN_IDENTIFIER
           value = true or false
          parameters.each_pair do |type_symbol, value|
            type = (type_symbol.is_a? Symbol) ? type_symbol.to_s.upcase : type_symbol.upcase
            if !value
              PDB::report_log("SELECTOR : REMOVING {attribute} => {type}")
              temp.concat( array_of_atoms.select{|atom| atom.send(attribute) != type} )
              temp.concat( array_of_atoms.delete_if{|atom| atom.send(attribute) == type} )
            end
          end
      end
    end
def select_from_active_set_false ( array_of_atoms , selection_hash ) temp = [ ] selection_hash . each_pair do | attribute , parameters | raise ArgumentError . new ( "Property not found in Atom Class #{attribute}" ) unless PDB :: Atom . method_defined? attribute parameters . each_pair do | type_symbol , value | type = ( type_symbol . is_a? Symbol ) ? type_symbol . to_s . upcase : type_symbol . upcase if ! value PDB :: report_log ( "SELECTOR : REMOVING #{attribute} => #{type}" ) temp . concat ( array_of_atoms . delete_if { | atom | atom . send ( attribute ) == type } ) end end end end
active_set array of atoms that are in use
:molecule => holds a hash, key is chain and value is Molecule class
active_set array of atoms that are in use : molecule = > holds a hash key is chain and value is Molecule class
# # attribute == :atom_type, :chain, etc # keys must be attributes in Atom class # # iterate over each molecule, concatenate for each time it is true # # type_symbol = :CA, :CB, :CHAIN_IDENTIFIER # value = true or false #temp.concat( array_of_atoms.select{|atom| atom.send(attribute) != type} )
array_of_atoms
<not_specific>
selection_hash
<not_specific>