Files
pymol/script/pymolbond.py
2024-09-07 09:12:14 +08:00

91 lines
3.0 KiB
Python

#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@file :pymolbond.py
@Description: :
@Date :2023/09/01 16:57:02
@Author :lyzeng
@Email :pylyzeng@gmail.com
@version :1.0
'''
class Bond():
"""
This class contains static methods for identifying various types of molecular interactions.
"""
@staticmethod
def HBond(ChA, ChB):
"""Identifies hydrogen bonds between two chains."""
name = 'Hbond'
cmd.distance(name, ChA, ChB, '3.5', '2')
return name
@staticmethod
def Pi_Pi_interaction(ChA, ChB):
"""Identifies pi-pi interactions between two chains."""
name = 'PI_PI'
cmd.distance(name, ChA, ChB, '5.5', '6')
return name
@staticmethod
def Cation_Pi_interaction(ChA, ChB):
"""Identifies cation-pi interactions between two chains."""
name = 'PI_Cation'
cmd.distance(name, ChA, ChB, '5.5', '7')
return name
@staticmethod
def Salt_bridge_positive(ChA, ChB):
"""Identifies salt bridges from positive residues in one chain to negative residues in another chain."""
name = 'SBP'
selection_1 = f'{ChB} and ((resn LYS and name NZ) or (resn ARG and name NE+NH*))'
selection_2 = f'{ChA} and resn ASP+GLU and name OD*+OE*'
cmd.distance(name, selection_1, selection_2, '5.0', '0')
return name
@staticmethod
def Salt_bridge_negative(ChA, ChB):
"""Identifies salt bridges from negative residues in one chain to positive residues in another chain."""
name = 'SBN'
selection_1 = f'{ChA} and ((resn LYS and name NZ) or (resn ARG and name NE+NH*))'
selection_2 = f'{ChB} and resn ASP+GLU and name OD*+OE*'
cmd.distance(name, selection_1, selection_2, '5.0', '0')
return name
@staticmethod
def Van_der_Waals(ChA, ChB): # not tested
"""Identifies Van der Waals interactions between two chains."""
name = 'VDW'
cmd.distance(name, ChA, ChB, '0.6', '0')
return name
@staticmethod
def Hydrophobic_interaction(ChA, ChB): # not tested
"""Identifies hydrophobic interactions between two chains."""
name = 'Hydrophobic'
cmd.distance(name, ChA, ChB, '0.6', '0')
return name
@staticmethod
def Electrostatic_interaction(ChA, ChB): # not tested
"""Identifies electrostatic interactions between two chains."""
name = 'Electrostatic'
cmd.distance(name, ChA, ChB, '0.6', '0')
return name
@staticmethod
def Metal_coordination(ChA, ChB): # not tested
"""Identifies metal coordination bonds between two chains."""
name = 'MetalCoord'
cmd.distance(name, ChA, ChB, '0.2', '0')
return name
@staticmethod
def Disulfide_bond(ChA, ChB): # not tested
"""Identifies disulfide bonds between two chains."""
name = 'Disulfide'
cmd.distance(name, ChA, ChB, '0.2', '0')
return name