This directory contains comprehensive examples demonstrating how to use BondForge.
cli_examples.sh - Shell script with CLI command examples
- Basic analysis
- Specific interaction types
- Advanced energy calculations
- Batch processing
- Structure comparison
- Custom configuration
- And more!
Usage:
chmod +x cli_examples.sh
./cli_examples.sh # View all examplesexample_demo.py - Basic demonstration script
- Core analyzer (7 interaction types)
- Hub residue identification
- Result export
- Visualization
Usage:
python example_demo.py protein.pdbcomprehensive_example.py - Complete demonstration
- Core analyzer (7 types)
- Extended analyzer (20 types)
- Interface analysis
- Visualization generation
- All features demonstrated
Usage:
python comprehensive_example.py protein.pdbDownload sample PDB files:
# Small protein for testing
wget https://files.rcsb.org/download/1ABC.pdb
# Or use any of your own PDB files# Basic analysis
bondforge analyze 1ABC.pdb
# With advanced features
bondforge analyze 1ABC.pdb --energy --parallel# Simple demo
python example_demo.py 1ABC.pdb
# Comprehensive demo
python comprehensive_example.py 1ABC.pdbcli_examples.sh- Example 1: Basic analysisexample_demo.py- Simple workflow
cli_examples.sh- Example 3: Energy calculationscomprehensive_example.py- All 20 interaction types
cli_examples.sh- Example 4: Batch processing- Multiple structure analysis
cli_examples.sh- Example 6: Custom config- YAML configuration examples
cli_examples.sh- Example 5: Structure comparison- Wild-type vs mutant
All examples generate results in organized directories:
results/
├── interactions.csv # All detected interactions
├── hubs.csv # Hub residues
├── critical_interactions.csv # Critical interactions
├── interaction_network.png # Network visualization
└── visualize.pml # PyMOL script
from bondforge import ExtendedProteinInteractionAnalyzer
# Load and analyze
analyzer = ExtendedProteinInteractionAnalyzer('protein.pdb')
results = analyzer.analyze_all_interactions()
# Print summary
print(f"Total interactions: {results['total_interactions']}")
# Export
analyzer.export_to_csv('results/')from bondforge import ExtendedProteinInteractionAnalyzer
from bondforge.energy_calculator import AdvancedEnergyCalculator
# Analyze
analyzer = ExtendedProteinInteractionAnalyzer('protein.pdb')
h_bonds = analyzer.find_hydrogen_bonds()
# Calculate energies
calc = AdvancedEnergyCalculator()
for bond in h_bonds:
energy = calc.calculate_hydrogen_bond_energy(
donor_atom=bond['donor_type'],
acceptor_atom=bond['acceptor_type'],
distance=bond['distance'],
angle=bond['angle']
)
print(f"Energy: {energy.total:.2f} kcal/mol")from bondforge.statistical_validator import StatisticalValidator
validator = StatisticalValidator()
# Validate interaction
result = validator.calculate_zscore(
'hydrogen_bond',
observed_distance=2.9,
observed_angle=165
)
print(f"Z-score: {result['z_score_distance']:.2f}")
print(f"Typical: {result['is_typical']}")
print(f"Confidence: {result['confidence']}")analyzer = ExtendedProteinInteractionAnalyzer('protein.pdb')
# Custom hydrogen bond cutoff
h_bonds = analyzer.find_hydrogen_bonds(distance_cutoff=3.2)
# Custom salt bridge cutoff
salt_bridges = analyzer.find_salt_bridges(distance_cutoff=3.8)# my_config.yaml
analysis:
distance_cutoffs:
hydrogen_bond: 3.2
salt_bridge: 3.8
energy_calculation:
method: advanced
force_field: amberThen use:
bondforge analyze protein.pdb --config my_config.yamlAnalyze protein-ligand interactions for drug design
Compare wild-type vs mutant to guide mutations
Identify critical interactions for stability
Study protein-protein binding interfaces
Validate structure quality and completeness
Beginners:
- Start with
cli_examples.shExample 1 - Try
example_demo.py - Explore basic CLI commands
Intermediate:
- Run
comprehensive_example.py - Try custom configurations
- Experiment with different interaction types
Advanced:
- Use advanced energy calculations
- Implement statistical validation
- Create custom analysis workflows
- Batch process multiple structures
PDB file not found:
# Download test structures
wget https://files.rcsb.org/download/1ABC.pdbModule not found:
# Install BondForge
pip install -e .CLI command not found:
# Reinstall with entry points
pip install -e .- 📚 Documentation: See
docs/directory - 💬 Discussions: GitHub Discussions
- 🐛 Issues: GitHub Issues
- 📧 Email: ayehbolouki1988@gmail.com
Have a cool use case? Share it!
- Create your example script
- Add documentation
- Submit a pull request
See CONTRIBUTING.md for guidelines.
Happy Forging! 🔥
These examples help you get started quickly with BondForge