From 3097cc52934b6688c32ddc5760b923bc64be5318 Mon Sep 17 00:00:00 2001 From: Dawid Jagiela Date: Wed, 6 Mar 2013 16:26:08 +0100 Subject: [PATCH] Added minimazation support to UNRESInpGen.py --- source/pymol/UNRESInpGen.py | 48 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/source/pymol/UNRESInpGen.py b/source/pymol/UNRESInpGen.py index b3d77a7..da99f5a 100755 --- a/source/pymol/UNRESInpGen.py +++ b/source/pymol/UNRESInpGen.py @@ -52,6 +52,7 @@ class UNRESInpGenerator(Toplevel): writeSSbrige = IntVar() OM1Val = StringVar() OM2Val = StringVar() + CART = IntVar() objects_list = ['Select object'] seq_list=[] seq_length=0 @@ -118,7 +119,7 @@ class UNRESInpGenerator(Toplevel): labelpos = 'w', label_text = 'Choose method:', menubutton_textvariable = self.OM1Val, - items = ['MD', 'MREMD' ], + items = ['MD', 'MREMD', 'MINIMIZE' ], command = self.switch_options, menubutton_width = 10 ) @@ -261,6 +262,35 @@ class UNRESInpGenerator(Toplevel): self.gr1.th.e3.component('entry').config(width=8) #self.gr1.th.e2.pack(side=LEFT) + + #================================= + # - Minimization frame + self.gr1.mi = Frame(self.gr1.interior()) + #self.gr1.mi.grid(row=4, column=0, columnspan=5,sticky=W+E) + + self.gr1.mi.e1 = Pmw.EntryField(self.gr1.mi, + labelpos='w', + label_text="MAXMIN", + validate = {'validator' : 'integer', 'min': 0 , 'max' : 1000000 }, + value = "2000" ) + self.balloon.bind(self.gr1.mi.e1,'Maximum number of iterations of the SUMSL minimizer.') + self.gr1.mi.e1.component('entry').config(width=8) + self.gr1.mi.e1.pack(side=LEFT) + + self.gr1.mi.e2 = Pmw.EntryField(self.gr1.mi, + labelpos='w', + label_text="MAXFUN", + validate = {'validator' : 'integer', 'min': 0 , 'max' : 1000000 }, + value = "5000" ) + self.balloon.bind(self.gr1.mi.e2,'Maximum number of function evaluations in a single minimization.') + self.gr1.mi.e2.component('entry').config(width=8) + self.gr1.mi.e2.pack(side=LEFT) + + self.gr1.mi.c1 = Checkbutton(self.gr1.mi, + text = "CART", + variable = self.CART ) + self.balloon.bind(self.gr1.mi.c1,'Minimize in virtual-bond vectors instead of angles.') + self.gr1.mi.c1.pack(side=LEFT) #================================= # "Force field options" group @@ -526,10 +556,14 @@ class UNRESInpGenerator(Toplevel): # Hide all self.gr1.th.grid_remove() self.gr1.md.grid_remove() + self.gr1.mi.grid_remove() + # Show MD stuff if self.OM1Val.get()=="MD": self.gr1.md.grid(row=2, column=0, columnspan=5, sticky=W+E) self.gr1.th.grid(row=3, column=0, columnspan=5, sticky=W+E) - + elif self.OM1Val.get()=="MINIMIZE": + self.gr1.mi.grid(row=4,column=0,columnspan=5, sticky=W+E) + def set_force_field(self, pole): ''' @@ -611,6 +645,10 @@ class UNRESInpGenerator(Toplevel): s+="T_BATH="+self.gr1.th.e1.getvalue()+" " return s + def get_minim_opt(self): + s = "MAXMIN="+self.gr1.mi.e1.getvalue()+" MAXFUN="+self.gr1.mi.e2.getvalue() + return s + def get_seq_data(self): ''' @@ -812,11 +850,17 @@ class UNRESInpGenerator(Toplevel): mainopt+="MD PDBREF EXTCONF" elif self.OM1Val.get()=="MREMD": mainopt+="RE " + elif self.OM1Val.get()=="MINIMIZE": + mainopt+="PDBREF MINIMIZE " + if self.CART.get(): + mainopt+=" CART" text2save+=self.fortran_format(mainopt) # Get aux options if self.OM1Val.get()=="MD": text2save+=self.fortran_format(self.get_md_opt()) + elif self.OM1Val.get()=="MINIMIZE": + text2save+=self.fortran_format(self.get_minim_opt()) # Get force fields parameters text2save+=self.fortran_format(self.get_weights()) -- 1.7.9.5