From 3c643aeb04ed44c60537a0cf4817c510becee0ad Mon Sep 17 00:00:00 2001 From: csbrasnett Date: Mon, 23 Oct 2023 11:37:20 +0200 Subject: [PATCH] made requested changes --- vermouth/processors/annotate_mut_mod.py | 7 +++---- vermouth/tests/test_annotate_mut_mod.py | 6 ++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/vermouth/processors/annotate_mut_mod.py b/vermouth/processors/annotate_mut_mod.py index 5ee17d73b..52bdee045 100644 --- a/vermouth/processors/annotate_mut_mod.py +++ b/vermouth/processors/annotate_mut_mod.py @@ -226,10 +226,9 @@ def annotate_modifications(molecule, modifications, mutations): for node_idx in res['graph']: molecule.nodes[node_idx][key] = molecule.nodes[node_idx].get(key, []) + [mod] if mod_found == False: - LOGGER.warning('{} with resid {} not found. ' - 'No modification made.' - ''.format(resspec['resname'], resspec['resid'])) - + LOGGER.warning('Mutation "{}" not found. ' + 'Check target resid!' + ''.format(_format_resname(resspec))) class AnnotateMutMod(Processor): """ diff --git a/vermouth/tests/test_annotate_mut_mod.py b/vermouth/tests/test_annotate_mut_mod.py index 0899eb0bd..e0f4b3580 100644 --- a/vermouth/tests/test_annotate_mut_mod.py +++ b/vermouth/tests/test_annotate_mut_mod.py @@ -17,8 +17,6 @@ import networkx as nx import pytest -from contextlib import nullcontext as does_not_raise -import logging from vermouth.molecule import Molecule from vermouth.forcefield import ForceField from vermouth.processors.annotate_mut_mod import ( @@ -291,8 +289,8 @@ def test_nter_cter_modifications(node_data, edge_data, expected): mol = Molecule(force_field=ForceField(FF_UNIVERSAL_TEST)) mol.add_nodes_from(enumerate(node_data)) mol.add_edges_from(edge_data) - modification = [({'resname': 'cter', 'resid': 3}, 'C-ter'), - ({'resname': 'nter', 'resid': 1}, 'N-ter')] + modification = [({'resname': 'cter'}, 'C-ter'), + ({'resname': 'nter'}, 'N-ter')] annotate_modifications(mol, modification, [])