Index: src/Actions/FragmentationAction/FragmentationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAction.cpp	(revision 30e5dc3f95657b0bcba4cb1708826c0f5f3ea557)
+++ src/Actions/FragmentationAction/FragmentationAction.cpp	(revision 0f59564b447c037fa07eca33fe43bb7420cbb6cc)
@@ -41,4 +41,5 @@
 #include "Descriptors/AtomSelectionDescriptor.hpp"
 #include "Descriptors/MoleculeIdDescriptor.hpp"
+#include "Fragmentation/AdaptivityMap.hpp"
 #include "Fragmentation/Exporters/ExportGraph_ToAtomFragments.hpp"
 #include "Fragmentation/Exporters/ExportGraph_ToFiles.hpp"
@@ -117,5 +118,7 @@
   boost::shared_ptr<AdjacencyList> FileChecker;
   boost::filesystem::path filename(params.prefix.get() + std::string(ADJACENCYFILE));
-  if (boost::filesystem::exists(filename) && boost::filesystem::is_regular_file(filename)) {
+  if ((params.ParseStateFiles.get())
+    && boost::filesystem::exists(filename)
+    && boost::filesystem::is_regular_file(filename)) {
     std::ifstream File;
     File.open(filename.string().c_str(), ios::out);
@@ -140,5 +143,35 @@
   // we parse in the keysets from last time if present
   Graph StoredGraph;
-  StoredGraph.ParseKeySetFile(params.prefix.get());
+  if (params.ParseStateFiles.get()) {
+    StoredGraph.ParseKeySetFile(params.prefix.get());
+    // check parsed graph against the set of atoms
+    {
+      AdaptivityMap *amap = StoredGraph.GraphToAdaptivityMap();
+      bool status = true;
+      for (World::AtomSelectionConstIterator iter = world.beginAtomSelection();
+          iter != world.endAtomSelection(); ++iter) {
+        const atomId_t atomid = iter->second->getId();
+        // skip hydrogens in check if saturation is turned on
+        if ((iter->second->getType()->getAtomicNumber() != 1)
+            || (!params.DoSaturation.get())) {
+          if (amap->count(atomid) == 0) {
+            ELOG(1, "Atom #" << atomid << " not contained in KeySet file. ");
+            status = false;
+            break;
+          }
+        } else if (amap->count(atomid) != 0) {
+          ELOG(1, "Atom #" << atomid << " in KeySet file is a hydrogen, but is now excluded. ");
+          status = false;
+          break;
+        }
+      }
+      delete amap;
+
+      if (!status) {
+        ELOG(1, "KeySetsFile seems to contain leftover from an old fragmentation, hence not using file.");
+        StoredGraph.clear();
+      }
+    }
+  }
 
   start = clock();
@@ -170,5 +203,5 @@
     {
       Graph StoredLocalGraph(StoredGraph.getLocalGraph(mol));
-      const int tempFlag = Fragmenter.FragmentMolecule(mols_atomids, params.order.get(), params.prefix.get(), StoredLocalGraph);
+      const int tempFlag = Fragmenter.FragmentMolecule(mols_atomids, params.order.get(), params.prefix.get(), StoredLocalGraph, params.ParseStateFiles.get());
       if ((ExitFlag == 2) && (tempFlag != 2))
         ExitFlag = tempFlag; // if there is one molecule that needs further fragmentation, it overrides others
Index: src/Actions/FragmentationAction/FragmentationAction.def
===================================================================
--- src/Actions/FragmentationAction/FragmentationAction.def	(revision 30e5dc3f95657b0bcba4cb1708826c0f5f3ea557)
+++ src/Actions/FragmentationAction/FragmentationAction.def	(revision 0f59564b447c037fa07eca33fe43bb7420cbb6cc)
@@ -21,9 +21,9 @@
 // ValueStorage by the token "Z" -> first column: int, Z, "Z"
 // "undefine" if no parameters are required, use (NOPARAM_DEFAULT) for each (undefined) default value
-#define paramtypes (std::string)(double)(int)(bool)(bool)(std::vector<std::string>)(unsigned int)(unsigned int)(bool)
-#define paramtokens ("fragment-molecule")("distance")("order")("DoSaturate")("ExcludeHydrogen")("output-types")("grid-level")("inter-order")("DoCyclesFull")
-#define paramdescriptions ("prefix of each fragment file")("distance in space up to which fragments are combined")("order of a discretization, dissection, ...")("do saturate dangling bonds with hydrogen")("whether to exclude hydrogen in the bond graph dissection or not")("type(s) of parsers that output fragment config files")("resolution of density sampling multigrid")("up to which order distinct fragments are combined")("always calculate (aromatic) rings fully, even beyond desired order")
-#define paramdefaults (PARAM_DEFAULT("BondFragment"))(PARAM_DEFAULT(3.))(PARAM_DEFAULT(3))(PARAM_DEFAULT(true))(PARAM_DEFAULT(true))(NOPARAM_DEFAULT)(PARAM_DEFAULT(5))(PARAM_DEFAULT(0))(PARAM_DEFAULT(false))
-#define paramreferences (prefix)(distance)(order)(DoSaturation)(HowtoTreatHydrogen)(types)(level)(InterOrder)(DoCyclesFull)
+#define paramtypes (std::string)(double)(int)(bool)(bool)(std::vector<std::string>)(unsigned int)(unsigned int)(bool)(bool)
+#define paramtokens ("fragment-molecule")("distance")("order")("DoSaturate")("ExcludeHydrogen")("output-types")("grid-level")("inter-order")("DoCyclesFull")("parse-state-files")
+#define paramdescriptions ("prefix of each fragment file")("distance in space up to which fragments are combined")("order of a discretization, dissection, ...")("do saturate dangling bonds with hydrogen")("whether to exclude hydrogen in the bond graph dissection or not")("type(s) of parsers that output fragment config files")("resolution of density sampling multigrid")("up to which order distinct fragments are combined")("always calculate (aromatic) rings fully, even beyond desired order")("whether to parse keysets, orderatsite, adjacency from state files")
+#define paramdefaults (PARAM_DEFAULT("BondFragment"))(PARAM_DEFAULT(3.))(PARAM_DEFAULT(3))(PARAM_DEFAULT(true))(PARAM_DEFAULT(true))(NOPARAM_DEFAULT)(PARAM_DEFAULT(5))(PARAM_DEFAULT(0))(PARAM_DEFAULT(false))(PARAM_DEFAULT(false))
+#define paramreferences (prefix)(distance)(order)(DoSaturation)(HowtoTreatHydrogen)(types)(level)(InterOrder)(DoCyclesFull)(ParseStateFiles)
 #define paramvalids \
 (DummyValidator< std::string >()) \
@@ -35,4 +35,5 @@
 (RangeValidator< unsigned int >(1, 10)) \
 (DummyValidator< unsigned int >()) \
+(DummyValidator< bool >()) \
 (DummyValidator< bool >())
 
