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

contact map analysis module #731

Merged
merged 21 commits into from
Nov 23, 2023
Merged

contact map analysis module #731

merged 21 commits into from
Nov 23, 2023

Conversation

VGPReys
Copy link
Contributor

@VGPReys VGPReys commented Oct 24, 2023

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

  • You have sticked to Python. Please talk to 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 is a (state) purpose
  • Your 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 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:

This closes #733 .
As a response to users request, a new analysis module is now available for user to generate contact maps of the generated structures.
The module will mainly focus on generating contact map on a per-cluster basis.
It is also possible to generate map for single structures.

Two type of graphs can be generated: heatmaps and chordcharts.

@VGPReys VGPReys self-assigned this Oct 24, 2023
@VGPReys VGPReys requested a review from mgiulini October 24, 2023 12:26
@codecov
Copy link

codecov bot commented Oct 24, 2023

Codecov Report

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

Comparison is base (1ea177d) 70.25% compared to head (56c6872) 72.45%.

Files Patch % Lines
src/haddock/modules/analysis/contactmap/contmap.py 98.68% 7 Missing ⚠️
...rc/haddock/modules/analysis/contactmap/__init__.py 95.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #731      +/-   ##
==========================================
+ Coverage   70.25%   72.45%   +2.19%     
==========================================
  Files          78       80       +2     
  Lines        6967     7547     +580     
==========================================
+ Hits         4895     5468     +573     
- Misses       2072     2079       +7     

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

@rvhonorato rvhonorato added m|contactmap enhancement Enhancing an existing feature of adding a new one labels Oct 24, 2023
@rvhonorato rvhonorato added feature New feature request and removed enhancement Enhancing an existing feature of adding a new one labels Oct 24, 2023
Copy link
Member

@rvhonorato rvhonorato left a comment

Choose a reason for hiding this comment

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

Nice addition, just some small comments to be addressed and please add an integration test.

@sverhoeven
Copy link
Contributor

sverhoeven commented Oct 25, 2023

Cool, the contacts can also be rendered in a mol viewer like

nglviewer org_ngl_

Could be part of the webapp or preprocess analysis?

Nevermind its already an issue at #733

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.

the plot looks nice, but I wonder if this is what we want to show to the users. The majority of the contact map is dominated by intra-chain contacts, and that's what draws the attention...isn't it better to focus between inter-chain contacts so as to visualize contacts at the interface?

also, I am bit concerned about the size of the output, every contact map tsv file is 6 MB and the html is almost 5 MB..reducing the number of digits for a field (see comment) can improve things..but maybe this another argument in favour of showing only inter-chain contacts

examples/analysis/contmap-test.cfg Show resolved Hide resolved
src/haddock/modules/analysis/contactmap/defaults.yaml Outdated Show resolved Hide resolved
src/haddock/modules/analysis/contactmap/defaults.yaml Outdated Show resolved Hide resolved
src/haddock/modules/analysis/contactmap/contmap.py Outdated Show resolved Hide resolved
tests/test_module_contmap.py Show resolved Hide resolved
src/haddock/modules/analysis/contactmap/contmap.py Outdated Show resolved Hide resolved
Co-authored-by: Marco Giulini <54807167+mgiulini@users.noreply.github.com>
@VGPReys
Copy link
Contributor Author

VGPReys commented Oct 26, 2023

the plot looks nice, but I wonder if this is what we want to show to the users. The majority of the contact map is dominated by intra-chain contacts, and that's what draws the attention...isn't it better to focus between inter-chain contacts so as to visualize contacts at the interface?

It as a good solution too.
I don't know what exactly is wanted here.
I felt like having plots that look like AlphaFold outputs would be simple for user to understand, as they might be used to this kind of plots.

also, I am bit concerned about the size of the output, every contact map tsv file is 6 MB and the html is almost 5 MB..
reducing the number of digits for a field (see comment) can improve things..but maybe this another argument in favour of showing only inter-chain contacts

Indeed, big issue...
Inter-chain contacts can solve this :)

Maybe a simple matplotlib plot can also be lighter.

Co-authored-by: Marco Giulini <54807167+mgiulini@users.noreply.github.com>
@mgiulini
Copy link
Contributor

also, I am bit concerned about the size of the output, every contact map tsv file is 6 MB and the html is almost 5 MB..
reducing the number of digits for a field (see comment) can improve things..but maybe this another argument in favour of showing only inter-chain contacts

Indeed, big issue... Inter-chain contacts can solve this :)

let's go for it then!

Maybe a simple matplotlib plot can also be lighter.

nah, being able to visualize the contacts interactively is super cool!

@amjjbonvin
Copy link
Member

amjjbonvin commented Oct 26, 2023 via email

rvhonorato
rvhonorato previously approved these changes Nov 22, 2023
Copy link
Member

@rvhonorato rvhonorato left a comment

Choose a reason for hiding this comment

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

Code looks good to me! 💯

mgiulini
mgiulini previously approved these changes Nov 22, 2023
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.

added just a few comments here and there, the coordinate chart is truly beautiful!
feel free to merge as is

integration_tests/test_contactmap.py Outdated Show resolved Hide resolved
src/haddock/modules/analysis/contactmap/contmap.py Outdated Show resolved Hide resolved
src/haddock/modules/analysis/contactmap/contmap.py Outdated Show resolved Hide resolved
src/haddock/modules/analysis/contactmap/contmap.py Outdated Show resolved Hide resolved
src/haddock/modules/analysis/contactmap/defaults.yaml Outdated Show resolved Hide resolved
Co-authored-by: Marco Giulini <54807167+mgiulini@users.noreply.github.com>
@VGPReys VGPReys dismissed stale reviews from mgiulini and rvhonorato via 8ab07ca November 22, 2023 16:00
VGPReys and others added 4 commits November 22, 2023 17:00
Co-authored-by: Marco Giulini <54807167+mgiulini@users.noreply.github.com>
Co-authored-by: Marco Giulini <54807167+mgiulini@users.noreply.github.com>
@VGPReys VGPReys merged commit a9f298e into main Nov 23, 2023
6 checks passed
@VGPReys VGPReys deleted the contact-maps branch November 27, 2023 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request m|contactmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Visualize structures by contact maps
5 participants