-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotations #25
Annotations #25
Conversation
Don't hate it. I think a) is the better option, because CoG is a sane default. Needs to be documented though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks fine, just a small question
@pckroon I prefer to strip them from the smiles string, because in that fashion CGSmiles and SMILES fragments are treated the same. The question is if one would want to allow general annotation for CGSmiles as well. Something like |
|
@pckroon yes that's the idea pretty much. In Martini there are so many meta infos, which one might want to add. But again I think a seperate PR would be better |
Well, yes and no. You/we need to decide on the syntax here and now to see how the weights should get implemented: |
ahh yes that is true of course |
let me sit on this until tomorrow |
@pckroon here my thoughts: What I like:
What I don't like:
@ricalessandri what are your thoughts? |
Agnosticism is a big plus when programming, especially when it comes to syntax design (IMNSHO). It makes it more likely you get it right the first time.
You need some sort of separator between labels and values, so if you want bead annotations this is unavoidable
This is indeed a downside. You could argue that, since weights are going to be the most used, they can go without label.
Sounds reasonable. If you want to annotate hydrogens, make them explicit. |
My 2 cents: This seems neat and useful. About the verbosity concern - since weight=1 will likely be the implicit default, verbosity only matters when you need different weight values. And for weights (probably the most common case), |
As decided by popular vote here it is: We now allow general annotations of the type [keyword=value,keyword=value]. In addition to making the notation more concise, we have positional arguments defined by a dialect. These positional arguments also set default values for example charge: 0 and weight: 1. They also overtake the charge argument. Thus charged beads have to be written as For the CG part, we adopt the CGSmiles base dialect with charges and weights as positional arguments. Therefore, one can write The notation also allows for example to write:
We also support the annotations for the all-atom part, but we should not advertise it. At the moment one should only specify the weight. Charges should still be specified as So bottom line:
New dialects can be created using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small code cleaning opportunity, looks good otherwise!
Co-authored-by: Peter C Kroon <[email protected]>
Martini CG mappings are a curious thing; More complex molecules frequently have atoms that are ignored in the mapping (i.e. zero weight) or reweighted. This PR implements a syntax for this. Optionally, nodes can be given weight using
[node;weight]
, where weight may be a float. Hydrogens need not be given as we figure them out later, but canonically speaking, it would be better. Annotation of the weight may occur before or after the chirality operator. A default weight of 1 is given to all nodes. Hydrogen atoms unless explicit get the same weight as the node they are attached to.For example, hexadecane but we map only the central two carbons:
{[#C1]|4}.{#C1=[C;0]CC[C;0]}