Skip to content

Conversation

rversin
Copy link
Member

@rversin rversin commented Mar 13, 2025

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
  • Does not break licensing
  • Does not add any dependencies, if it does please add a thorough explanation

Summary of the Pull Request

This pull request corresponds to the adaptation of the caprieval module for coarse-grained structures.

Related Issue

Additional Info

@rversin rversin changed the base branch from main to CG-HADDOCK March 13, 2025 13:27
Copy link
Contributor

@VGPReys VGPReys left a comment

Choose a reason for hiding this comment

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

Is it really needed to add the cgffversion parameter ? Can't we detect that we are already working with coarse-grain ?

There is an issue with the variable cg set in the init.py:

  • It is set to be an integer, but the CAPRI class and other functions are defined receiving bool types.
  • Also cg integer is used to point a specific position in lists, and therefore cannot be of type bool.

Instead of lists, I would rather use dicts (in libalign.py):

PROT_ATOMS = [
    PROT_ATOMS_AA,
    PROT_ATOMS_MARTINI2,
    PROT_ATOMS_MARTINI2 # The backbone particle is identical between MARTINI 2 and 3
]

to

PROT_ATOMS = {
    "aa": PROT_ATOMS_AA,
    "martini2": PROT_ATOMS_MARTINI2,
    "martini3": PROT_ATOMS_MARTINI2 # The backbone particle is identical between MARTINI 2 and 3
}

(this also applies for DNA and RNA lists)

and make cg of type str, taking possible values aa, martini2 (and in the future martini3)
I think it will be easier to understand what is happening.

Copy link
Contributor

@mgiulini mgiulini left a comment

Choose a reason for hiding this comment

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

this needs some tests to make sure that the resulting numbers make sense

@rversin
Copy link
Member Author

rversin commented Mar 13, 2025

For the cgffversion parameter, I chose this option instead of opening and closing the pdb files in the caprieval module directly, which was the only other solution I could think of to check if it was CG or not. This pdb opening or closing felt tedious, especially because it is tricky to differentiate between martini2 and martini3 structures based on the pdb.

Co-authored-by: Victor Reys <132575181+VGPReys@users.noreply.github.com>
@rversin
Copy link
Member Author

rversin commented Mar 13, 2025

For the variable cg , I indeed made a mistake, at first it was a bool then I changed my mind but didn't change the definition of the variable
I will correct it :)

@VGPReys
Copy link
Contributor

VGPReys commented Mar 14, 2025

For the cgffversion parameter, I chose this option instead of opening and closing the pdb files in the caprieval module directly, which was the only other solution I could think of to check if it was CG or not. This pdb opening or closing felt tedious, especially because it is tricky to differentiate between martini2 and martini3 structures based on the pdb.

Don't you have access to the type of topology based on the content of the io.json ?

@rvhonorato rvhonorato added m|caprieval Improvements in caprieval module m|topocg topocg module labels Mar 18, 2025
@rvhonorato rvhonorato changed the title Cg haddock cgcapri update caprieval to handle coarse-grained structures. Mar 18, 2025
@rvhonorato rvhonorato changed the title update caprieval to handle coarse-grained structures. update caprieval to handle coarse-grained structures Mar 18, 2025
@rversin
Copy link
Member Author

rversin commented May 13, 2025

Hi,
If it's fine with everyone, I would like to merge this now :)

Copy link
Contributor

@mgiulini mgiulini left a comment

Choose a reason for hiding this comment

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

looks good to me! especially since you compared the results to other methods
Side note : the example silently breaks the traceback option (as now two topology modules can be defined within the same workflow). That will have to be fixed before the CG PR gets merged into the main

rversin and others added 2 commits May 16, 2025 11:10
Co-authored-by: Victor Reys <132575181+VGPReys@users.noreply.github.com>
@rversin rversin merged commit 50425c8 into CG-HADDOCK May 16, 2025
5 checks passed
@rversin rversin deleted the CG-HADDOCK-cgcapri branch May 16, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving something in the codebase m|caprieval Improvements in caprieval module m|topocg topocg module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants