proteusPy
proteusPy
is a Python package specializing in the modeling and analysis
of proteins of known structure with an emphasis on disulfide bonds. This package
reprises the molecular modeling program Proteus,
a structure-based program developed as part of Eric Suchanek's graduate thesis,
which was originally written in Common Lisp, ported to C++ and ultimately to Python.
The package utilizes several base classes to create and analyze disulfide bonds:
- Turtle3D: to build disulfides through the manipulation of local coordinate systems.
- DisulfideBase: basic characteristics of individual disulfide bonds, classes
Disulfide
andDisulfideList
- DisulfideClassManager: to manage
Disulfide
classes - DisulfideClassGenerator: to generate
Disulfide
structure ensembles from disulfide classes - DisulfideStats: to calculate statistics on disulfide bonds
- DisulfideVisualization: to visualize disulfide bonds
- DisulfideLoader: to load disulfide bonds from the master list of Disulfides and create the various data structures needed to build the structural classes and physical properties of the disulfide bonds.
This implementation of proteusPy
focuses on the Disulfide
class. This class
implements methods to analyze the protein structure stabilizing element known as a
Disulfide bond. Its underlying methods have been utilized to construct a database of over 36,000
high-quality disulfide bonds from the RCSB protein data bank (https://www.rcsb.org) for structural analysis.
1# Initialization for the proteusPy package 2# Copyright (c) 2025 Eric G. Suchanek, PhD., all rights reserved 3# Subject to the BSD public license. 4# Last updated: 2025-03-27 19:48:55 -egs- 5 6# pylint: disable=C0413 7# pylint: disable=C0103 8 9""" 10``proteusPy`` is a Python package specializing in the modeling and analysis 11of proteins of known structure with an emphasis on disulfide bonds. This package 12reprises the molecular modeling program [Proteus](https://doi.org/10.1021/bi00368a023), 13a structure-based program developed as part of Eric Suchanek's graduate thesis, 14which was originally written in Common Lisp, ported to C++ and ultimately to Python. 15 16The package utilizes several base classes to create and analyze disulfide bonds: 17- Turtle3D: to build disulfides through the manipulation of local coordinate systems. 18- DisulfideBase: basic characteristics of individual disulfide bonds, classes ``Disulfide`` and ``DisulfideList`` 19- DisulfideClassManager: to manage ``Disulfide`` classes 20- DisulfideClassGenerator: to generate ``Disulfide`` structure ensembles from disulfide classes 21- DisulfideStats: to calculate statistics on disulfide bonds 22- DisulfideVisualization: to visualize disulfide bonds 23- DisulfideLoader: to load disulfide bonds from the master list of Disulfides and create the 24 various data structures needed to build the structural classes and physical properties of 25 the disulfide bonds. 26 27 28This implementation of ``proteusPy`` focuses on the ``Disulfide`` class. This class 29implements methods to analyze the protein structure stabilizing element known as a 30*Disulfide bond*. Its underlying methods have been utilized to construct a database of over 36,000 31high-quality disulfide bonds from the RCSB protein data bank (https://www.rcsb.org) for structural analysis. 32""" 33 34__pdoc__ = { 35 "version": None, 36 "__all__": False, 37 "_version": False, 38} 39 40import logging 41 42# Set the default (global) logger level to CRITICAL 43logging.basicConfig(level=logging.CRITICAL) 44 45# Suppress findfont debug messages 46logging.getLogger("matplotlib.font_manager").setLevel(logging.ERROR) 47 48# Create a logger for the package itself. __name__ is the package name, proteusPy 49_logger = logging.getLogger(__name__) 50 51from ._version import __version__ 52from .angle_annotation import AngleAnnotation, plot_angle 53from .atoms import ( 54 ATOM_COLORS, 55 ATOM_RADII_COVALENT, 56 ATOM_RADII_CPK, 57 BOND_COLOR, 58 BOND_RADIUS, 59 BS_SCALE, 60 CAMERA_SCALE, 61 SPEC_POWER, 62 SPECULARITY, 63) 64from .DisulfideBase import Disulfide, DisulfideList 65from .DisulfideClasses import ( 66 angle_within_range, 67 filter_by_percentage, 68 get_quadrant, 69 is_between, 70) 71from .DisulfideClassGenerator import DisulfideClassGenerator 72from .DisulfideClassManager import DisulfideClassManager 73from .DisulfideExceptions import ( 74 DisulfideConstructionException, 75 DisulfideConstructionWarning, 76 DisulfideException, 77 DisulfideIOException, 78 DisulfideParseWarning, 79) 80from .DisulfideIO import ( 81 Initialize_Disulfide_From_Coords, 82 extract_disulfide, 83 load_disulfides_from_id, 84) 85from .DisulfideLoader import Bootstrap_PDB_SS, DisulfideLoader, Load_PDB_SS 86from .DisulfideStats import DisulfideStats 87from .DisulfideVisualization import DisulfideVisualization 88from .logger_config import ( 89 DEFAULT_LOG_LEVEL, 90 configure_master_logger, 91 create_logger, 92 disable_stream_handlers_for_namespace, 93 list_all_loggers, 94 list_handlers, 95 set_logger_level, 96 set_logger_level_for_module, 97 set_logging_level_for_all_handlers, 98 toggle_stream_handler, 99) 100from .Plotting import plot_class_chart 101from .ProteusGlobals import ( 102 _ANG_INIT, 103 _FLOAT_INIT, 104 _INT_INIT, 105 BINARY_CLASS_METRICS_CSV_FILE, 106 BINARY_CLASS_METRICS_FILE, 107 CA_CUTOFF, 108 CAMERA_POS, 109 FONTSIZE, 110 LOADER_ALL_MASTER_URL, 111 LOADER_FNAME, 112 LOADER_FNAME_URL, 113 LOADER_SUBSET_FNAME, 114 LOADER_SUBSET_FNAME_URL, 115 LOADER_SUBSET_MASTER_URL, 116 MODEL_DIR, 117 OCTANT_CLASS_METRICS_CSV_FILE, 118 OCTANT_CLASS_METRICS_FILE, 119 PDB_DIR, 120 PROBLEM_ID_FILE, 121 SG_CUTOFF, 122 SS_CLASS_DEFINITIONS, 123 SS_CLASS_DICT_FILE, 124 SS_CONSENSUS_BIN_FILE, 125 SS_CONSENSUS_OCT_FILE, 126 SS_ID_FILE, 127 SS_LIST_URL, 128 SS_MASTER_PICKLE_FILE, 129 SS_PICKLE_FILE, 130 SS_PROBLEM_SUBSET_ID_FILE, 131 SS_SUBSET_PICKLE_FILE, 132 WINFRAME, 133 WINSIZE, 134) 135from .ProteusPyWarning import ProteusPyWarning 136from .Residue import ( 137 build_residue, 138 get_backbone_from_chain, 139 to_alpha, 140 to_carbonyl, 141 to_nitrogen, 142 to_oxygen, 143) 144from .ssparser import ( 145 check_file, 146 extract_and_write_ssbonds_and_atoms, 147 extract_ssbonds_and_atoms, 148 get_atom_coordinates, 149 get_phipsi_atoms_coordinates, 150 get_residue_atoms_coordinates, 151 print_disulfide_bond_info_dict, 152) 153from .turtle3D import ORIENT_BACKBONE, ORIENT_SIDECHAIN, Turtle3D 154from .utility import ( 155 Download_Disulfides, 156 Extract_Disulfides, 157 Extract_Disulfides_From_List, 158 display_ss_pymol, 159 distance_squared, 160 extract_firstchain_ss, 161 generate_vector_dataframe, 162 get_jet_colormap, 163 get_memory_usage, 164 get_object_size_mb, 165 get_theme, 166 grid_dimensions, 167 image_to_ascii_art, 168 load_list_from_file, 169 print_memory_used, 170 prune_extra_ss, 171 remove_duplicate_ss, 172 retrieve_git_lfs_files, 173 save_list_to_file, 174 set_plotly_theme, 175 set_pyvista_theme, 176 sort_by_column, 177) 178from .vector3D import ( 179 Vector3D, 180 calc_angle, 181 calc_dihedral, 182 calculate_bond_angle, 183 distance3d, 184 rms_difference, 185) 186 187set_plotly_theme(theme="auto") 188set_pyvista_theme(theme="auto") 189 190 191def describe(): 192 """ 193 Describe the proteusPy package. 194 """ 195 set_logger_level_for_module("proteusPy", logging.INFO) 196 _logger.info("ProteusPy %s initialized.", __version__) 197 _logger.info("Plotly theme set to: %s", set_plotly_theme(theme="auto")) 198 _logger.info("PyVista theme set to: %s", set_pyvista_theme(theme="auto")) 199 _logger.info("Logging level setting to default: %s", DEFAULT_LOG_LEVEL) 200 _logger.setLevel(DEFAULT_LOG_LEVEL) 201 return 202 203 204# end of file
192def describe(): 193 """ 194 Describe the proteusPy package. 195 """ 196 set_logger_level_for_module("proteusPy", logging.INFO) 197 _logger.info("ProteusPy %s initialized.", __version__) 198 _logger.info("Plotly theme set to: %s", set_plotly_theme(theme="auto")) 199 _logger.info("PyVista theme set to: %s", set_pyvista_theme(theme="auto")) 200 _logger.info("Logging level setting to default: %s", DEFAULT_LOG_LEVEL) 201 _logger.setLevel(DEFAULT_LOG_LEVEL) 202 return
Describe the proteusPy package.