Skip to main content

Versatile visualization tool for protein-ligand interactions with customizable color schemes

Project description

PandaMap-Color: A versatile tool for protein-ligand interaction visualization with customizable color schemes.

PandaMap-Color Logo

Overview

PandaMap-Color is a powerful Python package for visualizing protein-ligand interactions in 2D with customizable color schemes. Generate publication-quality interaction diagrams directly from PDB files with minimal configuration.

Key Features

  • Stunning Visualizations: Create detailed, publication-ready 2D diagrams of protein-ligand interactions
  • Multiple Color Schemes: Choose from several pre-defined color schemes (Default, Colorblind-friendly, Monochrome, Dark mode, Publication-ready)
  • Customizable Appearance: Easily modify colors and styling to match your publication or presentation needs
  • Automatic Interaction Detection: Identifies hydrogen bonds, π-π stacking, hydrophobic interactions, and more
  • Intuitive Representation: Clearly shows interaction types between protein residues and ligands
  • Command Line Interface: Simple to use in scripts or from the terminal

Installation

pip install pandamap-color

Quick Start

PandaMapColor: Visualize protein-ligand interactions from PDB files with
customizable styling and coloring options.

positional arguments:
  pdb_file              Path to PDB file with protein-ligand complex

options:
  -h, --help            show this help message and exit
  --output OUTPUT, -o OUTPUT
                        Output image file path
  --ligand LIGAND, -l LIGAND
                        Specific ligand residue name to analyze
  --dpi DPI             Image resolution (default: 300 dpi)
  --title TITLE, -t TITLE
                        Custom title for the visualization
  --color-scheme {default,colorblind,monochrome,dark,publication}, -c {default,colorblind,monochrome,dark,publication}
                        Color scheme to use (default: default)
  --custom-colors CUSTOM_COLORS
                        Path to JSON file with custom color scheme
  --simple-styling      Use simple styling instead of enhanced effects
  --no-color-by-type    Disable coloring residues by amino acid type
  --jitter JITTER       Amount of positional randomization (0.0-1.0) for more
                        natural look
  --h-bond-cutoff H_BOND_CUTOFF
                        Distance cutoff for hydrogen bonds in Angstroms
  --pi-stack-cutoff PI_STACK_CUTOFF
                        Distance cutoff for pi-stacking interactions in
                        Angstroms
  --hydrophobic-cutoff HYDROPHOBIC_CUTOFF
                        Distance cutoff for hydrophobic interactions in
                        Angstroms
  --figsize FIGSIZE FIGSIZE
                        Figure size in inches (width height)

Command Line Usage

# Basic usage
pandamap-color path/to/complex.pdb -o output_image.png

# Specify ligand residue name (if multiple ligands in file)
pandamap-color path/to/complex.pdb --ligand LIG -o output_image.png

# Change color scheme
pandamap-color path/to/complex.pdb --color-scheme publication -o output_image.png
pandamap-color path/to/complex.pdb --color-scheme monochrome -o output_image.png
pandamap-color path/to/complex.pdb --color-scheme colorblind -o output_image.png
pandamap-color path/to/complex.pdb --color-scheme dark -o output_image.png

#Jitter
pandamap-color path/to/complex.pdb --jitter 0.3 --color-scheme publication -o output_image.png

# Help
pandamap-color --help

Python API Usage

from pandamap_color import PandaMapColor

# Create a mapper instance
mapper = PandaMapColor(
    pdb_file="path/to/complex.pdb",
    ligand_resname="LIG",  # Optional: specify ligand residue name
    color_scheme="default",
    use_enhanced_styling=True
)

# Detect interactions
mapper.detect_interactions()

# Identify solvent-accessible residues
mapper.estimate_solvent_accessibility()

# Generate visualization
mapper.visualize(output_file="interaction_diagram.png")

Examples

Monochrome Mode

Dark Mode Example

Dark Style

Dark Style Example

Default Style

Default Style Example

Colorblind-Friendly Style

Colorblind Style Example

Publication Mode

Dark Mode Example

No Color By Type Mode

Dark Mode Example

No Color By Type Mode

Jitter Example

Available Color Schemes

PandaMap-Color comes with multiple built-in color schemes:

  • default: Standard vibrant colors
  • colorblind: Colorblind-friendly palette
  • monochrome: Grayscale for simple publications
  • dark: Dark background for presentations
  • publication: Clean style for scientific publications

Custom Color Schemes

You can define custom color schemes using JSON:

import json
from pandamap_color import PandaMapColor

# Define a custom color scheme
custom_colors = {
    "element_colors": {
        "C": "#333333",
        "N": "#3060F0",
        "O": "#FF2010",
        # Add more elements...
    },
    "interaction_styles": {
        "hydrogen_bonds": {
            "color": "#2E8B57",
            "linestyle": "-",
            # More styling options...
        },
        # More interaction types...
    }
}

# Save to a file (optional)
with open("my_colors.json", "w") as f:
    json.dump(custom_colors, f, indent=2)

# Use with the mapper
mapper = PandaMapColor(
    pdb_file="path/to/complex.pdb",
    color_scheme=custom_colors  # Pass the dictionary directly
)

# Or load from file
mapper = PandaMapColor(
    pdb_file="path/to/complex.pdb",
    color_scheme="my_colors.json"  # Or path to JSON file
)

Documentation

For detailed documentation, see:

Package Structure

PandaMap-Color is organized into modular components:

  • pandamap.py: Main PandaMapColor class for protein-ligand interaction analysis
  • visualization.py: Visualization functionality for creating beautiful diagrams
  • ligand.py: Ligand structure representation and 2D projection
  • colorschemes.py: Pre-defined color schemes and customization utilities
  • cli.py: Command-line interface
  • utils.py: Utility functions and helper classes

Requirements

  • Python 3.7+
  • NumPy
  • Matplotlib
  • BioPython

Citing PandaMap-Color

If you use PandaMap-Color in your research, please cite:

Pritam Kumar Panda. (2025). PandaMap-Color: A versatile tool for protein-ligand interaction visualization with customizable color schemes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandamap_color-2.0.0.tar.gz (34.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandamap_color-2.0.0-py3-none-any.whl (35.0 kB view details)

Uploaded Python 3

File details

Details for the file pandamap_color-2.0.0.tar.gz.

File metadata

  • Download URL: pandamap_color-2.0.0.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pandamap_color-2.0.0.tar.gz
Algorithm Hash digest
SHA256 c1d0f95554d522649fb25d6aa40a5eefafb67e334572e8bdfd1738cb0584a014
MD5 c7a143f038768840e11fcbaf8fab573c
BLAKE2b-256 4566e025f0405feb87834cca0705e7a089fc0a3d8b2551f84d1adc71adc2e99b

See more details on using hashes here.

File details

Details for the file pandamap_color-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: pandamap_color-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 35.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pandamap_color-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea4454c66285b6ef338eb525437aa3a6d5831fd079dab27df0131222a5a35965
MD5 4253e6ec7e70287577d598bbb27d8ebe
BLAKE2b-256 c9ab36ab45b1e1b1b7f1b1f397005b2d78483543ad29593570a1aa341a56d5ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page