diff --git a/vermouth/processors/canonicalize_modifications.py b/vermouth/processors/canonicalize_modifications.py
index 2679131..33a9722 100644
--- a/vermouth/processors/canonicalize_modifications.py
+++ b/vermouth/processors/canonicalize_modifications.py
@@ -276,14 +276,18 @@ def fix_ptm(molecule):
         try:
             identified = identify_ptms(residue, res_ptms, options)
         except KeyError:
-            LOGGER.exception('Could not identify the modifications for'
-                             ' residues {}, involving atoms {}',
-                             ['{resname}{resid}'.format(**molecule.nodes[resid_to_idxs[resid][0]])
-                              for resid in sorted(set(resids))],
-                             ['{atomid}-{atomname}'.format(**molecule.nodes[idx])
-                              for idxs in res_ptms for idx in idxs[0]],
-                             type='unknown-input')
-            raise
+            LOGGER.warning('Could not identify the modifications for'
+                           ' residues {}, involving atoms {}',
+                           ['{resname}{resid}'.format(**molecule.nodes[resid_to_idxs[resid][0]])
+                            for resid in sorted(set(resids))],
+                           ['{atomid}-{atomname}'.format(**molecule.nodes[idx])
+                            for idxs in res_ptms for idx in idxs[0]],
+                           type='unknown-input')
+            for idxs in res_ptms:
+                for idx in idxs[0]:
+                    molecule.remove_node(idx)
+            continue
+
         # Why this mess? There can be multiple PTMs for a single (set of)
         # residue(s); and a single PTM can span multiple residues.
         LOGGER.info("Identified the modifications {} on residues {}",

diff --git a/vermouth/tests/test_repair_graph.py b/vermouth/tests/test_repair_graph.py
index e902d91..ece4438 100644
--- a/vermouth/tests/test_repair_graph.py
+++ b/vermouth/tests/test_repair_graph.py
@@ -19,7 +19,6 @@ Test graph reparation and related operations.
 import copy
 import logging
 
-import networkx as nx
 import pytest
 import vermouth
 from vermouth.molecule import Link
@@ -268,14 +267,15 @@ def test_renaming(renamed_graph):
 
 
 
-@pytest.mark.parametrize('resid,mutations,modifications,atomnames',[
+@pytest.mark.parametrize('resid,mutations,modifications,atomnames', [
     (1, ['ALA'], [], 'O C CA HA N HN CB HB1 HB2 HB3'),  # The glutamate chain and N-ter are removed
     (1, [], ['N-ter'], 'O C CA HA N H HN CB HB1 HB2 CG HG1 HG2 CD OE1 OE2'),  # HE1 got removed
     (2, ['ALA'], ['N-ter', 'C-ter'], 'O OXT C CA HA N H HN CB HB1 HB2 HB3'),
     (2, ['GLU'], [], 'O C CA HA N HN CB HB1 HB2 CG HG1 HG2 CD OE1 OE2'),  # Added glutamate sidechain
     (5, ['GLY'], ['none'], 'N CA C O HN HA1 HA2'),  # Remove O2 from C-ter mod
 ])
-def test_repair_graph_with_mutation_modification(system_mod, resid, mutations, modifications, atomnames):
+def test_repair_graph_with_mutation_modification(system_mod, resid, mutations,
+                                                 modifications, atomnames):
     mol = system_mod.molecules[0]
     # Let's mutate res1 to ALA
     for node_idx in mol:
@@ -296,11 +296,13 @@ def test_repair_graph_with_mutation_modification(system_mod, resid, mutations, m
     assert resid1_atomnames == set(atomnames.split())
 
 
-@pytest.mark.parametrize('resid,mutations,modifications',[
+@pytest.mark.parametrize('resid,mutations,modifications', [
     (2, [], ['GLU-H']),  # The glutamate chain and N-ter are removed
     (2, ['ALA', 'LEU'], [])
 ])
-def test_repair_graph_with_mutation_modification_error(system_mod, caplog, resid, mutations, modifications):
+def test_repair_graph_with_mutation_modification_error(system_mod, caplog,
+                                                       resid, mutations,
+                                                       modifications):
     mol = system_mod.molecules[0]
     # Let's mutate res1 to ALA
     for node_idx in mol:
@@ -313,3 +315,54 @@ def test_repair_graph_with_mutation_modification_error(system_mod, caplog, resid
         assert not caplog.records
         mol = vermouth.RepairGraph().run_molecule(mol)
         assert len(caplog.records) == 1
+
+
+@pytest.mark.parametrize('known_mod_names', [
+    [],
+    ['C-ter'],
+    ['C-ter', 'N-ter'],
+    ['GLU-H', 'N-ter'],
+])
+def test_unknown_mods_removed(caplog, repaired_graph, known_mod_names):
+    """
+    Tests that atoms that are part of modifications, but are not recognized, get
+    removed from the graph by CanonicalizeModifications
+    """
+    caplog.set_level(logging.WARNING)
+    ff = copy.copy(repaired_graph.force_field)
+    for mod_name in known_mod_names:
+        assert mod_name in ff.modifications  # Purely defensive
+
+    removed_mods = []
+    for name, mod in dict(ff.modifications).items():
+        if name not in known_mod_names:
+            del ff.modifications[name]
+            removed_mods.append(mod)
+
+    repaired_graph.force_field = ff
+    mol = repaired_graph.molecules[0]
+
+    assert not caplog.records
+    assert len(mol) == 46
+    vermouth.CanonicalizeModifications().run_system(repaired_graph)
+
+    assert caplog.records
+
+    for record in caplog.records:
+        assert record.levelname == 'WARNING'
+
+    assert len(mol) < 46
+    atomnames = dict(mol.nodes(data='atomname')).values()
+    for mod in removed_mods:
+        for node_key in mod.nodes:
+            node = mod.nodes[node_key]
+            if node['PTM_atom']:
+                assert node['atomname'] not in atomnames
+
+    for node_key in mol.nodes:
+        node = mol.nodes[node_key]
+        if node.get('PTM_atom'):
+            contained_by = [mod for mod in ff.modifications.values()
+                            if node.get('expected', node['atomname']) in
+                               dict(mod.nodes(data='atomname')).values()]
+            assert len(contained_by) == 1

Increase usability by removing unrecognized atoms
Currently, if a PTM is not recognized martinize turns into a mushroom. This is not great. Instead, all atoms that are not recognized should be removed and warning(s) issued. This should either be done by CanonicalizeModifications, or a separate processor. In the second case, CanonicalizeModifications should mark all unknown atoms.

Similarly, the error message when RepairGraph can't find a reference block for a specific residue name should be better (IIRC). It's probably undesirable to remove complete unrecognized residues though.
vermouth/tests/test_repair_graph.py::test_unknown_mods_removed[True-known_mod_names0] vermouth/tests/test_repair_graph.py::test_unknown_mods_removed[True-known_mod_names1] vermouth/tests/test_repair_graph.py::test_unknown_mods_removed[True-known_mod_names2] vermouth/tests/test_repair_graph.py::test_unknown_mods_removed[True-known_mod_names3] vermouth/tests/test_repair_graph.py::test_unknown_mods_removed[False-known_mod_names0] vermouth/tests/test_repair_graph.py::test_unknown_mods_removed[False-known_mod_names1] vermouth/tests/test_repair_graph.py::test_unknown_mods_removed[False-known_mod_names2] vermouth/tests/test_repair_graph.py::test_unknown_mods_removed[False-known_mod_names3]
vermouth/tests/test_repair_graph.py::test_PTM_atom_true[True-13] vermouth/tests/test_repair_graph.py::test_PTM_atom_true[True-14] vermouth/tests/test_repair_graph.py::test_PTM_atom_true[True-36] vermouth/tests/test_repair_graph.py::test_PTM_atom_true[False-13] vermouth/tests/test_repair_graph.py::test_PTM_atom_true[False-14] vermouth/tests/test_repair_graph.py::test_PTM_atom_true[False-36] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[True-0] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[True-1] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[True-2] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[True-3] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[True-4] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[True-5] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[True-6] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[True-7] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[True-8] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[True-9] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[True-10] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[True-11] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[True-12] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[True-15] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[False-0] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[False-1] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[False-2] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[False-3] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[False-4] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[False-5] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[False-6] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[False-7] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[False-8] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[False-9] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[False-10] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[False-11] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[False-12] vermouth/tests/test_repair_graph.py::test_PTM_atom_false[False-15] vermouth/tests/test_repair_graph.py::test_uniq_names_repaired[True] vermouth/tests/test_repair_graph.py::test_uniq_names_repaired[False] vermouth/tests/test_repair_graph.py::test_uniq_names_canonicalize[True] vermouth/tests/test_repair_graph.py::test_uniq_names_canonicalize[False] vermouth/tests/test_repair_graph.py::test_name_repaired[True-0-expected_names0] vermouth/tests/test_repair_graph.py::test_name_repaired[True-1-expected_names1] vermouth/tests/test_repair_graph.py::test_name_repaired[True-2-expected_names2] vermouth/tests/test_repair_graph.py::test_name_repaired[True-3-expected_names3] vermouth/tests/test_repair_graph.py::test_name_repaired[True-4-expected_names4] vermouth/tests/test_repair_graph.py::test_name_repaired[True-5-expected_names5] vermouth/tests/test_repair_graph.py::test_name_repaired[True-6-expected_names6] vermouth/tests/test_repair_graph.py::test_name_repaired[True-7-expected_names7] vermouth/tests/test_repair_graph.py::test_name_repaired[True-8-expected_names8] vermouth/tests/test_repair_graph.py::test_name_repaired[True-9-expected_names9] vermouth/tests/test_repair_graph.py::test_name_repaired[True-10-expected_names10] vermouth/tests/test_repair_graph.py::test_name_repaired[True-11-expected_names11] vermouth/tests/test_repair_graph.py::test_name_repaired[True-12-expected_names12] vermouth/tests/test_repair_graph.py::test_name_repaired[True-13-expected_names13] vermouth/tests/test_repair_graph.py::test_name_repaired[True-14-expected_names14] vermouth/tests/test_repair_graph.py::test_name_repaired[True-15-expected_names15] vermouth/tests/test_repair_graph.py::test_name_repaired[True-16-expected_names16] vermouth/tests/test_repair_graph.py::test_name_repaired[True-17-expected_names17] vermouth/tests/test_repair_graph.py::test_name_repaired[True-18-expected_names18] vermouth/tests/test_repair_graph.py::test_name_repaired[True-19-expected_names19] vermouth/tests/test_repair_graph.py::test_name_repaired[True-20-expected_names20] vermouth/tests/test_repair_graph.py::test_name_repaired[True-21-expected_names21] vermouth/tests/test_repair_graph.py::test_name_repaired[True-22-expected_names22] vermouth/tests/test_repair_graph.py::test_name_repaired[True-23-expected_names23] vermouth/tests/test_repair_graph.py::test_name_repaired[True-24-expected_names24] vermouth/tests/test_repair_graph.py::test_name_repaired[True-25-expected_names25] vermouth/tests/test_repair_graph.py::test_name_repaired[True-26-expected_names26] vermouth/tests/test_repair_graph.py::test_name_repaired[True-27-expected_names27] vermouth/tests/test_repair_graph.py::test_name_repaired[True-28-expected_names28] vermouth/tests/test_repair_graph.py::test_name_repaired[True-29-expected_names29] vermouth/tests/test_repair_graph.py::test_name_repaired[True-30-expected_names30] vermouth/tests/test_repair_graph.py::test_name_repaired[True-31-expected_names31] vermouth/tests/test_repair_graph.py::test_name_repaired[True-32-expected_names32] vermouth/tests/test_repair_graph.py::test_name_repaired[True-33-expected_names33] vermouth/tests/test_repair_graph.py::test_name_repaired[True-34-expected_names34] vermouth/tests/test_repair_graph.py::test_name_repaired[True-35-expected_names35] vermouth/tests/test_repair_graph.py::test_name_repaired[True-36-expected_names36] vermouth/tests/test_repair_graph.py::test_name_repaired[False-0-expected_names0] vermouth/tests/test_repair_graph.py::test_name_repaired[False-1-expected_names1] vermouth/tests/test_repair_graph.py::test_name_repaired[False-2-expected_names2] vermouth/tests/test_repair_graph.py::test_name_repaired[False-3-expected_names3] vermouth/tests/test_repair_graph.py::test_name_repaired[False-4-expected_names4] vermouth/tests/test_repair_graph.py::test_name_repaired[False-5-expected_names5] vermouth/tests/test_repair_graph.py::test_name_repaired[False-6-expected_names6] vermouth/tests/test_repair_graph.py::test_name_repaired[False-7-expected_names7] vermouth/tests/test_repair_graph.py::test_name_repaired[False-8-expected_names8] vermouth/tests/test_repair_graph.py::test_name_repaired[False-9-expected_names9] vermouth/tests/test_repair_graph.py::test_name_repaired[False-10-expected_names10] vermouth/tests/test_repair_graph.py::test_name_repaired[False-11-expected_names11] vermouth/tests/test_repair_graph.py::test_name_repaired[False-12-expected_names12] vermouth/tests/test_repair_graph.py::test_name_repaired[False-13-expected_names13] vermouth/tests/test_repair_graph.py::test_name_repaired[False-14-expected_names14] vermouth/tests/test_repair_graph.py::test_name_repaired[False-15-expected_names15] vermouth/tests/test_repair_graph.py::test_name_repaired[False-16-expected_names16] vermouth/tests/test_repair_graph.py::test_name_repaired[False-17-expected_names17] vermouth/tests/test_repair_graph.py::test_name_repaired[False-18-expected_names18] vermouth/tests/test_repair_graph.py::test_name_repaired[False-19-expected_names19] vermouth/tests/test_repair_graph.py::test_name_repaired[False-20-expected_names20] vermouth/tests/test_repair_graph.py::test_name_repaired[False-21-expected_names21] vermouth/tests/test_repair_graph.py::test_name_repaired[False-22-expected_names22] vermouth/tests/test_repair_graph.py::test_name_repaired[False-23-expected_names23] vermouth/tests/test_repair_graph.py::test_name_repaired[False-24-expected_names24] vermouth/tests/test_repair_graph.py::test_name_repaired[False-25-expected_names25] vermouth/tests/test_repair_graph.py::test_name_repaired[False-26-expected_names26] vermouth/tests/test_repair_graph.py::test_name_repaired[False-27-expected_names27] vermouth/tests/test_repair_graph.py::test_name_repaired[False-28-expected_names28] vermouth/tests/test_repair_graph.py::test_name_repaired[False-29-expected_names29] vermouth/tests/test_repair_graph.py::test_name_repaired[False-30-expected_names30] vermouth/tests/test_repair_graph.py::test_name_repaired[False-31-expected_names31] vermouth/tests/test_repair_graph.py::test_name_repaired[False-32-expected_names32] vermouth/tests/test_repair_graph.py::test_name_repaired[False-33-expected_names33] vermouth/tests/test_repair_graph.py::test_name_repaired[False-34-expected_names34] vermouth/tests/test_repair_graph.py::test_name_repaired[False-35-expected_names35] vermouth/tests/test_repair_graph.py::test_name_repaired[False-36-expected_names36] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-0-expected_names0] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-1-expected_names1] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-2-expected_names2] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-3-expected_names3] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-4-expected_names4] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-5-expected_names5] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-6-expected_names6] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-7-expected_names7] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-8-expected_names8] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-9-expected_names9] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-10-expected_names10] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-11-expected_names11] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-12-expected_names12] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-13-expected_names13] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-14-expected_names14] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-15-expected_names15] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-16-expected_names16] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-17-expected_names17] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-18-expected_names18] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-19-expected_names19] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-20-expected_names20] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-21-expected_names21] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-22-expected_names22] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-23-expected_names23] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-24-expected_names24] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-25-expected_names25] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-26-expected_names26] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-27-expected_names27] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-28-expected_names28] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-29-expected_names29] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-30-expected_names30] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-31-expected_names31] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-32-expected_names32] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-33-expected_names33] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-34-expected_names34] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-35-expected_names35] vermouth/tests/test_repair_graph.py::test_name_canonicalized[True-36-expected_names36] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-0-expected_names0] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-1-expected_names1] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-2-expected_names2] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-3-expected_names3] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-4-expected_names4] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-5-expected_names5] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-6-expected_names6] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-7-expected_names7] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-8-expected_names8] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-9-expected_names9] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-10-expected_names10] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-11-expected_names11] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-12-expected_names12] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-13-expected_names13] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-14-expected_names14] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-15-expected_names15] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-16-expected_names16] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-17-expected_names17] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-18-expected_names18] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-19-expected_names19] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-20-expected_names20] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-21-expected_names21] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-22-expected_names22] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-23-expected_names23] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-24-expected_names24] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-25-expected_names25] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-26-expected_names26] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-27-expected_names27] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-28-expected_names28] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-29-expected_names29] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-30-expected_names30] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-31-expected_names31] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-32-expected_names32] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-33-expected_names33] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-34-expected_names34] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-35-expected_names35] vermouth/tests/test_repair_graph.py::test_name_canonicalized[False-36-expected_names36] vermouth/tests/test_repair_graph.py::test_common_attributes[True-2-expected_attrs0] vermouth/tests/test_repair_graph.py::test_common_attributes[False-2-expected_attrs0] vermouth/tests/test_repair_graph.py::test_renaming[True] vermouth/tests/test_repair_graph.py::test_renaming[False] vermouth/tests/test_repair_graph.py::test_repair_graph_with_mutation_modification[1-mutations0-modifications0-O vermouth/tests/test_repair_graph.py::test_repair_graph_with_mutation_modification[1-mutations1-modifications1-O vermouth/tests/test_repair_graph.py::test_repair_graph_with_mutation_modification[2-mutations2-modifications2-O vermouth/tests/test_repair_graph.py::test_repair_graph_with_mutation_modification[2-mutations3-modifications3-O vermouth/tests/test_repair_graph.py::test_repair_graph_with_mutation_modification[5-mutations4-modifications4-N vermouth/tests/test_repair_graph.py::test_repair_graph_with_mutation_modification_error[2-mutations0-modifications0] vermouth/tests/test_repair_graph.py::test_repair_graph_with_mutation_modification_error[2-mutations1-modifications1]