Skip to content

remove duplicated parameter definitions in fragment_probes.param, protein-allhdg5-4.param and protein-CG-Martini-2-2.param#1590

Open
amjjbonvin wants to merge 12 commits into
mainfrom
martini-param-cleanup
Open

remove duplicated parameter definitions in fragment_probes.param, protein-allhdg5-4.param and protein-CG-Martini-2-2.param#1590
amjjbonvin wants to merge 12 commits into
mainfrom
martini-param-cleanup

Conversation

@amjjbonvin

@amjjbonvin amjjbonvin commented Jun 26, 2026

Copy link
Copy Markdown
Member

You are about to submit a new Pull Request. Before continuing make sure you read the contributing guidelines.

Checklist

  • Tests added for the new code
  • Documentation added for the code changes
  • Modifications / enhancements are reflected on the haddock3 user-manual
  • CHANGELOG.md is updated to incorporate new changes
  • Does not break licensing
  • Does not add any dependencies, if it does please add a thorough explanation

Summary of the Pull Request

  • Cleaned up various param files in the cns/toppar directory, removing duplications.

The number of duplications was especially large for the Martini CG param file due to some previous scripted param generation.

Related Issues

#1589

Additional Info

For BONDs, A-B is equivalent to B-A
For ANGLEs, A-B-C is equivalent to C-B-A
For DIHEdrals: A-B-C-D is equivalent to D-C-B-A

Reducing the size of the number of parameters in the various force field by removing unnecessary duplications will avoid problems with parameter array sizes in CNS (which is the past required recompilation of the code)

amjjbonvin and others added 2 commits June 26, 2026 22:18
…aram file

19,110 DIHEdral entries were exact reverse-direction duplicates (A-B-C-D listed
alongside D-C-B-A with identical parameters). Deduplicated by keeping only the
first occurrence of each canonical atom-quadruple/parameter pair, reducing the
file from 47,165 to 28,055 lines with no change in force-field content.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…am files

Deduplicated reverse-direction parameter entries (A-B = B-A for BOND,
A-B-C = C-B-A for ANGLE, A-B-C-D = D-C-B-A for DIHEDRAL) across three files:
- protein-CG-Martini-2-2.param: removed 1470 ANGLE duplicates
- fragment_probes.param: removed 41 DIHEDRAL duplicates
- protein-allhdg5-4.param: removed 1 ANGLE + 2 DIHEDRAL duplicates
All removed entries had identical parameters to their retained counterparts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@amjjbonvin amjjbonvin self-assigned this Jun 26, 2026
@amjjbonvin amjjbonvin added enhancement Improving something in the codebase parameters-topologies Issues/feature requests related to the force field AI Changes authored or assisted by AI labels Jun 26, 2026
@amjjbonvin amjjbonvin marked this pull request as draft June 27, 2026 09:19
@amjjbonvin amjjbonvin marked this pull request as ready for review June 27, 2026 10:25
@amjjbonvin amjjbonvin added bug Something isn't working m|cgtoaa labels Jun 27, 2026
@amjjbonvin amjjbonvin requested a review from rvhonorato June 27, 2026 17:26
@sjdv1982

Copy link
Copy Markdown
Contributor

According to an analysis script, there are 1005 force field parameters that have changed after the cleanup.
They are all ANGLEs, and the parameters are mostly duplicates / permutations:

Among the 1005 changes,

unique old parameters:

167.184 96
  23.883 98
  5.971 100
  5.971 134

unique new parameters:

  167.184 96
  5.971 100
  5.971 127
  5.971 134

See the latest commit on https://github.com/sjdv1982/haddock3/tree/martini-param-cleanup for details.

WARNING: analysis script is AI-generated, may contain nonsense.

@rvhonorato rvhonorato left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR has +3 -20,633 line changes and two completely different scopes;

Cleaned up various param files in the cns/toppar directory, removing duplications.

This is lacking a proper justification, this code has been in production for many years and it's unclear how or why this potentially disrupting change is beneficial

Corrected the bug in cgtoaa.cns regarding the reading of the cg-to-aa restraints for the conversion from CG to AA

This is a proper bug with inverted logic and the fix is correct.


However these should not be in the same PR, changing 20+K lines together with a one line simple bugfix is bad practice, please open two separate PRs

@amjjbonvin

amjjbonvin commented Jun 29, 2026 via email

Copy link
Copy Markdown
Member Author

@rvhonorato

Copy link
Copy Markdown
Member

Ok will do - but until then we have a broken CG code …

Looking at the timestamps the bug was introduced in 0d50d36 which was 59 days ago - meaning its broken for almost 2 months and I did not see any other issue being raised about it. You can decide if the urgency is worth breaking best-practices.

And if you read the info and issue you will understand why so many lines were removed - the reason for doing that is it avoids recompiling CNS because we hit the parameter limits

The issue states "Cleaning up will reduce the file sizes"

Looking at the different in file sizes between the branches:

(main) $ du -hs src/
37M	src/
(martini-param-cleanup) $ du -hs src/        
36M	src/

It does not mention recompilation and parameter limits, please include this in the description.

@amjjbonvin amjjbonvin requested a review from rvhonorato June 29, 2026 12:57
@rvhonorato rvhonorato changed the title Martini param cleanup remove duplicated parameter definitions in fragment_probes.param, protein-allhdg5-4.param and protein-CG-Martini-2-2.param Jun 29, 2026
@rvhonorato rvhonorato linked an issue Jul 1, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Changes authored or assisted by AI bug Something isn't working enhancement Improving something in the codebase m|cgtoaa parameters-topologies Issues/feature requests related to the force field

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove duplications in parameter files

3 participants