marrink-lab / vermouth-martinize

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

Comments #460

Open fgrunewald opened 1 year ago

fgrunewald commented 1 year ago

This PR implements comment reading and annotation for the itp-reader. It also makes apply_rubber_band label the rubber bands. This PR partially addresses #452 and related issues. With Martini3 it is not possible to distinguish the rubber-bonds from normal bonds via the type. Therefore it is safer to label them with a comment which can be picked up by the meta argument of the interactions. This enables to use the itp-reader to actually draw bonds in VMD and other packages.

pckroon commented 1 year ago

As an alternative, should LineParser.parse call the line methods with arguments line, lineno, comment instead of creating the current_comment attribute? Bit more invasive, but maybe it makes the resulting API cleaner?

fgrunewald commented 1 year ago

@pckroon that can be done! And then to solve the problem of Chris you could think of annotating the ss-sequence in the atom types section of the itp file as comment rather than trying to parse a header string like so:

[ moleculetype] protein 1 [ atoms ] 1 P2 ALA 1 ... ; ss_code

Citations I'm not in favour of parsing form the itp file

pckroon commented 1 year ago

Sounds like a reasonable idea. Also note that annotating beads is not exclusive with putting the SecStruct string in the header. The latter is useful when you want to invoke martinize again with the same secstruct. Assuming we want to annotate atoms with comments about the node in question, do we want to pick a sane format (json?) and just write them all?

Citations I'm not in favour of parsing form the itp file

Sure. And there's indeed a difference between parsing and interpreting.