Skip to content

Commit

Permalink
v1.2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranavkhade committed Apr 1, 2021
1 parent 42162fc commit 661d5dd
Show file tree
Hide file tree
Showing 20 changed files with 161 additions and 126 deletions.
4 changes: 2 additions & 2 deletions build/lib/packman/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
from .utilities import *


#VERSION CHANGE HERE CHANGES IT IN docs AND setup.py; STILL NEED TO CHANGE IT IN requirement.txt
__version__='1.2.9'
#VERSION CHANGE HERE CHANGES IT IN docs AND setup.py
__version__='1.2.10'
25 changes: 9 additions & 16 deletions build/lib/packman/anm/anm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
"""The 'ANM' object host file.
This is file information, not the class information. This information is only for the API developers.
Please read the 'ANM' object documentation for details. [ help(packman.anm.ANM) ]
Please read the 'ANM' object documentation for details.
Example:
>>>from packman.anm import ANM
>>>help( ANM )
Example::
from packman.anm import ANM
help( ANM )
Notes:
* Tutorial: https://jerniganlab.github.io/Software/PACKMAN/Tutorials/compliance
Expand Down Expand Up @@ -278,14 +277,13 @@ def calculate_stiffness_compliance(self):
self.compliance_profile = [numpy.nanmean(i) for i in compliance_map]
return True

def calculate_movie(self,mode_number,scale=1.5,n=10, direction="both"):
"""Get the movie of the obtained LINEAR modes.
def calculate_movie(self,mode_number,scale=1.5,n=20):
"""Get the movie of the obtained LINEAR modes. The first frame is the original structure and the projection progresses in positive (+) direction, returning to original structure and then in negative direction (-) again returning to the original structure.
Args:
mode_number (int) : Mode number. (first non-rigid mode is 6th)
scale (float) : Multiplier; extent to which mode will be extrapolated. Defaults to 1.5.
n (int) : Number of frames in output Defaults to 10
direction (both/+/-) : Explore specific direcrion of the motion. Defaults to "both"
scale (float) : Multiplier; extent to which mode will be extrapolated. Defaults to 1.5
n (int) : Number of frames in output (should be =>8 and ideally multiple of 4) Defaults to 20
Note:
- Scale and n parameters should be redesigned.
Expand All @@ -297,12 +295,7 @@ def calculate_movie(self,mode_number,scale=1.5,n=10, direction="both"):
x0=self.coords
new_coords=[]
with open('ANM_'+str(mode_number)+'.pdb','w') as fh:
if(direction=="both"):
movement = [k for k in range(-n,n)]+[k for k in range(-n,n)[::-1]]
elif(direction=="+"):
movement = [k for k in range(n)]+[k for k in range(n)[::-1]]
elif(direction=="-"):
movement = [k for k in range(-n,1)]+[k for k in range(-n,1)[::-1]]
movement = [ numpy.sin(k*(1.0/float(n))*2*numpy.pi) for k in range(0,n+1,1) ]
for j in movement:
for numi,i in enumerate(x0):
new_x=i[0]+scale*j*self.eigen_vectors[:,mode_number][(numi*3)+0]
Expand Down
47 changes: 17 additions & 30 deletions build/lib/packman/anm/hd_anm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""The 'hdANM' object host file.
This is file information, not the class information. This information is only for the API developers.
Please read the 'hdANM' object documentation for details. [ help(packman.anm.hdANM) ]
Please read the 'hdANM' object documentation for details.
About .hng File:
- hdANM requires the information about hinges and domains in the .hng format.
Expand All @@ -11,20 +11,20 @@
Filename_ChainID Domain/HingeId ResidueStartPosition:ResidueEndPosition
Example of .hng file for PDBID 1EXR
Example of .hng file for PDBID 1EXR::
1EXR_A D1 1:70
1EXR_A H1 70:90
1EXR_A D2 90:148
1EXR_A D1 1:70
1EXR_A H1 70:90
1EXR_A D2 90:148
Above format means that there are two domains (D1 and D2) separated by a hinge (H1). D1 stretches from residue 1 to 70; D2 stretches from 90 to 148 and hinge H1 is in the middle.
Example:
Example::
>>>from packman.anm import hdANM
>>>help( hdANM )
from packman.anm import hdANM
help( hdANM )
Notes:
* Tutorial:
Expand Down Expand Up @@ -552,15 +552,14 @@ def calculate_cross_correlation( self, n_modes = "all" ):

self.crosscorrelation_matrix[i][j] = trace_H_inv_ij / numpy.sqrt( trace_H_inv_ii*trace_H_inv_jj )

def calculate_movie(self,mode_number,scale=1.5,n=10, extrapolation="curvilinear", direction="both", ftype='cif'):
"""This function generates the dynamic 3D projection of the normal modes obtained using hd-ANM. The 3D projection can be linearly extrapolated or curvilinearly extrapolated depending on the choices.
def calculate_movie(self, mode_number, scale=1.5, n=20, extrapolation="curvilinear", ftype='cif'):
"""This function generates the dynamic 3D projection of the normal modes obtained using hd-ANM. The 3D projection can be linearly extrapolated or curvilinearly extrapolated depending on the choices. The first frame is the original structure and the projection progresses in positive (+) direction, returning to original structure and then in negative direction (-) again returning to the original structure.
Args:
mode_number (int) : Mode number. (first non-rigid mode is 6th)
scale (float) : Multiplier; extent to which mode will be extrapolated. Defaults to 1.5.
n (int) : Number of frames in output Defaults to 10
extrapolation (linear/curvilinear) : Extrapolation method Defaults to "curvilinear"
direction (both/+/-) : Explore specific direcrion of the motion. Defaults to "both"
scale (float) : Multiplier; extent to which mode will be extrapolated. Defaults to 1.5
n (int) : Number of frames in output (should be =>8 and ideally multiple of 4) Defaults to 20
extrapolation (linear/curvilinear) : Extrapolation method Defaults to "curvilinear"
ftype (string) : Extension of the output file (.cif / .pdb)
Note:
Expand All @@ -576,13 +575,7 @@ def calculate_movie(self,mode_number,scale=1.5,n=10, extrapolation="curvilinear"
new_coords=[]

if(extrapolation=="linear"):

if(direction=="both"):
movement = [k for k in range(-n,n)]+[k for k in range(-n,n)[::-1]]
elif(direction=="+"):
movement = [k for k in range(n)]+[k for k in range(n)[::-1]]
elif(direction=="-"):
movement = [k for k in range(-n,1)]+[k for k in range(-n,1)[::-1]]
movement = [ numpy.sin(k*(1.0/float(n))*2*numpy.pi) for k in range(0,n+1,1) ]
ModelsOfTheProtein = []
for j in movement:
HingeResidue=0
Expand Down Expand Up @@ -614,13 +607,7 @@ def calculate_movie(self,mode_number,scale=1.5,n=10, extrapolation="curvilinear"


elif(extrapolation=="curvilinear"):

if(direction=="both"):
movement = [k for k in range(-n,n)]+[k for k in range(-n,n)[::-1]]
elif(direction=="+"):
movement = [k for k in range(n)]+[k for k in range(n)[::-1]]
elif(direction=="-"):
movement = [k for k in range(-n,1)]+[k for k in range(-n,1)[::-1]]
movement = [ numpy.sin(k*(1.0/float(n))*2*numpy.pi) for k in range(0,n+1,1) ]
ModelsOfTheProtein = []
for j in movement:
HingeResidue=0
Expand Down Expand Up @@ -660,11 +647,11 @@ def calculate_movie(self,mode_number,scale=1.5,n=10, extrapolation="curvilinear"
currentatm = Atom(self.atoms[numi].get_id() , self.atoms[numi].get_name(), numpy.array([new_x,new_y,new_z]), self.atoms[numi].get_occupancy(), self.atoms[numi].get_bfactor(), self.atoms[numi].get_element(),self.atoms[numi].get_charge(), self.atoms[numi].get_parent() )
AtomsOfTheFrame[numi] = currentatm

ModelsOfTheProtein.append( Model(j, AtomsOfTheFrame, None, None, None, None) )
ModelsOfTheProtein.append( Model(j, AtomsOfTheFrame, None, None, None, None) )

Annotations = self.atoms[0].get_parent().get_parent().get_parent().get_parent().get_data()
prot = Protein(str(mode_number), ModelsOfTheProtein)
prot.set_data(Annotations)
prot.write_structure( str(mode_number)+'.'+ftype )
prot.write_structure( str(mode_number)+'.'+ftype )

return True
2 changes: 1 addition & 1 deletion build/lib/packman/apps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Notes:
* Current apps list: - predict_hinge : A program to predict the hinge on the molecule given the atoms and relevent parameters
Example:
Example::
* Review the packman.bin.PACKMAN.py file for the app use.
Todo:
Expand Down
8 changes: 4 additions & 4 deletions build/lib/packman/apps/predict_hinge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"""The 'predict_hinge' object host file.
This is file information, not the class information. This information is only for the API developers.
Please read the 'predict_hinge' object documentation for details. [ help(packman.apps.predict_hinge) ]
Please read the 'predict_hinge' object documentation for details.
Example:
Example::
>>>from packman import apps
>>>help( apps.predict_hinge )
from packman.apps import predict_hinge
help( predict_hinge )
Todo:
* Finish writing up the documentation.
Expand Down
25 changes: 15 additions & 10 deletions build/lib/packman/bin/PACKMAN.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,17 @@ def show_frame(self,frame_name):

