| [246e13] | 1 | /*
 | 
|---|
 | 2 |  * Fragmentation.hpp
 | 
|---|
 | 3 |  *
 | 
|---|
 | 4 |  *  Created on: Oct 18, 2011
 | 
|---|
 | 5 |  *      Author: heber
 | 
|---|
 | 6 |  */
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 | #ifndef FRAGMENTATION_HPP_
 | 
|---|
 | 9 | #define FRAGMENTATION_HPP_
 | 
|---|
 | 10 | 
 | 
|---|
 | 11 | 
 | 
|---|
 | 12 | #ifdef HAVE_CONFIG_H
 | 
|---|
 | 13 | #include <config.h>
 | 
|---|
 | 14 | #endif
 | 
|---|
 | 15 | 
 | 
|---|
 | 16 | #include "Graph/DepthFirstSearchAnalysis.hpp"
 | 
|---|
 | 17 | 
 | 
|---|
| [ba94c5] | 18 | #include "Fragmentation/fragmentation_helpers.hpp"
 | 
|---|
| [ca8bea] | 19 | #include "Fragmentation/Graph.hpp"
 | 
|---|
 | 20 | #include "Fragmentation/HydrogenSaturation_enum.hpp"
 | 
|---|
| [d4d7a1] | 21 | #include "types.hpp"
 | 
|---|
| [dadc74] | 22 | 
 | 
|---|
| [d4d7a1] | 23 | #include <map>
 | 
|---|
| [99b0dc] | 24 | #include <string>
 | 
|---|
 | 25 | #include <vector>
 | 
|---|
 | 26 | 
 | 
|---|
| [246e13] | 27 | class atom;
 | 
|---|
| [f96874] | 28 | class AtomMask_t;
 | 
|---|
| [0fad93] | 29 | class AdjacencyList;
 | 
|---|
| [f0674a] | 30 | class KeySet;
 | 
|---|
| [246e13] | 31 | class molecule;
 | 
|---|
 | 32 | 
 | 
|---|
 | 33 | class Fragmentation
 | 
|---|
 | 34 | {
 | 
|---|
 | 35 | public:
 | 
|---|
| [0fad93] | 36 |   Fragmentation(molecule *_mol, AdjacencyList &_FileChecker, const enum HydrogenSaturation _saturation);
 | 
|---|
| [246e13] | 37 |   ~Fragmentation();
 | 
|---|
 | 38 | 
 | 
|---|
| [bfbd4a] | 39 |   int FragmentMolecule(const std::vector<atomId_t> &atomids, int Order, const std::string &prefix, DepthFirstSearchAnalysis &DFS, const Graph &ParsedFragmentList);
 | 
|---|
| [99b0dc] | 40 | 
 | 
|---|
| [ca8bea] | 41 |   const Graph& getGraph() const {
 | 
|---|
 | 42 |     return TotalGraph;
 | 
|---|
 | 43 |   }
 | 
|---|
| [246e13] | 44 | 
 | 
|---|
 | 45 | private:
 | 
|---|
 | 46 | 
 | 
|---|
| [339910] | 47 |   void FragmentBOSSANOVA(molecule *mol, Graph &FragmentList, KeyStack &RootStack);
 | 
|---|
| [246e13] | 48 |   int GuesstimateFragmentCount(int order);
 | 
|---|
 | 49 | 
 | 
|---|
 | 50 |   // order at site
 | 
|---|
| [e71325] | 51 |   bool CheckOrderAtSite(AtomMask_t &AtomMask, const Graph &GlobalKeySetList, int Order, const std::string &path, bool LoopDoneAlready);
 | 
|---|
 | 52 |   bool StoreOrderAtSiteFile(const std::string &path);
 | 
|---|
 | 53 |   bool ParseOrderAtSiteFromFile(const std::vector<atomId_t> &atomids, const std::string &path);
 | 
|---|
| [246e13] | 54 | 
 | 
|---|
 | 55 |   // storing fragments
 | 
|---|
| [339910] | 56 |   void FillRootStackForSubgraphs(KeyStack &RootStack, const AtomMask_t &AtomMask);
 | 
|---|
| [bfbd4a] | 57 |   bool AssignKeySetsToFragment(const Graph &KeySetList, ListOfLocalAtoms_t &ListOfLocalAtoms, Graph &FragmentList, bool FreeList = false);
 | 
|---|
| [339910] | 58 |   void TranslateIndicesToGlobalIDs(Graph &FragmentList, int &TotalNumberOfKeySets, Graph &TotalGraph);
 | 
|---|
| [246e13] | 59 | 
 | 
|---|
 | 60 | private:
 | 
|---|
| [99b0dc] | 61 |   //!> pointer to molecule that is fragmented
 | 
|---|
| [246e13] | 62 |   molecule *mol;
 | 
|---|
| [07a47e] | 63 |   //!> whether to saturate dangling bonds with hydrogen and hence treat hydrogen special
 | 
|---|
 | 64 |   const enum HydrogenSaturation saturation;
 | 
|---|
| [9511c7] | 65 |   //!> reference to an external adjacency for comparison
 | 
|---|
| [0fad93] | 66 |   AdjacencyList &FileChecker;
 | 
|---|
| [ca8bea] | 67 |   //!> Resulting Graph with all keysets
 | 
|---|
 | 68 |   Graph TotalGraph;
 | 
|---|
| [246e13] | 69 | };
 | 
|---|
 | 70 | 
 | 
|---|
 | 71 | 
 | 
|---|
 | 72 | #endif /* FRAGMENTATION_HPP_ */
 | 
|---|