marrink-lab / vermouth-martinize

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

modifications make edges in blocks #441

Open fgrunewald opened 2 years ago

fgrunewald commented 2 years ago

It appears modifications make edges in blocks. I think what happens is that the block + modification is merged and edges between the two are taken from the mapping, sort of in analog to what happens between two residues. This is a bit problematic because it introduces funny edges that you wouldn't expect.

pckroon commented 2 years ago

vermouth/processors/do_mapping.py:661 and vermouth/processors/do_mapping.py:605 and vermouth/processors/do_mapping.py:593 confirm this. Edges to and from modification should indeed not be added this way, since modifications should already be connected to their anchor beads. anyway. Could you comment out line 593, and try again?

fgrunewald commented 2 years ago

@pckroon I don't see why 593? It just goes into an infinite loop. Shouldn't we purge 661ff? Or are you looking at a code with changed line numbering?

pckroon commented 2 years ago

Ok, I was a bit too fast. 661 needs to stay, otherwise you don't get edges between residues. 593 needs to stay, but maybe a solution could be to indent 605 to under the else in 598. That way all_matches gets populated with only matches from blocks, and not from modifications. It'll probably come back to haunt us at some point, but we'll burn that bridge when we get there.