class top_menu(tk.Frame):
def __init__(self,parent):
tk.Frame.__init__(self)
tk.Button(parent, text = 'Home', command = lambda: parent.show_frame('HomePage') ).grid(row=0,column=0,sticky=E+W)
tk.Button(parent, text = 'Hinge Prediction', command = lambda: parent.show_frame('HingePrediction') ).grid(row=0,column=1,sticky=E+W)
tk.Button(parent, text = 'hdANM', command = lambda: parent.show_frame('hdANM_GUI') ).grid(row=0,column=2,sticky=E+W)
number_of_buttons = 3
Canvas_top_menu = tk.Canvas(parent)
Canvas_top_menu.grid(row=0,column=0,columnspan=3, sticky=E+W )

for i in range(0,number_of_buttons):
Grid.columnconfigure(Canvas_top_menu, i, weight=1)

#tk.Frame.__init__(self)
tk.Button(Canvas_top_menu, text = 'Home', command = lambda: parent.show_frame('HomePage') ).grid( row=0,column=0,sticky=E+W )
tk.Button(Canvas_top_menu, text = 'Hinge Prediction', command = lambda: parent.show_frame('HingePrediction') ).grid( row=0,column=1,sticky=E+W )
tk.Button(Canvas_top_menu, text = 'hdANM', command = lambda: parent.show_frame('hdANM_GUI') ).grid( row=0,column=2,sticky=E+W )



