package ChemicalReaction @ISA = qw() sub SetMode sub SetMode { my ($this,$m)= return $this->{Mode} = $m; sub GetMode return shift->{Mode}; sub SetDebugMode sub SetDebugMode { my ($this,$f)= return $this->{DebugMode} = $f; sub GetDebugMode return shift->{DebugMode}; sub GetpCSVDBs sub GetpCSVDBs { my ($this)= return $this->{pCVDDBs}; sub GetCSVDB sub GetCSVDB { my ($this, $index)= return $this->{pCVDDBs}->[$index]; sub GetAllDB sub GetAllDB { my ($this)= return $this->{pAllDB}; sub GetElementaryDB return shift->{pElementaryDB}; sub GetCompoundDB return shift->{pCompoundDB}; sub GetCompositionAllDB return shift->{pCompositionAllDB}; sub GetCompositionAtomDB return shift->{pCompositionAtomDB}; sub GetCompositionElementaryDB return shift->{pCompositionElementaryDB}; sub GetCompositionCompoundDB return shift->{pCompositionCompoundDB}; sub GetDB my ($this) = @_; return $this->GetAllDB(); return $this->GetCompositionCompoundDB(); return $this->GetCompoundDB(); sub GetAtomDB my ($this) = @_; return $this->{pAtomDB}; return $this->GetCompositionAtomDB(); return $this->{pAtomDB}; sub GetDBListHash my ($this) = @_; return %db; sub GetDBHash my ($this, $Compound, $pDB) = @_; return $pHash if($pHash and $pHash->{Status} eq ''); return undef; return $pDB->{$c} if($pDB->{$c} and $pDB->{$c}{Status} eq ''); return undef; sub GetEmol my ($this, $Compound, $pDB) = @_; return undef if(!defined $pDB); return $pDB->{Emol}; sub InitialReaction sub InitialReaction { my ($this)= return $this->{Initial} ; sub FinalReaction sub FinalReaction { my ($this)= return $this->{Final} ; sub Reagents sub Reagents { my ($this)= return $this->{Initial} ; sub Products sub Products { my ($this)= return $this->{Final} ; sub ReagentsHash sub ReagentsHash { my ($this)= return $this->{ReagentsHash} ; sub ProductsHash sub ProductsHash { my ($this)= return $this->{ProductsHash} ; sub pCompounds my ($this, $key) = @_; return $this->{ProductsHash}->{pCompounds}; return $this->{ReagentsHash}->{pCompounds}; sub nCompound my ($this, $key, $compound) = @_; return $pHash->{$compound}{n}; sub ElementsArray my ($this, $key) = @_; return $this->pElements($key); sub pElements my ($this, $key) = @_; return $this->{ProductsHash}->{pElements}; return $this->{ReagentsHash}->{pElements}; sub nElement my ($this, $key, $element) = @_; return $pHash->{$element}{nElement}; sub ListCompounds my ($this) = @_; sub ShowSpeculatedSpecies my ($this, $Compound) = @_; sub nElementByArray my ($this, $pCompounds, $pComposition, $IsPrint) = @_; return \%nFinalElement; sub SearchCSVDBHit my ($this, $RegExp) = @_; return @Hit; sub new my ($module, $pDBFiles, $BaseDBDir, $mode) = @_; return $this; sub DESTROY my ($this) = @_; $this->SUPER::DESTROY( sub Initialize my ($this, $InitializeDB) = @_; sub ClearHashes my ($this) = @_; sub MolecularWeight my ($this, $Compound) = @_; return $w; sub IsIncluded my ($this, $key, $pArray, $CaseSensitive) = @_; return Utils::IsIncludedInArray($key, $pArray, $CaseSensitive); sub PrintDBData my ($this, %hash) = @_; sub PrintElements my ($this, $key) = @_; sub PrintnElements my ($this, $key) = @_; sub ReadDBFiles my ($this, $pDBFiles, $BaseDBDir) = @_; return undef; return $this->{pCVDDBs}; sub ReadDBFile my ($this, $DBFile, $BaseDBDir, $IsPrint) = @_; return undef; return $csv; sub SplitReaction my ($this, $Reaction) = @_; return Utils::Split("=>?", $Reaction); sub BuildReactionFromArrays my ($this, $pCompounds, $pComposition, $format, $min, $Sort) = @_; return $a cmp $b; return $s; sub ReactionToHTML my ($this, $reaction) = @_; return $rh if(!defined $p); return "$rh=>$ph"; sub AReactionToHTML my ($this, $reaction) = @_; return $r; sub SortChemicalFormula my ($this, $formula) = @_; return $s; return join('', @a); sub NormalizeChemicalComposition my ($this, $pnAtom) = @_; return ($OriginalComposition, $Composition); sub ReactionToCompounds my ($this, $reaction) = @_; return (\@Chemicals, \@Compounds, \@n); sub CompoundToElements my ($this, $Compound, $Debug) = @_; return ([keys %nElement], [values %nElement]); return (\@Element, \@n); sub RemoveCompounds my ($this, $pSource, $pRemove) = @_; return sort keys %s; sub ExtractPossibleCompounds my ($this, $pElements, $pCompounds, $pCompoundDB) = @_; return @PC; sub AnalyzeAReaction my ($this, $key, $reaction) = @_; sub Analyze my ($this, $Reaction, $IsPrint) = @_; return (); sub CheckMassBalance my ($this, $IsPrint) = @_; return 0; return 0; return 1; sub MakePossibleComposition my ($this, $pReagentElements, $pCompounds, $pCompoundDB, $MaxNInReaction, $IsPrint) = @_; return $this->RepairComposition(\@Composition, $pReagentElements, $pCompounds, $pCompoundDB, $IsPrint); sub NormalizeComopositionByArray my ($this, $pCompounds, $pComposition, $format) = @_; return $s; sub RepairComposition my ($this, $pComposition, $pReagentElements, $pCompounds, $pCompoundDB, $IsPrint) = @_; return $pComposition; sub CalCohesiveEnergy my ($this, $Compound, $IsPrint, $ErrorStop, $Debug) = @_; return $Ecoh; return undef; sub CalTotalEnergyByArray my ($this, $pCompounds, $pComposition, $IsPrint) = @_; return $Etot; sub CalTotalEnergy my ($this, $Reaction, $IsPrint, $ErrorStop, $Debug) = @_; return $EReaction; sub CalFormationEnergy my ($this, $Reaction, $IsPrint, $ErrorStop) = @_; return $EForm;