py-packman 1.4.0__zip

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. Program Files/Python39/Lib/site-packages/packman/__init__.py +18 -0
  2. Program Files/Python39/Lib/site-packages/packman/__main__.py +4 -0
  3. Program Files/Python39/Lib/site-packages/packman/__pycache__/__init__.cpython-39.pyc +0 -0
  4. Program Files/Python39/Lib/site-packages/packman/__pycache__/__main__.cpython-39.pyc +0 -0
  5. Program Files/Python39/Lib/site-packages/packman/anm/__init__.py +25 -0
  6. Program Files/Python39/Lib/site-packages/packman/anm/__pycache__/__init__.cpython-39.pyc +0 -0
  7. Program Files/Python39/Lib/site-packages/packman/anm/__pycache__/anm.cpython-39.pyc +0 -0
  8. Program Files/Python39/Lib/site-packages/packman/anm/__pycache__/hd_anm.cpython-39.pyc +0 -0
  9. Program Files/Python39/Lib/site-packages/packman/anm/anm.py +317 -0
  10. Program Files/Python39/Lib/site-packages/packman/anm/hd_anm.py +656 -0
  11. Program Files/Python39/Lib/site-packages/packman/apps/__init__.py +25 -0
  12. Program Files/Python39/Lib/site-packages/packman/apps/__pycache__/__init__.cpython-39.pyc +0 -0
  13. Program Files/Python39/Lib/site-packages/packman/apps/__pycache__/calculate_entropy.cpython-39.pyc +0 -0
  14. Program Files/Python39/Lib/site-packages/packman/apps/__pycache__/dci.cpython-39.pyc +0 -0
  15. Program Files/Python39/Lib/site-packages/packman/apps/__pycache__/hdanm.cpython-39.pyc +0 -0
  16. Program Files/Python39/Lib/site-packages/packman/apps/__pycache__/predict_hinge.cpython-39.pyc +0 -0
  17. Program Files/Python39/Lib/site-packages/packman/apps/calculate_entropy.py +60 -0
  18. Program Files/Python39/Lib/site-packages/packman/apps/dci.py +323 -0
  19. Program Files/Python39/Lib/site-packages/packman/apps/hdanm.py +47 -0
  20. Program Files/Python39/Lib/site-packages/packman/apps/predict_hinge.py +375 -0
  21. Program Files/Python39/Lib/site-packages/packman/bin/GUI.py +709 -0
  22. Program Files/Python39/Lib/site-packages/packman/bin/PACKMAN.py +154 -0
  23. Program Files/Python39/Lib/site-packages/packman/bin/__init__.py +27 -0
  24. Program Files/Python39/Lib/site-packages/packman/bin/__pycache__/GUI.cpython-39.pyc +0 -0
  25. Program Files/Python39/Lib/site-packages/packman/bin/__pycache__/PACKMAN.cpython-39.pyc +0 -0
  26. Program Files/Python39/Lib/site-packages/packman/bin/__pycache__/__init__.cpython-39.pyc +0 -0
  27. Program Files/Python39/Lib/site-packages/packman/bin/logo.ico +0 -0
  28. Program Files/Python39/Lib/site-packages/packman/constants/Constants.py +236 -0
  29. Program Files/Python39/Lib/site-packages/packman/constants/__init__.py +3 -0
  30. Program Files/Python39/Lib/site-packages/packman/constants/__pycache__/Constants.cpython-39.pyc +0 -0
  31. Program Files/Python39/Lib/site-packages/packman/constants/__pycache__/__init__.cpython-39.pyc +0 -0
  32. Program Files/Python39/Lib/site-packages/packman/entropy/__init__.py +12 -0
  33. Program Files/Python39/Lib/site-packages/packman/entropy/__pycache__/__init__.cpython-39.pyc +0 -0
  34. Program Files/Python39/Lib/site-packages/packman/entropy/__pycache__/entropy.cpython-39.pyc +0 -0
  35. Program Files/Python39/Lib/site-packages/packman/entropy/entropy.py +155 -0
  36. Program Files/Python39/Lib/site-packages/packman/geometry/__init__.py +17 -0
  37. Program Files/Python39/Lib/site-packages/packman/geometry/__pycache__/__init__.cpython-39.pyc +0 -0
  38. Program Files/Python39/Lib/site-packages/packman/geometry/__pycache__/geometry.cpython-39.pyc +0 -0
  39. Program Files/Python39/Lib/site-packages/packman/geometry/geometry.py +112 -0
  40. Program Files/Python39/Lib/site-packages/packman/molecule/__init__.py +45 -0
  41. Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/__init__.cpython-39.pyc +0 -0
  42. Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/annotations.cpython-39.pyc +0 -0
  43. Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/atom.cpython-39.pyc +0 -0
  44. Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/bond.cpython-39.pyc +0 -0
  45. Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/chain.cpython-39.pyc +0 -0
  46. Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/hetmol.cpython-39.pyc +0 -0
  47. Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/model.cpython-39.pyc +0 -0
  48. Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/molecule.cpython-39.pyc +0 -0
  49. Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/protein.cpython-39.pyc +0 -0
  50. Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/residue.cpython-39.pyc +0 -0
  51. Program Files/Python39/Lib/site-packages/packman/molecule/annotations.py +92 -0
  52. Program Files/Python39/Lib/site-packages/packman/molecule/atom.py +332 -0
  53. Program Files/Python39/Lib/site-packages/packman/molecule/bond.py +186 -0
  54. Program Files/Python39/Lib/site-packages/packman/molecule/chain.py +323 -0
  55. Program Files/Python39/Lib/site-packages/packman/molecule/hetmol.py +224 -0
  56. Program Files/Python39/Lib/site-packages/packman/molecule/model.py +703 -0
  57. Program Files/Python39/Lib/site-packages/packman/molecule/molecule.py +470 -0
  58. Program Files/Python39/Lib/site-packages/packman/molecule/protein.py +162 -0
  59. Program Files/Python39/Lib/site-packages/packman/molecule/residue.py +322 -0
  60. Program Files/Python39/Lib/site-packages/packman/tests/__init__.py +4 -0
  61. Program Files/Python39/Lib/site-packages/packman/tests/__pycache__/__init__.cpython-39.pyc +0 -0
  62. Program Files/Python39/Lib/site-packages/packman/tests/anm/__init__.py +0 -0
  63. Program Files/Python39/Lib/site-packages/packman/tests/anm/__pycache__/__init__.cpython-39.pyc +0 -0
  64. Program Files/Python39/Lib/site-packages/packman/tests/anm/__pycache__/test_anm.cpython-39.pyc +0 -0
  65. Program Files/Python39/Lib/site-packages/packman/tests/anm/test_anm.py +52 -0
  66. Program Files/Python39/Lib/site-packages/packman/tests/data/1prw.hng +3 -0
  67. Program Files/Python39/Lib/site-packages/packman/tests/data/1prw.pdb +1871 -0
  68. Program Files/Python39/Lib/site-packages/packman/tests/data/4hla.cif +5058 -0
  69. Program Files/Python39/Lib/site-packages/packman/tests/data/__init__.py +0 -0
  70. Program Files/Python39/Lib/site-packages/packman/tests/data/__pycache__/__init__.cpython-39.pyc +0 -0
  71. Program Files/Python39/Lib/site-packages/packman/tests/entropy/__init__.py +0 -0
  72. Program Files/Python39/Lib/site-packages/packman/tests/entropy/__pycache__/__init__.cpython-39.pyc +0 -0
  73. Program Files/Python39/Lib/site-packages/packman/tests/entropy/__pycache__/test_entropy.cpython-39.pyc +0 -0
  74. Program Files/Python39/Lib/site-packages/packman/tests/entropy/test_entropy.py +30 -0
  75. Program Files/Python39/Lib/site-packages/packman/tests/molecule/__init__.py +0 -0
  76. Program Files/Python39/Lib/site-packages/packman/tests/molecule/__pycache__/__init__.cpython-39.pyc +0 -0
  77. Program Files/Python39/Lib/site-packages/packman/tests/molecule/__pycache__/test_molecule.cpython-39.pyc +0 -0
  78. Program Files/Python39/Lib/site-packages/packman/tests/molecule/test_molecule.py +95 -0
  79. Program Files/Python39/Lib/site-packages/packman/utilities/__init__.py +1 -0
  80. Program Files/Python39/Lib/site-packages/packman/utilities/__pycache__/__init__.cpython-39.pyc +0 -0
  81. Program Files/Python39/Lib/site-packages/packman/utilities/__pycache__/utilities.cpython-39.pyc +0 -0
  82. Program Files/Python39/Lib/site-packages/packman/utilities/utilities.py +180 -0
  83. Program Files/Python39/Lib/site-packages/py_packman-1.4.0-py3.9.egg-info/PKG-INFO +86 -0
  84. Program Files/Python39/Lib/site-packages/py_packman-1.4.0-py3.9.egg-info/SOURCES.txt +51 -0
  85. Program Files/Python39/Lib/site-packages/py_packman-1.4.0-py3.9.egg-info/dependency_links.txt +1 -0
  86. Program Files/Python39/Lib/site-packages/py_packman-1.4.0-py3.9.egg-info/entry_points.txt +3 -0
  87. Program Files/Python39/Lib/site-packages/py_packman-1.4.0-py3.9.egg-info/requires.txt +5 -0
  88. Program Files/Python39/Lib/site-packages/py_packman-1.4.0-py3.9.egg-info/top_level.txt +1 -0
  89. Program Files/Python39/Scripts/packman-script.py +33 -0
  90. Program Files/Python39/Scripts/packman.exe +0 -0
