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

Replace haddock3-analysis-components with haddock3-ui package #1025

Merged
merged 15 commits into from
Oct 4, 2024

Conversation

sverhoeven
Copy link
Contributor

@sverhoeven sverhoeven commented Sep 16, 2024

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

I made 2 npm packages

  1. https://www.npmjs.com/package/@i-vresse/haddock3-ui
  2. https://www.npmjs.com/package/@i-vresse/haddock3-analysis-components

The haddock3-ui package now can do everything the haddock3-analysis-components can do. So I want to archive the haddock3-analysis-components GitHub repo.

This PR uses the haddock3-ui package for rendering tables of clusters and structures.

This PR also implements offline mode for the table in the report.html, no urls outside the local web server are requested.

Related Issue

i-VRESSE/haddock3-ui#6

Additional Info

0 0 0 0_8000_analysis_10_caprieval_analysis_report html
0 0 0 0_8000_analysis_10_caprieval_analysis_report html (1)
0 0 0 0_8000_analysis_02_caprieval_analysis_report html

@sverhoeven sverhoeven marked this pull request as ready for review September 16, 2024 09:55
rvhonorato
rvhonorato previously approved these changes Sep 17, 2024
@rvhonorato rvhonorato requested a review from a team September 17, 2024 15:27
@rvhonorato rvhonorato added the enhancement Enhancing an existing feature of adding a new one label Sep 17, 2024
@VGPReys
Copy link
Contributor

VGPReys commented Sep 18, 2024

To which extend we could also ship the haddock3-ui when installing haddock3, so the offline = true would also be functional ?

@VGPReys
Copy link
Contributor

VGPReys commented Sep 18, 2024

I see that plotly menu is on top of the cluster legend (see screenshot)
Screenshot 2024-09-18 at 09-08-41 Analysis report of step 9_caprieval

@sverhoeven
Copy link
Contributor Author

To which extend we could also ship the haddock3-ui when installing haddock3, so the offline = true would also be functional ?

Working on offline mode in i-VRESSE/haddock3-ui#9 .
How would we like to use the haddock3-ui js bundle?

  1. As an external file,
    1. next to report.html,
    2. somewhere within run_dir for reusing same js file.
  2. JS embedded inside report.html

@VGPReys
Copy link
Contributor

VGPReys commented Sep 19, 2024

To which extend we could also ship the haddock3-ui when installing haddock3, so the offline = true would also be functional ?

Working on offline mode in i-VRESSE/haddock3-ui#9 . How would we like to use the haddock3-ui js bundle?

1. As an external file,
   
   1. next to report.html,
   2. somewhere within run_dir for reusing same js file.

2. JS embedded inside report.html

Good question! design choice I guess.

  • Can't it be somewhere in the haddock3 installation repository ? Like haddock3/js-bundle/haddock3-ui.js?

  • Or maybe we want to have it contained in the run_dir somewhere, so results are self sufficient and can be separated from the code. I guess this is the best option. Could be placed in the data directory: run_dir/data/ui/haddock3-ui.js.

@rvhonorato , @amjjbonvin please provide input for this

@amjjbonvin
Copy link
Member

amjjbonvin commented Sep 20, 2024 via email

@sverhoeven
Copy link
Contributor Author

The js file is 1.5Mb and the css file 11Kb.

@VGPReys indeed I was thinking of making it part of the haddock3 installation (using a similar mechanism as used to download cns executables in #1013) and then during analysis copy the css+js files to the run_dir, as the web server must have the css+js files in the directory it is hosting.

@sverhoeven
Copy link
Contributor Author

Offline example

In examples/scoring dir created capri-scoring-test.offline.cfg with

# ===================================================================================
# CAPRI Scoring example
# ===================================================================================
# The Critical Assessment of PRedicted Interactions (CAPRI) experiment
#  aims to do test methods that model macromolecular interactions in
#  blind predictions based on the three-dimensional structures of proteins.
# For more information, please visit: https://www.ebi.ac.uk/pdbe/complex-pred/capri/
# ===================================================================================
run_dir = "capriscoring-test"

# execution mode
ncores = 40
mode = "local"
offline = true

# molecules to be scored (an ensemble PBD)
molecules = "data/T161-rescoring-ens.pdb"

# ===================================================================================
[topoaa]

[emscoring]

[caprieval]

[clustfcc]
min_population = 2

[seletopclusts]
top_cluster = 1
top_models = 2

[mdscoring]
per_interface_scoring = true

[clustfcc]
min_population = 2

[seletopclusts]

[caprieval]

# ===================================================================================

Ran with

rm -r capriscoring-test
haddock3 capri-scoring-test.offline.cfg
mkdir capriscoring-test/data/ui
curl -o capriscoring-test/data/ui/report.bundle.js https://cdn.jsdelivr.net/npm/@i-vresse/haddock3-ui@~0.3.0/dist/report.bundle.js
curl -o capriscoring-test/data/ui/index.css https://cdn.jsdelivr.net/npm/@i-vresse/haddock3-ui@~0.3.0/dist/index.css

@sverhoeven
Copy link
Contributor Author

@rvhonorato At #1025 (comment) I am working on rendering tables in offline mode. To do that I need to copy a css and js file from the haddock3 installation.

How can we make those files part of the haddock3 installation? I see several options:

  1. Use custombuild step similar to re-work haddock3 installation #1013 to download files.
  2. have the files be part of the repo and have a script to update them.
  3. Have a haddock3-ui python package that contains the js and css files and is a dependency of haddock3 package.

What has your preference?

@sverhoeven sverhoeven marked this pull request as draft September 20, 2024 09:58
@sverhoeven
Copy link
Contributor Author

I went for option 2 so a 1.5Mb js file will be part of the repo.

@sverhoeven sverhoeven marked this pull request as ready for review September 20, 2024 11:46
@sverhoeven sverhoeven marked this pull request as draft September 20, 2024 11:51
@sverhoeven sverhoeven marked this pull request as ready for review September 20, 2024 11:58
mgiulini
mgiulini previously approved these changes Sep 20, 2024
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.

both unclustered and clustered tables look good!

@sverhoeven
Copy link
Contributor Author

I see that plotly menu is on top of the cluster legend (see screenshot) Screenshot 2024-09-18 at 09-08-41 Analysis report of step 9_caprieval

Fixed with i-VRESSE@d24a510

mgiulini
mgiulini previously approved these changes Sep 25, 2024
@sverhoeven
Copy link
Contributor Author

@VGPReys you beat me with #1041, so I will solve the conflicts.

@VGPReys
Copy link
Contributor

VGPReys commented Oct 2, 2024

@VGPReys you beat me with #1041, so I will solve the conflicts.

Oops...
I did not realized that you also worked on it !

@sverhoeven
Copy link
Contributor Author

@VGPReys you beat me with #1041, so I will solve the conflicts.

Oops... I did not realized that you also worked on it !

No worries, conflicts have been resolved.

@mgiulini mgiulini merged commit ab017c2 into haddocking:main Oct 4, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancing an existing feature of adding a new one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants