marrink-lab / vermouth-martinize

Describe and apply transformation on molecular structures and topologies
Apache License 2.0
86 stars 38 forks source link

Fix/432 by making sure modifications are connected components #436

Closed pckroon closed 2 years ago

pckroon commented 2 years ago

canonicalize_modificaitons.identify_ptms assumes modifications are connected components. If this assumption is violated, in combination with the -modify flag, this causes hard to debug user facing errors (see #432 for more background).

This PR resolves that by 1) Log an error for any modification that is not a connected component. 2) Modify the maxwarn mechanism to count all messages >= warning, meaning an error will cause no files to be written. Note that the -maxwarn flag cannot override errors, only warnings.