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 AdjacencyList;
|
---|
30 | class KeySet;
|
---|
31 | class molecule;
|
---|
32 |
|
---|
33 | class Fragmentation
|
---|
34 | {
|
---|
35 | public:
|
---|
36 | Fragmentation(
|
---|
37 | molecule *_mol,
|
---|
38 | AdjacencyList &_FileChecker,
|
---|
39 | const enum HydrogenTreatment _treatment);
|
---|
40 | ~Fragmentation();
|
---|
41 |
|
---|
42 | int FragmentMolecule(const std::vector<atomId_t> &atomids, int Order, const std::string &prefix, DepthFirstSearchAnalysis &DFS, const Graph &ParsedFragmentList);
|
---|
43 |
|
---|
44 | const Graph& getGraph() const {
|
---|
45 | return TotalGraph;
|
---|
46 | }
|
---|
47 |
|
---|
48 | private:
|
---|
49 |
|
---|
50 | void FragmentBOSSANOVA(molecule *mol, Graph &FragmentList, KeyStack &RootStack);
|
---|
51 | int GuesstimateFragmentCount(int order);
|
---|
52 |
|
---|
53 | // order at site
|
---|
54 | bool CheckOrderAtSite(AtomMask_t &AtomMask, const Graph &GlobalKeySetList, int Order, const std::string &path, bool LoopDoneAlready);
|
---|
55 | bool StoreOrderAtSiteFile(const std::string &path);
|
---|
56 | bool ParseOrderAtSiteFromFile(const std::vector<atomId_t> &atomids, const std::string &path);
|
---|
57 |
|
---|
58 | // storing fragments
|
---|
59 | void FillRootStackForSubgraphs(KeyStack &RootStack, const AtomMask_t &AtomMask);
|
---|
60 | bool AssignKeySetsToFragment(const Graph &KeySetList, ListOfLocalAtoms_t &ListOfLocalAtoms, Graph &FragmentList, bool FreeList = false);
|
---|
61 | void TranslateIndicesToGlobalIDs(Graph &FragmentList, int &TotalNumberOfKeySets, Graph &TotalGraph);
|
---|
62 |
|
---|
63 | private:
|
---|
64 | //!> pointer to molecule that is fragmented
|
---|
65 | molecule *mol;
|
---|
66 | //!> whether to treat hydrogen special
|
---|
67 | const enum HydrogenTreatment treatment;
|
---|
68 | //!> reference to an external adjacency for comparison
|
---|
69 | AdjacencyList &FileChecker;
|
---|
70 | //!> Resulting Graph with all keysets
|
---|
71 | Graph TotalGraph;
|
---|
72 | };
|
---|
73 |
|
---|
74 |
|
---|
75 | #endif /* FRAGMENTATION_HPP_ */
|
---|