Repository navigation
VMD visualization of CaviTracer - #2279
Merged
Merged
Conversation
jamesmkrieger
approved these changes
Sep 18, 2026
jamesmkrieger
left a comment
Contributor
There was a problem hiding this comment.
A few minor things that I don’t need to check on. Otherwise everything looks good
| if object_type == 'connected_cavities_channels': | ||
| if isinstance(objects, dict): | ||
| objects = [objects] | ||
| elif not isinstance(objects, list): |
Contributor
There was a problem hiding this comment.
This is redundant. The same happens in both if branches
| elif not isinstance(objects, list): | ||
| objects = [objects] | ||
|
|
||
| if len(objects) == 0: |
Contributor
There was a problem hiding this comment.
This will never happen unless an empty list is explicitly provided because of wrapping into a list giving length 1
|
|
||
| # ------------------------------------------------------------------ | ||
| # Save protein | ||
| # ------------------------------------------------------------------ |
Contributor
There was a problem hiding this comment.
Remove these as there are no long blocks that need separating
Contributor
There was a problem hiding this comment.
For the other ones they are fine but could be shorter
| # Display | ||
| # ---------------------------------------------------------------------- | ||
|
|
||
| color Display Background white |
Contributor
There was a problem hiding this comment.
Maybe make these arguments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
