Skip to content

CaviTracer - additonal functions and multoprocessing - #2266

Merged
karolamik13 merged 7 commits into
prody:mainfrom
karolamik13:prody__main
Aug 11, 2026
Merged

CaviTracer - additonal functions and multoprocessing#2266
karolamik13 merged 7 commits into
prody:mainfrom
karolamik13:prody__main

Conversation

@karolamik13

Copy link
Copy Markdown
Contributor

I added several new functionalities:

  • scanSurfaceCavityParameters() to scan various parameters for detecting surface cavities. It will help choose the best parameters for the system under study. A similar function is already available for channels.
  • calcFrequentObjectResidues() to show residues and their appearances in channels, pores, or surface cavities.
  • showFrequentObjectResidues(), we can display the results provided by calcFrequentObjectResidues()
  • calcSurfaceCavitiesMultipleFrames: multiprocessing is now added. It was available in pores and channels, but not here.

How to use them will be displayed in the tutorials:
https://github.com/prody/ProDy-website/tree/master/tutorials/cavitracer_tutorial

@briza81 @MatthewLicht

@jamesmkrieger jamesmkrieger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Generally looks good, just some minor changes

Comment thread prody/proteins/channels.py Outdated
return cavities_all, surfaces_all

if max_proc is None:
max_proc = multiprocessing.cpu_count()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is too high for a default. We don’t want the program to take over someone’s whole cpu if they aren’t expecting it. I think other places use cpu count divided by 2


import multiprocessing

if len(tasks) == 0:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what triggers getting len(tasks) == 0? There should probably be a warning here before returning empty lists

Comment thread prody/proteins/channels.py Outdated
'sparsity'}))

if forbidden_params:
raise ValueError("Grid-controlled arguments must not be passed in kwargs: {0}".format(', '.join(forbidden_params)))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

split long lines like this one

Comment thread prody/proteins/channels.py Outdated
- getSurfaceCavityResidueNamesMultipleFrames()

Residue labels are expected to contain chain identifiers, e.g. ASP108:A.
If count_residue_names is False, individual residues are counted, e.g.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems redundant with docs for the arg below

Comment thread prody/proteins/channels.py Outdated
ASP108 in chain A. If count_residue_names is True, residue types are counted,
e.g. ASP in chain A.

If count_once_per_frame is True, the same residue is counted only once per

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this one is redundant with arg docs below too

Comment thread prody/proteins/channels.py Outdated
labels = [item[0] for item in items]
values = [item[1] for item in items]

plt.figure(figsize=(14, 4))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we generally allow users to handle the plt.figure and plt.show parts outside the function and use prody's auto_show config to help with that. plt.show may not be useful in some application cases like running a script and saving the figures straight away

@karolamik13
karolamik13 merged commit 7969f49 into prody:main Aug 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants