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.
- Program Files/Python39/Lib/site-packages/packman/__init__.py +18 -0
- Program Files/Python39/Lib/site-packages/packman/__main__.py +4 -0
- Program Files/Python39/Lib/site-packages/packman/__pycache__/__init__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/__pycache__/__main__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/anm/__init__.py +25 -0
- Program Files/Python39/Lib/site-packages/packman/anm/__pycache__/__init__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/anm/__pycache__/anm.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/anm/__pycache__/hd_anm.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/anm/anm.py +317 -0
- Program Files/Python39/Lib/site-packages/packman/anm/hd_anm.py +656 -0
- Program Files/Python39/Lib/site-packages/packman/apps/__init__.py +25 -0
- Program Files/Python39/Lib/site-packages/packman/apps/__pycache__/__init__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/apps/__pycache__/calculate_entropy.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/apps/__pycache__/dci.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/apps/__pycache__/hdanm.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/apps/__pycache__/predict_hinge.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/apps/calculate_entropy.py +60 -0
- Program Files/Python39/Lib/site-packages/packman/apps/dci.py +323 -0
- Program Files/Python39/Lib/site-packages/packman/apps/hdanm.py +47 -0
- Program Files/Python39/Lib/site-packages/packman/apps/predict_hinge.py +375 -0
- Program Files/Python39/Lib/site-packages/packman/bin/GUI.py +709 -0
- Program Files/Python39/Lib/site-packages/packman/bin/PACKMAN.py +154 -0
- Program Files/Python39/Lib/site-packages/packman/bin/__init__.py +27 -0
- Program Files/Python39/Lib/site-packages/packman/bin/__pycache__/GUI.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/bin/__pycache__/PACKMAN.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/bin/__pycache__/__init__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/bin/logo.ico +0 -0
- Program Files/Python39/Lib/site-packages/packman/constants/Constants.py +236 -0
- Program Files/Python39/Lib/site-packages/packman/constants/__init__.py +3 -0
- Program Files/Python39/Lib/site-packages/packman/constants/__pycache__/Constants.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/constants/__pycache__/__init__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/entropy/__init__.py +12 -0
- Program Files/Python39/Lib/site-packages/packman/entropy/__pycache__/__init__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/entropy/__pycache__/entropy.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/entropy/entropy.py +155 -0
- Program Files/Python39/Lib/site-packages/packman/geometry/__init__.py +17 -0
- Program Files/Python39/Lib/site-packages/packman/geometry/__pycache__/__init__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/geometry/__pycache__/geometry.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/geometry/geometry.py +112 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/__init__.py +45 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/__init__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/annotations.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/atom.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/bond.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/chain.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/hetmol.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/model.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/molecule.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/protein.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/__pycache__/residue.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/annotations.py +92 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/atom.py +332 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/bond.py +186 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/chain.py +323 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/hetmol.py +224 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/model.py +703 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/molecule.py +470 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/protein.py +162 -0
- Program Files/Python39/Lib/site-packages/packman/molecule/residue.py +322 -0
- Program Files/Python39/Lib/site-packages/packman/tests/__init__.py +4 -0
- Program Files/Python39/Lib/site-packages/packman/tests/__pycache__/__init__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/tests/anm/__init__.py +0 -0
- Program Files/Python39/Lib/site-packages/packman/tests/anm/__pycache__/__init__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/tests/anm/__pycache__/test_anm.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/tests/anm/test_anm.py +52 -0
- Program Files/Python39/Lib/site-packages/packman/tests/data/1prw.hng +3 -0
- Program Files/Python39/Lib/site-packages/packman/tests/data/1prw.pdb +1871 -0
- Program Files/Python39/Lib/site-packages/packman/tests/data/4hla.cif +5058 -0
- Program Files/Python39/Lib/site-packages/packman/tests/data/__init__.py +0 -0
- Program Files/Python39/Lib/site-packages/packman/tests/data/__pycache__/__init__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/tests/entropy/__init__.py +0 -0
- Program Files/Python39/Lib/site-packages/packman/tests/entropy/__pycache__/__init__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/tests/entropy/__pycache__/test_entropy.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/tests/entropy/test_entropy.py +30 -0
- Program Files/Python39/Lib/site-packages/packman/tests/molecule/__init__.py +0 -0
- Program Files/Python39/Lib/site-packages/packman/tests/molecule/__pycache__/__init__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/tests/molecule/__pycache__/test_molecule.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/tests/molecule/test_molecule.py +95 -0
- Program Files/Python39/Lib/site-packages/packman/utilities/__init__.py +1 -0
- Program Files/Python39/Lib/site-packages/packman/utilities/__pycache__/__init__.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/utilities/__pycache__/utilities.cpython-39.pyc +0 -0
- Program Files/Python39/Lib/site-packages/packman/utilities/utilities.py +180 -0
- Program Files/Python39/Lib/site-packages/py_packman-1.4.0-py3.9.egg-info/PKG-INFO +86 -0
- Program Files/Python39/Lib/site-packages/py_packman-1.4.0-py3.9.egg-info/SOURCES.txt +51 -0
- Program Files/Python39/Lib/site-packages/py_packman-1.4.0-py3.9.egg-info/dependency_links.txt +1 -0
- Program Files/Python39/Lib/site-packages/py_packman-1.4.0-py3.9.egg-info/entry_points.txt +3 -0
- Program Files/Python39/Lib/site-packages/py_packman-1.4.0-py3.9.egg-info/requires.txt +5 -0
- Program Files/Python39/Lib/site-packages/py_packman-1.4.0-py3.9.egg-info/top_level.txt +1 -0
- Program Files/Python39/Scripts/packman-script.py +33 -0
- Program Files/Python39/Scripts/packman.exe +0 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""The 'Residue' 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 'Residue' 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 Residue
|
|
13
|
+
help( Residue )
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Todo:
|
|
17
|
+
* Finish writing up the documentation.
|
|
18
|
+
* Finish error handling.
|
|
19
|
+
* Finish optimizing the performance.
|
|
20
|
+
|
|
21
|
+
Authors:
|
|
22
|
+
* Pranav Khade(https://github.com/Pranavkhade)
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
import numpy
|
|
26
|
+
import logging
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class Residue():
|
|
30
|
+
"""This class contains the information about the 'Residue' object (packman.molecule.Residue).
|
|
31
|
+
|
|
32
|
+
This class contains all the information available about the Residue and stores the corresponding 'Atom' objects in itself. The Residue class is the second lowest in the hierarchy of the 'molecule' API classes.
|
|
33
|
+
the order of hierarchy being: Protein> Model> Chain> Residue> Atom. This class is also the component of the 'molecule' module API.
|
|
34
|
+
Please read the Tutorials and Documentation for more details.
|
|
35
|
+
|
|
36
|
+
Note:
|
|
37
|
+
- Please refer to the [https://web.archive.org/web/20080905024351/http://www.wwpdb.org/docs.html] for the description of the arguments.
|
|
38
|
+
|
|
39
|
+
Args:
|
|
40
|
+
id (int): Residue ID from the PDB file as it is. Each Residue in a PDB file Model/Frame has unique ID. (essential)
|
|
41
|
+
name (str): Residue Name from the PDB file as it is.
|
|
42
|
+
parent (packman.molecule.Chain): The Chain Object (parent) this Residue belongs to.
|
|
43
|
+
|
|
44
|
+
"""
|
|
45
|
+
def __init__(self,id,name,parent):
|
|
46
|
+
self.__id = id
|
|
47
|
+
self.__name = name
|
|
48
|
+
self.__parent = parent
|
|
49
|
+
self.__Atoms = None
|
|
50
|
+
self.__domain_id = None
|
|
51
|
+
self.__Atoms_Names = {}
|
|
52
|
+
|
|
53
|
+
#Properties are the entities that are not included in the PDB files and are obtained by calculations
|
|
54
|
+
self.__properties = {}
|
|
55
|
+
|
|
56
|
+
def __setitem__(self,id,Atom):
|
|
57
|
+
"""Simply assign new atom to the 'Residue'
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
new_id: The ID User wishes to assign to the given 'Atom'
|
|
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 'Residue'
|
|
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 'Residue'
|
|
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 'Residue'
|
|
88
|
+
|
|
89
|
+
Returns:
|
|
90
|
+
packman.molecule.Chain if successful, None otherwise.
|
|
91
|
+
"""
|
|
92
|
+
return self.__parent
|
|
93
|
+
|
|
94
|
+
def get_atom(self,key):
|
|
95
|
+
"""Get the specific Atom by id/name. Please note that this is different than get_atoms()
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
key (int/str): Get atom by the id/name
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
atom (:py:class:`packman.molecule.Atom`): Atom of the given ID if successful; None otherwise.
|
|
102
|
+
"""
|
|
103
|
+
try:
|
|
104
|
+
return self.__Atoms[key]
|
|
105
|
+
except KeyError:
|
|
106
|
+
try:
|
|
107
|
+
return self.__Atoms_Names[key]
|
|
108
|
+
except:
|
|
109
|
+
return None
|
|
110
|
+
|
|
111
|
+
def get_atoms(self):
|
|
112
|
+
"""Get the generator of corresponding 'Atom' objects of the 'Residue'
|
|
113
|
+
|
|
114
|
+
Returns:
|
|
115
|
+
generator of 'Atom' objects if successful, None otherwise.
|
|
116
|
+
"""
|
|
117
|
+
for i in sorted(self.__Atoms.keys()):yield self.__Atoms[i]
|
|
118
|
+
|
|
119
|
+
def get_domain_id(self):
|
|
120
|
+
"""Get the Domain Identifier of the given 'Residue'. Hinge Prediction is Necessary for this option.
|
|
121
|
+
|
|
122
|
+
Note:
|
|
123
|
+
Domain Identifiers (Obtained after running PACKMAN):
|
|
124
|
+
'FL': Flexible Linkers (Hinges); Followed by the domain number
|
|
125
|
+
'DM': Domain; Followed by the domain number
|
|
126
|
+
|
|
127
|
+
Returns:
|
|
128
|
+
str if successful, None otherwise.
|
|
129
|
+
"""
|
|
130
|
+
return self.__domain_id
|
|
131
|
+
|
|
132
|
+
def get_entropy(self, entropy_type):
|
|
133
|
+
"""Get the Packing Entropy of the given 'Residue'.
|
|
134
|
+
|
|
135
|
+
Please note that if the Entropy is calculated using specific atoms, this option might not give results for the amino acids that are not included because of the specific selection. Please see the documentation for more details.
|
|
136
|
+
|
|
137
|
+
Args:
|
|
138
|
+
type (str): Type of entropy (Allowed Values: 1. PackingEntropy)
|
|
139
|
+
|
|
140
|
+
Note:
|
|
141
|
+
- More type of Entropies might be added in the future.
|
|
142
|
+
"""
|
|
143
|
+
EntropyTypes = ['PackingEntropy']
|
|
144
|
+
try:
|
|
145
|
+
return self.__properties[entropy_type]
|
|
146
|
+
except:
|
|
147
|
+
if(entropy_type in EntropyTypes):
|
|
148
|
+
logging.warning('This Entropy type is not yet calculated. Please check the "calculate_entropy" function in the documentation for the details.')
|
|
149
|
+
else:
|
|
150
|
+
logging.warning('The Entropy type provided is invalid. Please check the documentation for the details.')
|
|
151
|
+
|
|
152
|
+
def get_property(self,property_name):
|
|
153
|
+
"""Get the Property of the given 'Residue'.
|
|
154
|
+
|
|
155
|
+
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.
|
|
156
|
+
Properties are like pinboards. You can pin anything to the object with a key as a pin.
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
property_name (object): The 'Key' or a name the user wants to assign to to the property
|
|
160
|
+
|
|
161
|
+
Note:
|
|
162
|
+
- Users can add custom annotations; for example: If particular amino acid becomes disordered, it can be annotated with this feature.
|
|
163
|
+
"""
|
|
164
|
+
try:
|
|
165
|
+
return self.__properties[property_name]
|
|
166
|
+
except:
|
|
167
|
+
logging.warning('The Property Name provided is not assigned.')
|
|
168
|
+
|
|
169
|
+
#Set Functions
|
|
170
|
+
def set_id(self,new_id):
|
|
171
|
+
"""Set the ID of the given 'Residue'
|
|
172
|
+
|
|
173
|
+
Args:
|
|
174
|
+
new_id (int): The ID User wishes to assign to the given 'Residue'
|
|
175
|
+
"""
|
|
176
|
+
self.__id=new_id
|
|
177
|
+
|
|
178
|
+
def set_name(self,new_name):
|
|
179
|
+
"""Set the Name of the given 'Residue'
|
|
180
|
+
|
|
181
|
+
Args:
|
|
182
|
+
new_name (str): The Name User wishes to assign to the given 'Residue'
|
|
183
|
+
"""
|
|
184
|
+
self.__name=new_name
|
|
185
|
+
|
|
186
|
+
def set_parent(self,new_parent):
|
|
187
|
+
"""Set the Parent of the given 'Residue'
|
|
188
|
+
|
|
189
|
+
Args:
|
|
190
|
+
new_parent (packman.molecule.Chain): The parent 'Chain' User wishes to assign to the given 'Residue'
|
|
191
|
+
"""
|
|
192
|
+
self.__parent=new_parent
|
|
193
|
+
|
|
194
|
+
def set_domain_id(self,new_domain_id):
|
|
195
|
+
"""Set the Domain Identifier of the given 'Residue'.
|
|
196
|
+
|
|
197
|
+
Note:
|
|
198
|
+
Domain Identifiers Format:
|
|
199
|
+
'FL': Flexible Linkers (Hinges); Followed by the domain number
|
|
200
|
+
'DM': Domain; Followed by the domain number
|
|
201
|
+
|
|
202
|
+
Args:
|
|
203
|
+
new_domain_id (str): The Domain Identifies User wishes to assign to the given 'Residue'
|
|
204
|
+
"""
|
|
205
|
+
self.__domain_id=new_domain_id
|
|
206
|
+
|
|
207
|
+
def set_entropy(self, entropy_type, value):
|
|
208
|
+
"""Set the Packing Entropy of the given 'Residue'.
|
|
209
|
+
|
|
210
|
+
Args:
|
|
211
|
+
type (str): Type of entropy (Allowed Values: 1. PackingEntropy)
|
|
212
|
+
|
|
213
|
+
Note:
|
|
214
|
+
- More type of Entropies might be added in the future.
|
|
215
|
+
"""
|
|
216
|
+
EntropyTypes = ['PackingEntropy']
|
|
217
|
+
if(entropy_type in EntropyTypes):
|
|
218
|
+
self.__properties[entropy_type] = value
|
|
219
|
+
else:
|
|
220
|
+
logging.warning('The property name provided is invalid. Please check the documentation for the details.')
|
|
221
|
+
|
|
222
|
+
def set_property(self,property_name,value):
|
|
223
|
+
"""Set the Property of the given 'Residue'.
|
|
224
|
+
|
|
225
|
+
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.
|
|
226
|
+
Properties are like pinboards. You can pin anything to the object with a key as a pin.
|
|
227
|
+
|
|
228
|
+
Args:
|
|
229
|
+
property_name (object): The 'Key' or a name the user wants to assign to to the property
|
|
230
|
+
value (object): The value the user wants to assign to the property
|
|
231
|
+
|
|
232
|
+
Note:
|
|
233
|
+
- Users can add custom annotations; for example: If particular amino acid becomes disordered, it can be annotated with this feature.
|
|
234
|
+
"""
|
|
235
|
+
try:
|
|
236
|
+
self.__properties[property_name] = value
|
|
237
|
+
except:
|
|
238
|
+
logging.warning('Please check the property name. Check the allowed Python dictionary key types for more details.')
|
|
239
|
+
|
|
240
|
+
#Calculation/Processing Functions
|
|
241
|
+
def get_calpha(self):
|
|
242
|
+
"""Get the C-Alpha atom of the residue as an 'Atom' object.
|
|
243
|
+
|
|
244
|
+
Returns:
|
|
245
|
+
packman.molecule.Atom if successful, None otherwise.
|
|
246
|
+
"""
|
|
247
|
+
try:
|
|
248
|
+
return [i for i in self.get_atoms() if i.get_name()=='CA'][0]
|
|
249
|
+
except:
|
|
250
|
+
#Later create warning that C-alpha is missing
|
|
251
|
+
None
|
|
252
|
+
|
|
253
|
+
def get_centerofgravity(self):
|
|
254
|
+
"""Get the center of gravity of the given 'Residue'
|
|
255
|
+
|
|
256
|
+
Note:
|
|
257
|
+
Yet to add the atomic masses.
|
|
258
|
+
|
|
259
|
+
Returns:
|
|
260
|
+
Cartesian Coordinates as numpy.array of the centre of the gravity.
|
|
261
|
+
"""
|
|
262
|
+
atoms=self.get_atoms()
|
|
263
|
+
AtomicMass=1
|
|
264
|
+
XYZ_M=[0,0,0]
|
|
265
|
+
MassofAA=0
|
|
266
|
+
for i in atoms:
|
|
267
|
+
XYZ_M[0]+=i.get_location()[0]*AtomicMass
|
|
268
|
+
XYZ_M[1]+=i.get_location()[1]*AtomicMass
|
|
269
|
+
XYZ_M[2]+=i.get_location()[2]*AtomicMass
|
|
270
|
+
MassofAA=MassofAA+AtomicMass
|
|
271
|
+
return numpy.array([i/MassofAA for i in XYZ_M])
|
|
272
|
+
|
|
273
|
+
def get_backbone(self):
|
|
274
|
+
"""Get the Backbone atoms of the given 'Residue' as a list of 'Atom' object
|
|
275
|
+
|
|
276
|
+
Note:
|
|
277
|
+
Some files like 1k20 are showing multiple backbone atoms because seperation of models is based on [Model] in this tool (Maybe Solved)
|
|
278
|
+
|
|
279
|
+
Returns:
|
|
280
|
+
list of packman.molecule.Atom if successful, None otherwise.
|
|
281
|
+
"""
|
|
282
|
+
return [i for i in self.get_atoms() if(i.get_name()=='N' or i.get_name()=='CA' or i.get_name()=='C' or i.get_name()=='O')]
|
|
283
|
+
|
|
284
|
+
def get_tip(self):
|
|
285
|
+
"""Get the tip atom of the given 'Residue' as an 'Atom' object
|
|
286
|
+
|
|
287
|
+
Note:
|
|
288
|
+
ALA and GLY are small so their tip is C-alpha
|
|
289
|
+
|
|
290
|
+
Returns:
|
|
291
|
+
packman.molecule.Atom if successful, None otherwise.
|
|
292
|
+
"""
|
|
293
|
+
CAlpha=self.get_calpha()
|
|
294
|
+
resname=self.get_name()
|
|
295
|
+
TipofAA=None
|
|
296
|
+
if(resname=='GLY'):
|
|
297
|
+
TipofAA=CAlpha
|
|
298
|
+
else:
|
|
299
|
+
try:
|
|
300
|
+
MaxDistance=0
|
|
301
|
+
for i in self.get_atoms():
|
|
302
|
+
tempdistance=CAlpha.calculate_distance(i)
|
|
303
|
+
if(tempdistance>MaxDistance):
|
|
304
|
+
MaxDistance=tempdistance
|
|
305
|
+
TipofAA=i
|
|
306
|
+
except:
|
|
307
|
+
TipofAA = CAlpha
|
|
308
|
+
logging.warning('The tip atoms for '+resname+str(self.get_id())+' not found; Using C-Alpha atoms as a tip.')
|
|
309
|
+
return TipofAA
|
|
310
|
+
|
|
311
|
+
def calculate_entropy(self,entropy_type,chains=None, probe_size=1.4, onspherepoints=30):
|
|
312
|
+
"""Calculate the entropy for the each amino acid will be returned.
|
|
313
|
+
|
|
314
|
+
The 'chains' argument should be used when the user wants to restrict the analysis to a chain or group of chains rather than the whole structure.
|
|
315
|
+
|
|
316
|
+
Args:
|
|
317
|
+
entropy_type (str) : Type of entropy to be calculated (Options: PackingEntropy)
|
|
318
|
+
chains ([str]/str) : Chain IDs for the Entropy calculation (None means all the chains are included; single string means only one chain ID; multiple chains should be an array of strings).
|
|
319
|
+
probe_size (float) : Radius of the probe to generate the surface points (This value should not be less than 1;Read the Publication for more details)
|
|
320
|
+
onspherepoints (int) : Number of points to be generated around each point for the surface (Read the Publication for more details)
|
|
321
|
+
"""
|
|
322
|
+
self.get_parent().get_parent().calculate_entropy(entropy_type, chains=chains, probe_size=probe_size, onspherepoints=onspherepoints)
|
|
Binary file
|
|
File without changes
|
Program Files/Python39/Lib/site-packages/packman/tests/anm/__pycache__/__init__.cpython-39.pyc
ADDED
|
Binary file
|
Program Files/Python39/Lib/site-packages/packman/tests/anm/__pycache__/test_anm.cpython-39.pyc
ADDED
|
Binary file
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
from ... import molecule
|
|
2
|
+
from ...anm import ANM, hdANM
|
|
3
|
+
import unittest
|
|
4
|
+
|
|
5
|
+
import logging
|
|
6
|
+
from os import remove as rm
|
|
7
|
+
|
|
8
|
+
class TestMolecule(unittest.TestCase):
|
|
9
|
+
|
|
10
|
+
def setUp(self):
|
|
11
|
+
self.mol = molecule.load_structure('packman/tests/data/4hla.cif',ftype='cif')
|
|
12
|
+
self.calpha = [i for i in self.mol[0]['A'].get_calpha() if i is not None]
|
|
13
|
+
|
|
14
|
+
def test_hdANM(self):
|
|
15
|
+
self.Model=hdANM(self.calpha,dr=15,power=0,hng_file='packman/tests/data/1prw.hng')
|
|
16
|
+
self.assertTrue( self.Model.calculate_hessian() )
|
|
17
|
+
self.assertTrue( self.Model.calculate_decomposition() )
|
|
18
|
+
|
|
19
|
+
self.assertIsNotNone( self.Model.get_eigenvalues() )
|
|
20
|
+
self.assertIsNotNone( self.Model.get_eigenvectors() )
|
|
21
|
+
|
|
22
|
+
self.assertTrue( self.Model.calculate_movie(6,scale=2,n=10) )
|
|
23
|
+
self.assertTrue( self.Model.calculate_movie(6,scale=2,n=10, ftype='pdb') )
|
|
24
|
+
rm('6.cif')
|
|
25
|
+
rm('6.pdb')
|
|
26
|
+
|
|
27
|
+
self.assertIsNotNone( self.Model.get_hessian_pseudoinverse() )
|
|
28
|
+
self.assertIsNotNone( self.Model.get_RT_eigen_vectors() )
|
|
29
|
+
|
|
30
|
+
#Add corsscorrelation after the publication
|
|
31
|
+
#self.assertIsNotNone( [i for i in self.Model.get_crosscorrelation_matrix()] )
|
|
32
|
+
|
|
33
|
+
def test_ANM_Compliance(self):
|
|
34
|
+
self.ANM_MODEL = ANM(self.calpha)
|
|
35
|
+
|
|
36
|
+
self.assertTrue( self.ANM_MODEL.calculate_hessian() )
|
|
37
|
+
self.assertTrue( self.ANM_MODEL.calculate_decomposition() )
|
|
38
|
+
self.assertTrue( self.ANM_MODEL.calculate_stiffness_compliance() )
|
|
39
|
+
self.assertTrue( self.ANM_MODEL.calculate_fluctuations() )
|
|
40
|
+
|
|
41
|
+
self.assertIsNotNone( self.ANM_MODEL.get_stiffness_map() )
|
|
42
|
+
self.assertIsNotNone( self.ANM_MODEL.get_compliance_map() )
|
|
43
|
+
|
|
44
|
+
self.assertIsNotNone( self.ANM_MODEL.get_fluctuations() )
|
|
45
|
+
self.assertIsNotNone( self.ANM_MODEL.get_stiffness_profile() )
|
|
46
|
+
self.assertIsNotNone( self.ANM_MODEL.get_compliance_profile() )
|
|
47
|
+
|
|
48
|
+
def tearDown(self):
|
|
49
|
+
logging.info('ANM, hdANM and Compliance Test Done.')
|
|
50
|
+
|
|
51
|
+
if(__name__=='__main__'):
|
|
52
|
+
unittest.main()
|