marrink-lab / vermouth-martinize

Describe and apply transformation on molecular structures and topologies
Apache License 2.0
89 stars 40 forks source link

Fix 408 #413

Closed fgrunewald closed 2 years ago

fgrunewald commented 2 years ago

keep track of max-node instead of searching it each time merge_molecule is called. This should fix issue #408 and as far as I can tell not break anything else. The only difference with the current implementation would be that if nodes are removed the max count is not reset, which is OK. Still all ids are unique.

Interesting point of order here: If in the current branch a node is removed in the middle of the molecule graph and not at the end it will probably break, because the same resid is assigned twice. This does not happen with this fix.