Class: Chem::MDL::MdlReaction

Inherits:
Object
  • Object
show all
Includes:
Chem::Molecule, Reaction, Enumerable
Defined in:
lib/chem/db/mdl.rb

Constant Summary

Constants included from Chem::Molecule

Chem::Molecule::DESCRIPTORNAME, Chem::Molecule::ELEMNUM, Chem::Molecule::EpsHeader, Chem::Molecule::MDLCountLineFormat, Chem::Molecule::MDLHeaderLine2Format

Instance Attribute Summary collapse

Attributes included from Chem::Molecule

#cdk2atom, #cdk_mol, #name, #ob_mol, #source

Attributes included from Graph

#adjacencies

Instance Method Summary collapse

Methods included from Chem::Molecule

#-, #adjacent_index, #assign_2d_geometry, #bit_mat, #box_size, #breadth_first_search, #canonical_ring, #cdk_BCUT, #cdk_CPSA, #cdk_RotatableBondsCount, #cdk_calc_descriptor, #cdk_calc_descriptors, #cdk_find_all_rings, #cdk_fingerprint, #cdk_gasteiger_marsili_partial_charges, #cdk_generate_2D, #cdk_generate_randomly, #cdk_generate_vicinity, #cdk_hose_code, #cdk_hueckel, #cdk_mcs, #cdk_properties, #cdk_rule_of_file, #cdk_save_as, #cdk_setup, #cdk_sssr, #cdk_wiener_numbers, #cdk_xlogp, #composition, #connected?, #deep_dup, #delete, #delete_bond, #depth_first_search, #divide, #f_dfs, #find_smallest_ring, #find_sssr, #fingerprint, #generate_pubchem_subskey, #hilight, #induced_sub, #match, #match_by_ullmann, #method_missing, #molecular_weight, #n_hydrogen, #ob_export_as, #ob_save_as, #oxidation_number, #pubchem_subskeys, #remove_hydrogens!, #save, #save_as_mdl, #save_as_pdf, #subset_in_composition?, #to_cansmi, #to_eps, #to_inchi, #to_sybyl, #typ_str, #use_open_babel

Methods included from Graph

#adjacent_to, #clustering_coefficient, #each, #morgan, #terminal_nodes

Constructor Details

#initializeMdlReaction

Returns a new instance of MdlReaction.



325
326
327
328
329
330
# File 'lib/chem/db/mdl.rb', line 325

def initialize
  @nodes = []
  @edges = []
  @reactants = []
  @products  = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Chem::Molecule

Instance Attribute Details

#edgesObject (readonly)

Returns the value of attribute edges.



323
324
325
# File 'lib/chem/db/mdl.rb', line 323

def edges
  @edges
end

#filenameObject (readonly)

Returns the value of attribute filename.



332
333
334
# File 'lib/chem/db/mdl.rb', line 332

def filename
  @filename
end

#nodesObject (readonly)

Returns the value of attribute nodes.



323
324
325
# File 'lib/chem/db/mdl.rb', line 323

def nodes
  @nodes
end

Instance Method Details

#open_rxn(filename) ⇒ Object



333
334
335
336
337
338
339
340
341
# File 'lib/chem/db/mdl.rb', line 333

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