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

Add SAXS scoring module #551

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from
Draft

Add SAXS scoring module #551

wants to merge 24 commits into from

Conversation

cvnoort
Copy link
Contributor

@cvnoort cvnoort commented Sep 9, 2022

You are about to submit a new Pull Request. Before continuing make sure you read the contributing guidelines and you comply with the following criteria:

  • You have stick to Python. Talk with us before adding other programming languages to HADDOCK3
  • Your PR is about CNS
  • Your code is well documented: proper docstrings and explanatory comments for those tricky parts
  • You structured the code into small functions as much as possible. You can use classes if there's a (state) purpose
  • code follows our coding style
  • You wrote tests for the new code
  • tox tests pass. Run tox command inside the repository folder
  • -test.cfg examples execute without errors. Inside examples/ run python run_tests.py -b
  • PR does not add any install dependencies unless permission granted by the HADDOCK team
  • PR does not break licensing
  • Your PR is about writing documentation for already existing code 🔥
  • Your PR is about writing tests for already existing code :godmode:

Introducing a new scoring module to calculate a HADDOCK-SAXS score as described by Karaca & Bonvin (2013) in Acta Crystallographica.

New module created for scoring based on SAXS scattering data. Runs ATSAS CRYSOL to calculate fit of HADDOCK models to the data. Currently does not calculate HADDOCKsaxs score.
Default weight set to 50.0 for the SAXS scoring term in HADDOCKsaxs. Also changed the CRYSOL -cst option to a boolean and made all CRYSOL options expert-only.
Update to SAXS scoring module: now writes chi values and corresponding HADDOCKsaxs score to output file. Note that this score is not currently passed to seletop.
Assign HADDOCKsaxs score to each model's score attribute, so that this score is passed to the next module, eg. seletop will select based on this score.
Opening output file only once to write HADDOCKsaxs scores.
Some small adjustments to __init__.py of the SAXS scoring module.
Adding simulated scattering data for the 1GGR example and an example configuration file to run the SAXS scoring module.
@cvnoort
Copy link
Contributor Author

cvnoort commented Sep 16, 2022

TO DO: Use HADDOCK score from models (calculated by the preceding module), rather than calling calc_haddock_score to calculate from scratch. We then no longer need the individual weights for the scoring terms, replace these with one weight for the pre-calculated HADDOCK score (default = 1) and of course keep w_saxs for the SAXS term (default = 50).

@cvnoort
Copy link
Contributor Author

cvnoort commented Sep 16, 2022

As discussed, the saxsscore module is a BaseHaddockModule, rather than a ScoringModule.

This is because the latter is a child class of BaseCNSModule that is designed to use CNS, which we do not need for this module. Instead of calling the output function from the BaseCNSModule class, some of it is copied in the module itself to produce a similar output table...

Instead of calculating the HADDOCK score from scratch, the SAXS scoring module now uses the scores from the previous module and simply adds the chi term. If previous module did not produce a score (eg. topoaa), score=chi. Also added option to change the weight of the HADDOCK score relative to the chi term.
Some small fixes.
More small fixes.
Actually fixed lint issues.
Added min and max values for CRYSOL parameters lm and ns.
@codecov-commenter
Copy link

codecov-commenter commented Oct 19, 2022

Codecov Report

Attention: 35 lines in your changes are missing coverage. Please review.

Comparison is base (30373a2) 70.25% compared to head (2937ea6) 69.96%.
Report is 58 commits behind head on main.

Files Patch % Lines
src/haddock/modules/analysis/saxsscore/__init__.py 28.57% 35 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #551      +/-   ##
==========================================
- Coverage   70.25%   69.96%   -0.30%     
==========================================
  Files          78       79       +1     
  Lines        6967     7016      +49     
==========================================
+ Hits         4895     4909      +14     
- Misses       2072     2107      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Moving the SAXS scoring module from the scoring to the analysis category.
Use the square root of Chi^2 values calculated by CRYSOL (==> Chi) to calculate the score correctly as in the Karaca & Bonvin publication.
Added a brief description of the module.
Fix order of imports.
@cvnoort cvnoort self-assigned this Nov 18, 2022
Redirect stdout from CRYSOL to /dev/null and remove .fit and .log files to save space.
Fixing lint errors from previous commit.
@VGPReys VGPReys added the feature New feature request label Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request m|saxsscore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants