Skip to content

add caprifilter and move functions to libcapri.py#1550

Merged
AnnaKravchenko merged 24 commits into
mainfrom
rmds-filt-mod
Jul 1, 2026
Merged

add caprifilter and move functions to libcapri.py#1550
AnnaKravchenko merged 24 commits into
mainfrom
rmds-filt-mod

Conversation

@AnnaKravchenko

@AnnaKravchenko AnnaKravchenko commented May 1, 2026

Copy link
Copy Markdown
Contributor

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

Checklist

  • Tests (made using AI) added for the new code
  • Documentation added for the code changes
  • Modifications / enhancements are reflected on the [haddock3 user-manual] (https://github.com/haddocking/haddock3-user-manual) (PR is open)
  • 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

Making of a caplifilter module, which can filter models based on multiplt CAPRI metrics.
CAPRI metrics calculation are the same as in caprieval, so shared fuctions are moved to libcapri.

caprifilter calculates requested metrcis, filters models, writes caprifilter.tsv with kept models, caprifilter_ss.tsv that is basically a copy of capri_ss.tsv, and, if enabled by user, caprifilter_full.tsv, where all modes are listed along with mertics and kept/filtered status.

Related Issue

#1525

Additional Info

Moved find_ff to libstructure, and a handle_input_reference to libpdb. Also had to edit each file/test that was calling functions from capri.py to correct it to libcapri - this is why e.g. alascan is in modified files

@AnnaKravchenko AnnaKravchenko changed the title RMDS filtering module RMSD filtering module May 1, 2026
Comment thread src/haddock/modules/analysis/rmsdfilter/__init__.py Outdated
Comment thread src/haddock/libs/libpdb.py Outdated
@VGPReys

VGPReys commented May 2, 2026

Copy link
Copy Markdown
Contributor

Do you see an option for user to chose between "global rmsd", or "l-rmsd" or "il-rmsd" or "fnat" or "dockq" too ?
You could even directly use the CAPRI class to perform all theses computations ?

@AnnaKravchenko

Copy link
Copy Markdown
Contributor Author

Do you see an option for user to chose between "global rmsd", or "l-rmsd" or "il-rmsd" or "fnat" or "dockq" too ? You could even directly use the CAPRI class to perform all theses computations ?

Can you think of how those metrics would be useful for filtering? For RMDS the idea is to remove model from the workflow - since no other way to do that without manual tweaking, but I don’t see how filtering by fnat or dockq would be useful, so not sure if it’s worth the time.

Maybe let’s discuss this Wednesday? Will be easier in person

@AnnaKravchenko AnnaKravchenko changed the title RMSD filtering module CAPRI metric filtering module Jun 12, 2026
@AnnaKravchenko AnnaKravchenko linked an issue Jun 12, 2026 that may be closed by this pull request
Comment thread src/haddock/libs/libpdb.py Outdated
@AnnaKravchenko AnnaKravchenko added m|caprifilter filter models based on capri metrics m|caprieval Improvements in caprieval module labels Jun 12, 2026
@AnnaKravchenko

Copy link
Copy Markdown
Contributor Author

It would be amazing if somneone could take a look at this PR - to make sure it’s alright before I start on new tests and haddock user manual

@AnnaKravchenko AnnaKravchenko marked this pull request as ready for review June 30, 2026 11:50
@AnnaKravchenko

AnnaKravchenko commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Failing tests (integration_tests/test_rigidbody.py::test_rigidbody_mpi and integration_tests/test_rigidbody-cg.py::test_rigidbody_mpi) seems to be unrelated to the changes introduced by this PR

Guess it will be back to noramal soon, as Rodrigo fixes the lastest "tweak CI” PR

@rvhonorato rvhonorato changed the title CAPRI metric filtering module add caprifilter and move functions to libcapri.py Jun 30, 2026
rvhonorato
rvhonorato previously approved these changes Jun 30, 2026

@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.

good job moving the functions around, having a libcapri is a good change.

as for the caprifilter some parts of the code are very "noisy" and could be written in a leaner more direct way but it's all correct as far as I can read it.

I also made some comments but I see no blocking issues, looks good to me as is.

Comment thread src/haddock/modules/analysis/caprifilter/__init__.py Outdated
Comment thread src/haddock/modules/analysis/caprifilter/__init__.py Outdated
Comment thread src/haddock/modules/analysis/caprifilter/__init__.py Outdated
@rvhonorato rvhonorato added the enhancement Improving something in the codebase label Jun 30, 2026
@AnnaKravchenko AnnaKravchenko requested a review from rvhonorato July 1, 2026 14:30
@AnnaKravchenko

Copy link
Copy Markdown
Contributor Author

Will merge this now, and fix iter guard for capri* modules in corresponding PR

@AnnaKravchenko AnnaKravchenko merged commit db0ee78 into main Jul 1, 2026
9 checks passed
@AnnaKravchenko AnnaKravchenko deleted the rmds-filt-mod branch July 1, 2026 16:40
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|caprifilter filter models based on capri metrics

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filter models based on CAPRI metrics

3 participants