A ChimeraX plugin for connecting to 3decision services, allowing users to search for structures, browse projects, and visualize molecular data directly within ChimeraX.
- Structure Search: Search the 3decision database for molecular structures with real-time job polling
- Project Browser: Browse and load structures from 3decision projects with transformation matrices
- Authentication Management: Secure storage of API credentials with automatic token refresh
- ChimeraX Integration: Native integration with ChimeraX's tool system and menu structure
- Batch Operations: Load multiple structures simultaneously with proper metadata
- ChimeraX 1.8 or later - Download from ChimeraX official website
- Active 3decision API credentials (API key and server URL)
- Platform-specific requirements:
- Linux:
python3-dev,build-essential(Ubuntu/Debian) orpython3-devel,gcc(CentOS/RHEL/Fedora) - Windows: No additional requirements
- macOS: No additional requirements
- Linux:
This bundle follows the official ChimeraX development guidelines. The recommended installation method uses ChimeraX's built-in devel install command:
-
Download or clone this repository:
git clone <repository-url> cd chimerax-plugin
-
Install using ChimeraX:
# Automatic installation (detects ChimeraX location) ./install.sh # Unix-like systems install_windows.bat # Windows # Manual installation (if you know ChimeraX path) /path/to/ChimeraX --nogui --cmd "devel install $(pwd); exit" # Using make (if available) make install
Option 1 - Using Makefile:
# Edit Makefile to set your ChimeraX path if needed
make install # Build and install
make test # Verify installation
make app # Start ChimeraX for testingOption 2 - Manual wheel installation:
# Build wheel
/path/to/ChimeraX --nogui --cmd "devel build $(pwd); exit"
# Install wheel using toolshed
/path/to/ChimeraX --nogui --cmd "toolshed install dist/ChimeraX_threedecision-*.whl; exit"This bundle is designed for distribution through the official ChimeraX Toolshed. Once published, users can install it directly from ChimeraX:
# In ChimeraX command line:
toolshed install threedecisionAfter installation, verify the bundle is properly installed:
-
Test import:
/path/to/ChimeraX --nogui --cmd "python 'import chimerax.threedecision; print(\"✅ Bundle installed successfully\")'; exit" -
Check toolshed:
/path/to/ChimeraX --nogui --cmd "toolshed list; exit" -
Interactive test:
- Start ChimeraX
- Run command:
threedecision - Or use menu: Tools → Structure Analysis → Discngine 3decision
- ChimeraX is typically installed in
/Applications/ChimeraX.app/ - The installer will request administrator privileges if needed
- Supports both Intel and Apple Silicon Macs
- ChimeraX is typically installed in
C:\Program Files\ChimeraX\ - Run Command Prompt as Administrator if you encounter permission issues
- Compatible with Windows 10 and 11
- Install build dependencies first:
# Ubuntu/Debian: sudo apt-get install python3-dev build-essential unzip # CentOS/RHEL/Fedora: sudo yum install python3-devel gcc gcc-c++ unzip
- ChimeraX may be in
/usr/local/bin/,/opt/, or~/depending on installation method - The installer supports both system-wide and user installations
Common Issues:
-
ChimeraX not found:
- Ensure ChimeraX is installed and accessible
- On Linux/Mac, add ChimeraX to your PATH or use:
export CHIMERAX_PATH=/path/to/ChimeraX - On Windows, verify the installation path
-
Permission denied:
- Run the installer as Administrator (Windows) or with sudo (Linux/Mac)
- Or install ChimeraX in a user-writable location
-
Build failures:
- On Linux, install development packages:
sudo apt-get install python3-dev build-essential - Verify ChimeraX version is 1.8 or later
- Check that Python development headers are available
- On Linux, install development packages:
-
Import errors after installation:
- Restart ChimeraX completely
- Check the ChimeraX log for specific error messages
- Verify file permissions in the installation directory
After installation, verify the plugin works:
- Start ChimeraX
- Open Python Shell: Tools → General → Shell
- Test import:
import chimerax.threedecision print("✅ Plugin installed successfully!")
If this works, proceed to the Usage section.
Method 1 - Command Registration (Recommended):
- Start ChimeraX
- Open Python Shell: Tools → General → Shell
- Copy and paste this code:
from chimerax.threedecision.commands import threedecision_cmd, threedecision_desc from chimerax.core.commands import register register('threedecision', threedecision_desc, threedecision_cmd) threedecision
Method 2 - Menu Access: Tools → Structure Analysis → Discngine 3decision
Method 3 - Direct Launch:
from chimerax.threedecision.gui import ThreeDecisionTool
tool = ThreeDecisionTool(session, 'threedecision')
tool.display(True)After registering the command (Method 1 above), you can use the threedecision command in ChimeraX:
threedecision
Opens the Discngine 3decision tool interface.
threedecision search <query>
Opens the tool interface and immediately starts a search.
Examples:
threedecision search kinase
threedecision search "protein name"
threedecision search ABL1
threedecision- Opens the tool interfacethreedecision search <terms>- Opens interface and searches for the specified terms- Search terms can include:
- Protein names (e.g., "ABL1", "kinase")
- PDB codes (e.g., "1ATP")
- Compound names
- Any searchable text in the 3decision database
Note: The command must be registered first using Method 1 above before it can be used.
- Click the Settings button (⚙️) in the plugin interface
- Enter your 3decision API credentials:
- Server URL: Your 3decision server URL (e.g.,
https://your-server.com) - API Key: Your 3decision API key
- Server URL: Your 3decision server URL (e.g.,
- Click Save to store credentials securely
- The plugin will automatically authenticate and refresh tokens as needed
- Structure Search: Enter search terms (e.g., "kinase", "ABL1")
- Real-time Progress: View search progress and job status
- Results Table: Browse search results with structure details
- Structure Loading: Select structures and load them into ChimeraX
- Project List: Automatically loads available projects when tab is selected
- Project Selection: Click on a project to view its structures
- Structure Details: View external codes, titles, methods, and resolutions
- Batch Loading: Use checkboxes to select multiple structures
- Load with Transforms: Maintains project superposition when loading
- Associated Files: Select structures and click "Select Associated Files" to view related files
- File Management: Browse associated files for selected project structures
- File Information: View file IDs, names, types, descriptions, and metadata
- File Selection: Use checkboxes to select multiple files
- File Download & Open: Click "Open" to download and automatically open files in ChimeraX
- Format Support: Automatic detection and opening of supported formats
- Multi-Structure Support: View files for multiple selected structures in one table
Files are automatically opened in ChimeraX if they match these formats:
- Structure Files:
.pdb,.mmcif,.cif - Density Maps:
.dx,.dsn6,.ccp4,.mrc - Reflection Data:
.mtz
For unsupported formats, the plugin offers to save the file to disk instead.
- Uses API key for initial authentication
- Automatically refreshes expired tokens on 401/403 responses
- Transparent to user - no manual re-authentication needed
- Secure credential storage in user config file
- Search API: Submit searches and poll for completion
- Structure Details: Fetch detailed structure information via GraphQL
- Project API: Browse projects and their structures
- Export API: Download PDB files with transformation matrices
- Associated Files API: Access related files for structures (
/structures/{code}/associated-files) - File Info API: Get file metadata (
/structures/file/{file-id}) - File Download API: Download files by ID (
/structures/file/{file-id}/download) - Batch Operations: Handle multiple structures efficiently
- Network connectivity issues
- Authentication failures with automatic retry
- API response validation
- User-friendly error messages
chimerax-plugin/
├── src/ # Core plugin source code
│ ├── __init__.py # Bundle API integration
│ ├── api_client.py # 3decision API client with token refresh
│ ├── commands.py # ChimeraX command integration
│ ├── gui.py # Qt-based user interface
│ └── settings.py # Settings dialog and configuration
├── bundle_info.xml # ChimeraX bundle metadata
├── setup.py # Plugin build configuration
├── LICENSE # MIT license
├── README.md # This file
├── .gitignore # Git ignore patterns
├── install.sh # Universal installer (Unix-like)
├── install_macos.sh # macOS-specific installer
├── install_linux.sh # Linux-specific installer
├── install_windows.bat # Windows-specific installer
├── test_file_download.py # Test script for file download functionality
└── build/ # Build artifacts (generated)
├── lib/ # Built Python modules
└── dist/ # Distribution wheels
install.sh: Universal installer for Unix-like systems (macOS/Linux)install_macos.sh: macOS-specific installer with App bundle detectioninstall_linux.sh: Linux installer with dependency checkinginstall_windows.bat: Windows installer with registry scanning
- Plugin Not Found: Run the enhanced installer and try both Method 1 and Method 2
- Authentication Errors: Verify API key and server URL in settings dialog
- Empty Project Lists: Ensure you're authenticated and have project access
- Structure Loading Fails: Check network connectivity and API server status
The plugin includes extensive debug logging. Enable it in the settings dialog to see:
- API request/response details
- Authentication status
- Structure loading progress
- Error details and stack traces
- Check the ChimeraX Python Shell for error messages
- Enable debug logging in plugin settings
- Verify API credentials and server connectivity
- Review the logs for specific error details
For development information, see:
DEVELOPMENT.md- Development setup and guidelinesIMPLEMENTATION_SUMMARY.md- Technical implementation details
This project is licensed under the MIT License - see the LICENSE file for details.