Class: Chem::MDL::MdlReaction
- Inherits:
-
Object
- Object
- Chem::MDL::MdlReaction
- Includes:
- Chem::Molecule, Reaction, Enumerable
- Defined in:
- lib/chem/db/mdl.rb
Constant Summary
Constants included from Chem::Molecule
Chem::Molecule::EpsHeader, Chem::Molecule::MDLCountLineFormat
Instance Attribute Summary collapse
-
#edges ⇒ Object
readonly
Returns the value of attribute edges.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#nodes ⇒ Object
readonly
Returns the value of attribute nodes.
Attributes included from Chem::Molecule
Attributes included from Graph
Instance Method Summary collapse
-
#initialize ⇒ MdlReaction
constructor
A new instance of MdlReaction.
- #open_rxn(filename) ⇒ Object
Methods included from Reaction
Methods included from Chem::Molecule
#-, #assign_2d_geometry, #breadth_first_search, #canonical_ring, #composition, #connected?, #deep_dup, #delete, #delete_bond, #depth_first_search, #divide, #find_smallest_ring, #find_sssr, #induced_sub, #molecular_weight, #n_hydrogen, #oxidation_number, #save, #save_as_mdl, #save_as_pdf, #search_pubchem, #subset_in_composition?, #to_cansmi, #to_eps, #to_sybyl, #trim
Methods included from Graph
#adj_matrix, #adjacency_list, #adjacent_to, #clustering_coefficient, #connection, #each, #match_by_adj_mat, #match_by_ullmann, #match_exhaustively, #matchable, #matchable_old, #morgan
Constructor Details
#initialize ⇒ MdlReaction
Returns a new instance of MdlReaction.
289 290 291 292 293 294 |
# File 'lib/chem/db/mdl.rb', line 289 def initialize @nodes = [] @edges = [] @reactants = [] @products = [] end |
Instance Attribute Details
#edges ⇒ Object (readonly)
Returns the value of attribute edges.
287 288 289 |
# File 'lib/chem/db/mdl.rb', line 287 def edges @edges end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
296 297 298 |
# File 'lib/chem/db/mdl.rb', line 296 def filename @filename end |
#nodes ⇒ Object (readonly)
Returns the value of attribute nodes.
287 288 289 |
# File 'lib/chem/db/mdl.rb', line 287 def nodes @nodes end |
Instance Method Details
#open_rxn(filename) ⇒ Object
297 298 299 300 301 302 303 304 305 |
# File 'lib/chem/db/mdl.rb', line 297 def open_rxn(filename) @filename = filename input = File.open(filename) n_reactants, n_products = parse_header(input) read_mol(input, n_reactants, @reactants, @r_atoms = {}) read_mol(input, n_products, @products, @p_atoms = {}) construct self end |