Skip to content

VMD visualization of CaviTracer - #2279

Merged
karolamik13 merged 3 commits into
prody:mainfrom
karolamik13:prody__main
Sep 18, 2026
Merged

karolamik13 merged 3 commits into
prody:mainfrom
karolamik13:prody__main

Conversation

@karolamik13

Copy link
Copy Markdown
Contributor

I created the writeVmdCaviTracerScript() function, which creates a VMD state for the results obtained by CaviTracer.

How to use it:
from prody import *
p = parsePDB('1tqn')
atoms = p.select("protein")

For channels:

channels, surface = calcChannels(atoms)
writeVmdCaviTracerScript(channels, atoms)

Surface cavities:

cavities, surface = calcSurfaceCavities(atoms)
writeVmdCaviTracerScript(cavities, atoms, object_type='surface_cavities', surface=surface)

It will also work for pores and reconstruction of channels+surface cavities.

The user is obtaining a TCL script (vis_channels.tcl for channels, vis_pores.tcl for pores, etc.) that contains a visualization-ready state of the analysis.

To run the script:
vmd -e vis_channels.tcl

Visualization:
cavitracer_figure41

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

A few minor things that I don’t need to check on. Otherwise everything looks good

Comment thread prody/proteins/channels.py Outdated
if object_type == 'connected_cavities_channels':
if isinstance(objects, dict):
objects = [objects]
elif not isinstance(objects, list):

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 redundant. The same happens in both if branches

Comment thread prody/proteins/channels.py Outdated
elif not isinstance(objects, list):
objects = [objects]

if len(objects) == 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.

This will never happen unless an empty list is explicitly provided because of wrapping into a list giving length 1

Comment thread prody/proteins/channels.py Outdated

# ------------------------------------------------------------------
# Save protein
# ------------------------------------------------------------------

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.

Remove these as there are no long blocks that need separating

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.

For the other ones they are fine but could be shorter

# Display
# ----------------------------------------------------------------------

color Display Background white

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.

Maybe make these arguments

@karolamik13
karolamik13 merged commit 1f52bbe into prody:main Sep 18, 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