Expand All @@ -257,9 +264,9 @@ def __init__(self,parent):
self.all_objects = self.__dict__

def show(self):
self.Label1.grid(row=1,columnspan=3)
self.Label2.grid(row=2,columnspan=3)
self.Text1.grid(row=3,columnspan=3)
self.Label1.grid(row=1,columnspan=3, sticky=E+W, padx=10, pady=10 )
self.Label2.grid(row=2,columnspan=3, sticky=E+W, padx=10, pady=10 )
self.Text1.grid(row=3,columnspan=3, sticky=E+W, padx=10, pady=10 )

def hide(self):
for i in self.all_objects:
Expand Down Expand Up @@ -381,11 +388,10 @@ def run_PACKMAN(self):
#At this point, everything is okay


#Results
#Hinge Prediction Results
pop_up1 = tk.Toplevel()
pop_up1.title('PACKMAN Results')

#Canvas
Canvas1 = tk.Canvas(pop_up1)
Canvas1.grid(row=0,column=0,columnspan=6,sticky=N+S+E+W, padx=10, pady=10 )

Expand Down Expand Up @@ -503,7 +509,6 @@ def show_details(content):
#on_click() Ends here
return True




'''
Expand Down
Binary file added build/lib/packman/bin/logo.ico
Binary file not shown.
6 changes: 3 additions & 3 deletions build/lib/packman/molecule/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
This is file information, not the class information. This information is only for the API developers.
Please read the corrosponding object documentation for details.
Example:
Example::
>>>from packman import molecule
>>>help( molecule.Hinge )
from packman.molecule import Hinge
help( Hinge )
Todo:
* Finish writing up the documentation.
Expand Down
12 changes: 5 additions & 7 deletions build/lib/packman/molecule/atom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
"""The 'Atom' object host file.
This is file information, not the class information. This information is only for the API developers.
Please read the 'Atom' object documentation for details. [ help(packman.molecule.atoms.Atom) ]
Please read the 'Atom' object documentation for details.
Example:
>>>from packman.molecule import atom.Atom
>>>help( Atom )
OR
Example::
from packman.molecule import Atom
help( Atom )
>>>from packman import molecule
>>>help( molecule.Atom )
Todo:
* Finish writing up the documentation.
Expand Down
11 changes: 4 additions & 7 deletions build/lib/packman/molecule/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
"""The 'Chain' object host file.
This is file information, not the class information. This information is only for the API developers.
Please read the 'Chain' object documentation for details. [ help(packman.molecule.chain.Chain) ]
Please read the 'Chain' object documentation for details.
Example:
>>>from packman.molecule import chain.Chain
>>>help( Chain )
OR
Example::
>>>from packman import molecule
>>>help( molecule.Chain )
from packman.molecule import Chain
help( Chain )
Note:
* Iterating over chain only fetches the residues not the hetero atoms
Expand Down
11 changes: 4 additions & 7 deletions build/lib/packman/molecule/hetmol.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
"""The 'HetMol' object host file.
This is file information, not the class information. This information is only for the API developers.
Please read the 'HetMol' object documentation for details. [ help(packman.molecule.residue.Residue) ]
Please read the 'HetMol' object documentation for details.
Example:
>>>from packman.molecule import residue.HetMol
>>>help( HetMol )
OR
Example::
>>>from packman import HetMol
>>>help( molecule.HetMol )
from packman.molecule import HetMol
help( HetMol )
Todo:
* Finish writing up the documentation.
Expand Down
23 changes: 14 additions & 9 deletions build/lib/packman/molecule/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
"""The 'Model' object host file.
This is file information, not the class information. This information is only for the API developers.
Please read the 'Model' object documentation for details. [ help(packman.molecule.model.Model) ]
Please read the 'Model' object documentation for details.
Example:
>>>from packman.molecule import model.Model
>>>help( Model )
OR
Example::
>>>from packman import molecule
>>>help( molecule.Model )
from packman.molecule import Model
help( Model )
Note:
* The models are nothing but frames of the PDB file.
Expand All @@ -26,6 +23,7 @@


import numpy
import logging


class Model():
Expand Down Expand Up @@ -81,9 +79,16 @@ def get_residues(self):
"""Get the generator of corresponding 'Residue' objects of the 'Model'
Returns:
generator of 'Residue' objects if successful, None otherwise.
array of 'Residue' objects if successful, None otherwise.
"""
return [j for i in self.__AllChains.keys() for j in self.__AllChains[i].get_residues()]
#return [j for i in self.__AllChains.keys() for j in self.__AllChains[i].get_residues()]
residues = []
for i in self.__AllChains.keys():
try:
residues.extend( self.__AllChains[i].get_residues() )
except:
logging.warning("Chain "+str(i)+" either doesn't have residues or an error occurred; Model.get_residues() may have loaded other chains.")
return residues

def get_atoms(self):
"""Get the generator of corresponding 'Atom' objects of the 'Model'
Expand Down
Loading

0 comments on commit 661d5dd

Please sign in to comment.