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