Skip to content
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

Merged
merged 7 commits into from
Apr 17, 2024

Conversation

RiesBen
Copy link
Contributor

@RiesBen RiesBen commented Jan 13, 2024

I found this missing Ion reccently . We should add it,, as it is frequently used.

I found this missing Ion reccently . We should add it,, as it is frequently used.
Copy link

codecov bot commented Jan 13, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 98.74%. Comparing base (ae96d30) to head (3b530bd).
Report is 37 commits behind head on main.

❗ Current head 3b530bd differs from pull request most recent head 4cc370e. Consider uploading reports for the commit 4cc370e to get more accurate results

Files Patch % Lines
gufe/components/proteincomponent.py 60.00% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

negative_ions = ["F", "CL", "Br", "I"]
positive_ions = ["NA", "MG", "ZN"]
negative_ions = ["F", "CL", "BR", "I"]
positive_ions = ["NA", "MG", "CA", "ZN"]
Copy link
Member

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?

Copy link
Contributor

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

@RiesBen RiesBen changed the title Addin CA ions to parsing list - proteincomponent.py Adding CA ions to parsing list - proteincomponent.py Jan 30, 2024
was previously looking at the enum values rather than the bond order values
@hannahbaumann
Copy link
Contributor

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
Copy link
Contributor Author

@RiesBen RiesBen left a 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 :)

Comment on lines 212 to 234
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
Copy link
Contributor Author

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

Copy link
Contributor

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

@richardjgowers richardjgowers enabled auto-merge (rebase) April 17, 2024 16:03
@richardjgowers richardjgowers disabled auto-merge April 17, 2024 18:00
@richardjgowers richardjgowers merged commit 2425b4c into main Apr 17, 2024
8 checks passed
@richardjgowers richardjgowers deleted the adding-CA-to-the-positive-Ions-list branch April 17, 2024 18:00
@IAlibay IAlibay mentioned this pull request Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants