| 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 | 
 | 
|---|
| 18 | #include "Fragmentation/fragmentation_helpers.hpp"
 | 
|---|
| 19 | #include "Fragmentation/Graph.hpp"
 | 
|---|
| 20 | #include "Fragmentation/HydrogenSaturation_enum.hpp"
 | 
|---|
| 21 | #include "types.hpp"
 | 
|---|
| 22 | 
 | 
|---|
| 23 | #include <map>
 | 
|---|
| 24 | #include <string>
 | 
|---|
| 25 | #include <vector>
 | 
|---|
| 26 | 
 | 
|---|
| 27 | class atom;
 | 
|---|
| 28 | class AtomMask_t;
 | 
|---|
| 29 | class CheckAgainstAdjacencyFile;
 | 
|---|
| 30 | class KeySet;
 | 
|---|
| 31 | class molecule;
 | 
|---|
| 32 | 
 | 
|---|
| 33 | class Fragmentation
 | 
|---|
| 34 | {
 | 
|---|
| 35 | public:
 | 
|---|
| 36 |   Fragmentation(molecule *_mol, CheckAgainstAdjacencyFile &_FileChecker, const enum HydrogenSaturation _saturation);
 | 
|---|
| 37 |   ~Fragmentation();
 | 
|---|
| 38 | 
 | 
|---|
| 39 |   int FragmentMolecule(const std::vector<atomId_t> &atomids, int Order, std::string prefix, DepthFirstSearchAnalysis &DFS);
 | 
|---|
| 40 | 
 | 
|---|
| 41 |   const Graph& getGraph() const {
 | 
|---|
| 42 |     return TotalGraph;
 | 
|---|
| 43 |   }
 | 
|---|
| 44 | 
 | 
|---|
| 45 | private:
 | 
|---|
| 46 | 
 | 
|---|
| 47 |   void FragmentBOSSANOVA(molecule *mol, Graph &FragmentList, KeyStack &RootStack);
 | 
|---|
| 48 |   int GuesstimateFragmentCount(int order);
 | 
|---|
| 49 | 
 | 
|---|
| 50 |   // order at site
 | 
|---|
| 51 |   bool CheckOrderAtSite(AtomMask_t &AtomMask, const Graph &GlobalKeySetList, int Order, std::string path, bool LoopDoneAlready);
 | 
|---|
| 52 |   bool StoreOrderAtSiteFile(std::string &path);
 | 
|---|
| 53 |   bool ParseOrderAtSiteFromFile(const std::vector<atomId_t> &atomids, std::string &path);
 | 
|---|
| 54 | 
 | 
|---|
| 55 |   // storing fragments
 | 
|---|
| 56 |   void FillRootStackForSubgraphs(KeyStack &RootStack, const AtomMask_t &AtomMask);
 | 
|---|
| 57 |   bool AssignKeySetsToFragment(Graph &KeySetList, ListOfLocalAtoms_t &ListOfLocalAtoms, Graph &FragmentList, bool FreeList = false);
 | 
|---|
| 58 |   void TranslateIndicesToGlobalIDs(Graph &FragmentList, int &TotalNumberOfKeySets, Graph &TotalGraph);
 | 
|---|
| 59 | 
 | 
|---|
| 60 | private:
 | 
|---|
| 61 |   //!> pointer to molecule that is fragmented
 | 
|---|
| 62 |   molecule *mol;
 | 
|---|
| 63 |   //!> whether to saturate dangling bonds with hydrogen and hence treat hydrogen special
 | 
|---|
| 64 |   const enum HydrogenSaturation saturation;
 | 
|---|
| 65 |   //!> reference to an external adjacency for comparison
 | 
|---|
| 66 |   CheckAgainstAdjacencyFile &FileChecker;
 | 
|---|
| 67 |   //!> Resulting Graph with all keysets
 | 
|---|
| 68 |   Graph TotalGraph;
 | 
|---|
| 69 | };
 | 
|---|
| 70 | 
 | 
|---|
| 71 | 
 | 
|---|
| 72 | #endif /* FRAGMENTATION_HPP_ */
 | 
|---|