@@ -0,0 +1,224 @@
1
+ # -*- coding: utf-8 -*-
2
+ """The 'HetMol' object host file.
3
+
4
+ This is file information, not the class information. This information is only for the API developers.
5
+ Please read the 'HetMol' object documentation for details.
6
+
7
+ Citation:
8
+ Pranav M Khade, Robert L Jernigan, PACKMAN-Molecule: Python Toolbox for Structural Bioinformatics, Bioinformatics Advances, 2022;, vbac007, https://doi.org/10.1093/bioadv/vbac007
9
+
10
+ Example::
11
+
12
+ from packman.molecule import HetMol
13
+ help( HetMol )
14
+
15
+ Todo:
16
+ * Finish writing up the documentation.
17
+ * Finish error handling.
18
+ * Finish optimizing the performance.
19
+
20
+ Authors:
21
+ * Pranav Khade(https://github.com/Pranavkhade)
22
+ """
23
+
24
+ import numpy
25
+
26
+ import logging
27
+
28
+ class HetMol():
29
+ """This class contains the information about the 'HetMol' object (packman.molecule.Residue).
30
+
31
+ This class contains all the information available about the HetMol and stores the corresponding 'Atom' objects in itself. The Residue class is the second lowest in the hierarchy of the 'molecule' API classes.
32
+ the order of hierarchy being: Protein> Model> Chain> HetMol> Atom. This class is also the component of the 'molecule' module API.
33
+ Please read the Tutorials and Documentation for more details.
34
+
35
+ Note:
36
+ - Please refer to the [https://web.archive.org/web/20080905024351/http://www.wwpdb.org/docs.html] for the description of the arguments.
37
+
38
+ Args:
39
+ id (int): Residue ID from the PDB file as it is. Each Residue in a PDB file Model/Frame has unique ID. (essential)
40
+ name (str): Residue Name from the PDB file as it is.
41
+ parent (packman.molecule.Chain): The Chain Object (parent) this Residue belongs to.
42
+
43
+ """
44
+ def __init__(self,id,name,parent):
45
+ self.__id=id
46
+ self.__name=name
47
+ self.__parent=parent
48
+ self.__Atoms=None
49
+ self.__domain_id=None
50
+ self.__Atoms_Names = {}
51
+
52
+ #Properties are the entities that are not included in the PDB files and are obtained by calculations
53
+ self.__properties = {}
54
+
55
+ def __setitem__(self,id,Atom):
56
+ """Simply assign new atom to the 'HetMol'
57
+
58
+ Args:
59
+ new_id (int) : The ID User wishes to assign to the given 'Atom'
60
+ Atom (packman.molecule.Atom) : The new 'Atom' to be assigned to the 'HetMol'
61
+ """
62
+ try:
63
+ self.__Atoms[id]=Atom
64
+ except:
65
+ self.__Atoms={}
66
+ self.__Atoms[id]=Atom
67
+ self.__Atoms_Names[Atom.get_name()] = Atom
68
+
69
+ #Get Functions
70
+ def get_id(self):
71
+ """Get the ID of the 'HetMol'
72
+
73
+ Returns:
74
+ int if successful, None otherwise.
75
+ """
76
+ return self.__id
77
+
78
+ def get_name(self):
79
+ """Get the Name of the 'HetMol'
80
+
81
+ Returns:
82
+ str if successful, None otherwise.
83
+ """
84
+ return self.__name
85
+
86
+ def get_parent(self):
87
+ """Get the Parent of the 'HetMol'
88
+
89
+ Returns:
90
+ packman.molecule.Chain if successful, None otherwise.
91
+ """
92
+ return self.__parent
93
+
94
+ def get_atoms(self):
95
+ """Get the generator of corresponding 'Atom' objects of the 'HetMol'
96
+
97
+ Returns:
98
+ generator of 'Atom' objects if successful, None otherwise.
99
+ """
100
+ for i in sorted(self.__Atoms.keys()):yield self.__Atoms[i]
101
+
102
+ def get_domain_id(self):
103
+ """Get the Domain Identifier of the given 'HetMol'. Hinge Prediction is Necessary for this option.
104
+
105
+ Note:
106
+ Domain Identifiers (Obtained after running PACKMAN):
107
+ 'FL': Flexible Linkers (Hinges); Followed by the domain number
108
+ 'DM': Domain; Followed by the domain number
109
+
110
+ Returns:
111
+ str if successful, None otherwise.
112
+ """
113
+ return self.__domain_id
114
+
115
+ def get_property(self,property_name):
116
+ """Get the Property of the given 'HetMol'.
117
+
118
+ Property is any key and value combination that can be assigned to this object. This (along with the set_property) feature is mainly useful for the user customization.
119
+ Properties are like pinboards. You can pin anything to the object with a key as a pin.
120
+
121
+ Args:
122
+ property_name (object): The 'Key' or a name the user wants to assign to to the property
123
+
124
+ Note:
125
+ - Users can add custom annotations; for example: If particular chain becomes disordered, it can be annotated with this feature.
126
+ """
127
+ try:
128
+ return self.__properties[property_name]
129
+ except:
130
+ logging.warning('The Property Name provided is not assigned.')
131
+
132
+ #Set Functions
133
+ def set_id(self,new_id):
134
+ """Set the ID of the given 'HetMol'
135
+
136
+ Args:
137
+ new_id (int): The ID User wishes to assign to the given 'HetMol'
138
+ """
139
+ self.__id=new_id
140
+
141
+ def set_name(self,new_name):
142
+ """Set the Name of the given 'HetMol'
143
+
144
+ Args:
145
+ new_name (str): The Name User wishes to assign to the given 'HetMol'
146
+ """
147
+ self.__name=new_name
148
+
149
+ def set_parent(self,new_parent):
150
+ """Set the Parent of the given 'HetMol'
151
+
152
+ Args:
153
+ new_parent (packman.molecule.Chain): The parent 'Chain' User wishes to assign to the given 'HetMol'
154
+ """
155
+ self.__parent=new_parent
156
+
157
+ def get_atom(self,key):
158
+ """Get the specific Atom by id/name. Please note that this is different than get_atoms()
159
+
160
+ Args:
161
+ key (int/str): Get atom by the id/name
162
+
163
+ Returns:
164
+ atom (:py:class:`packman.molecule.Atom`): Atom of the given ID if successful; None otherwise.
165
+ """
166
+ try:
167
+ return self.__Atoms[key]
168
+ except KeyError:
169
+ try:
170
+ return self.__Atoms_Names[key]
171
+ except:
172
+ return None
173
+
174
+ def set_domain_id(self,new_domain_id):
175
+ """Set the Domain Identifier of the given 'HetMol'.
176
+
177
+ Note:
178
+ Domain Identifiers Format:
179
+ 'FL': Flexible Linkers (Hinges); Followed by the domain number
180
+ 'DM': Domain; Followed by the domain number
181
+
182
+ Args:
183
+ new_domain_id (str): The Domain Identifies User wishes to assign to the given 'HetMol'
184
+ """
185
+ self.__domain_id=new_domain_id
186
+
187
+ def set_property(self,property_name,value):
188
+ """Set the Property of the given 'HetMol'.
189
+
190
+ Property is any key and value combination that can be assigned to this object. This (along with the get_property) feature is mainly useful for the user customization.
191
+ Properties are like pinboards. You can pin anything to the object with a key as a pin.
192
+
193
+ Args:
194
+ property_name (object): The 'Key' or a name the user wants to assign to to the property
195
+ value (object): The value the user wants to assign to the property
196
+
197
+ Note:
198
+ - Users can add custom annotations; for example: If particular amino acid becomes disordered, it can be annotated with this feature.
199
+ """
200
+ try:
201
+ self.__properties[property_name] = value
202
+ except:
203
+ logging.warning('Please check the property name. Check the allowed Python dictionary key types for more details.')
204
+
205
+ #Calculation Functions
206
+ def get_centerofgravity(self):
207
+ """Get the center of gravity of the given 'HetMol'
208
+
209
+ Note:
210
+ Yet to add the atomic masses.
211
+
212
+ Returns:
213
+ Cartesian Coordinates as numpy.array of the centre of the gravity.
214
+ """
215
+ atoms=self.get_atoms()
216
+ AtomicMass=1
217
+ XYZ_M=[0,0,0]
218
+ MassofAA=0
219
+ for i in atoms:
220
+ XYZ_M[0]+=i.Coordinates[0]*AtomicMass
221
+ XYZ_M[1]+=i.Coordinates[1]*AtomicMass
222
+ XYZ_M[2]+=i.Coordinates[2]*AtomicMass
223
+ MassofAA=MassofAA+AtomicMass
224
+ return numpy.array([i/MassofAA for i in XYZ_M])