-
Notifications
You must be signed in to change notification settings - Fork 10
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
Adding CA ions to parsing list - proteincomponent.py #265
Conversation
I found this missing Ion reccently . We should add it,, as it is frequently used.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #265 +/- ##
==========================================
- Coverage 99.20% 98.74% -0.47%
==========================================
Files 36 36
Lines 1898 1992 +94
==========================================
+ Hits 1883 1967 +84
- Misses 15 25 +10 ☔ View full report in Codecov by Sentry. |
gufe/components/proteincomponent.py
Outdated
negative_ions = ["F", "CL", "Br", "I"] | ||
positive_ions = ["NA", "MG", "ZN"] | ||
negative_ions = ["F", "CL", "BR", "I"] | ||
positive_ions = ["NA", "MG", "CA", "ZN"] |
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.
Would it make sense to just add every mono and divalent ions that are defined in the AMBER ffxml?
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.
We're probably replacing this entirely soon, so a small fix is ok for now. I'd be more interested in a test to encode the fix/behaviour
was previously looking at the enum values rather than the bond order values
I checked this new version of the ProteinComponent against the old one and both give the same formal charges for the atoms and same bond order for the bonds. |
make ion name not case sensitive, Cl == CL ignore trailing numbers on ion names, allows CL1 for CL
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.
looks pretty good to me only one question :)
gufe/components/proteincomponent.py
Outdated
if atom_name in positive_ions: | ||
if atom_name.upper() in positive_ions: | ||
fc = default_valence # e.g. Sodium ions | ||
elif atom_name in negative_ions: | ||
elif atom_name.upper() in negative_ions: | ||
fc = - default_valence # e.g. Chlorine ions | ||
elif atom_name.strip(string.digits).upper() in positive_ions: | ||
# catches cases like 'CL1' as name | ||
fc = default_valence | ||
elif atom_name.strip(string.digits).upper() in negative_ions: | ||
fc = - default_valence |
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.
this could be simplified, right?
if atom_name.strip(string.digits).upper() in positive_ions:
# catches cases like 'CL1' as name
fc = default_valence
elif atom_name.strip(string.digits).upper() in negative_ions:
fc = - default_valence
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.
hmm yeah you're right here
I found this missing Ion reccently . We should add it,, as it is frequently used.