From: Cezary Czaplewski Date: Sat, 26 Aug 2017 21:57:40 +0000 (+0200) Subject: new force field option X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=commitdiff_plain;h=533934d3ce690cbee495617d193c7560960e55d5;p=django_unres.git new force field option --- diff --git a/django_simple/todo/forms.py b/django_simple/todo/forms.py index d8ea95d..987887b 100644 --- a/django_simple/todo/forms.py +++ b/django_simple/todo/forms.py @@ -3,6 +3,7 @@ from .models import Task from .models import MIN_CHOICE from .models import MD_START from .models import MD_LANG +from .models import FF_CHOICE import json class MultiWidgetBasic(forms.MultiWidget): @@ -49,6 +50,8 @@ class TaskForm_min(forms.Form): class TaskForm_min_a(forms.Form): name = forms.CharField(max_length=20) + unres_ff = forms.ChoiceField(choices=FF_CHOICE,widget=forms.RadioSelect, + label='Force Field',initial='E0LL2Y') min_choice = forms.ChoiceField(choices=MIN_CHOICE,label='minimization algorithm') min_overlap = forms.BooleanField(required=False,label='remove overlap') min_searchsc = forms.BooleanField(required=False,label='MC for sidechain overlap') @@ -109,6 +112,8 @@ class TaskForm_md(forms.Form): class TaskForm_md_a(forms.Form): name = forms.CharField(max_length=20) + unres_ff = forms.ChoiceField(choices=FF_CHOICE,widget=forms.RadioSelect, + label='Force Field',initial='E0LL2Y') md_start = forms.ChoiceField(choices=MD_START,widget=forms.RadioSelect, label='starting structure',initial='extconf') md_seq = forms.CharField(label='Sequence', @@ -203,6 +208,8 @@ class TaskForm_remd(forms.Form): class TaskForm_remd_a(forms.Form): name = forms.CharField(max_length=20) + unres_ff = forms.ChoiceField(choices=FF_CHOICE,widget=forms.RadioSelect, + label='Force Field',initial='E0LL2Y') md_start = forms.ChoiceField(choices=MD_START,widget=forms.RadioSelect, label='starting structure',initial='extconf') md_seq = forms.CharField(label='Sequence', diff --git a/django_simple/todo/jobfiles.py b/django_simple/todo/jobfiles.py index 2b16ba3..ce0cf44 100644 --- a/django_simple/todo/jobfiles.py +++ b/django_simple/todo/jobfiles.py @@ -41,12 +41,21 @@ def write_on_task_save(sender, instance, **kwargs): #wrapper = textwrap.TextWrapper(width=70) #word_list = wrapper.wrap(text=md.substitute(nstep=str(nstep))) - w="""WSC=1.00000 WSCP=1.23315 WELEC=0.84476 WBOND=1.00000 WANG=0.62954 & + if instance.unres_ff =='E0LL2Y': + w="""WSC=1.00000 WSCP=1.23315 WELEC=0.84476 WBOND=1.00000 WANG=0.62954 & WSCLOC=0.10554 WTOR=1.34316 WTORD=1.26571 WCORRH=0.19212 WCORR5=0.00000 & WCORR6=0.00000 WEL_LOC=0.37357 WTURN3=1.40323 WTURN4=0.64673 WTURN6=0.00000 & WVDWPP=0.23173 WHPB=1.00000 WSCCOR=0.25 & CUTOFF=7.00000 WCORR4=0.00000 """ + else: + w="""WSC=0.82686 WSCP=0.96947 WELEC=0.79373 WBOND=1.00000 WANG=0.46542 & +WSCLOC=0.07969 WTOR=0.81684 WTORD=0.67806 WCORRH=0.00000 WCORR5=0.00000 & +WCORR6=0.00000 WEL_LOC=0.71100 WTURN3=2.30298 WTURN4=0.86517 WTURN6=0.00000 & +WSCCOR=0.14577 WVDWPP=0.17781 WHPB=1.00000 WSCP14=0.00000 & +CUTOFF=7.00000 WCORR4=0.00000 +""" + with open(instance.jobdirname+'/file.inp','w') as f: f.write(instance.name + ' UNRES server job'+ '\n') @@ -206,12 +215,18 @@ CUTOFF=7.00000 WCORR4=0.00000 if instance.type == 'min': os.chdir(instance.jobdirname) - shutil.copy('../files/pbs.csh','.') + if instance.unres_ff =='E0LL2Y': + shutil.copy('../files/pbs.csh','.') + else: + shutil.copy('../files/pbs_new.csh','pbs.csh') ret_code = subprocess.Popen(' /opt/torque/bin/qsub pbs.csh', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) os.chdir('..') elif instance.type == 'md': os.chdir(instance.jobdirname) - f1 = open('../files/pbs_md.csh', 'r') + if instance.unres_ff =='E0LL2Y': + f1 = open('../files/pbs_md.csh', 'r') + else: + f1 = open('../files/pbs_md_new.csh', 'r') f2 = open('pbs.csh', 'w') for line in f1: f2.write(line.replace('$dimen3',str(dimen3) )) @@ -238,7 +253,10 @@ CUTOFF=7.00000 WCORR4=0.00000 pbs = '#PBS -l nodes='+str(nodes)+':ppn=4+1:ppn='+str(reszta) os.chdir(instance.jobdirname) - f1 = open('../files/pbs8.csh', 'r') + if instance.unres_ff =='E0LL2Y': + f1 = open('../files/pbs8.csh', 'r') + else: + f1 = open('../files/pbs8_new.csh', 'r') f2 = open('pbs8.csh', 'w') for line in f1: if '#PBS -l nodes=4:ppn=4' in line: diff --git a/django_simple/todo/models.py b/django_simple/todo/models.py index 295a84a..5177996 100644 --- a/django_simple/todo/models.py +++ b/django_simple/todo/models.py @@ -9,6 +9,7 @@ import json MIN_CHOICE = (('minimize cart','minimize'),('minimize regular','regularize'),('minimize softreg','soft regularize'),('minimize','minimize internal coordinates')) MD_START= (('extconf','extended chain'),('pdbstart','start from pdb'),('rand_conf','random chain')) MD_LANG = (('langevin','Langevin'),('berendsen','Berendsen')) +FF_CHOICE = (('E0LL2Y','JCC 30 2127 (2009) + JCTC 11 817831 (2015)'),('opt-wtfsa-2','JCIM 10.1021/acs.jcim.7b00254 (2017)')) logger = logging.getLogger(__name__) @@ -28,6 +29,7 @@ class Task(models.Model): def getssbond(self): return json.loads(self.ssbond) + unres_ff = models.CharField(max_length=20,choices=FF_CHOICE,default='E0LL2Y') # minimization min_choice = models.CharField(max_length=20,choices=MIN_CHOICE,default='minimize cart') min_overlap = models.BooleanField(default=False) diff --git a/django_simple/todo/templates/details.html b/django_simple/todo/templates/details.html index f9651c0..b69ff1b 100644 --- a/django_simple/todo/templates/details.html +++ b/django_simple/todo/templates/details.html @@ -20,6 +20,11 @@ Created {{ task.created_date }}
type
{{ task.type }}
+ +
  • +
    force field
    +
    {{ task.unres_ff }}
    +
  • sequence
    @@ -206,6 +211,11 @@ Created {{ task.created_date }}
    multiplex
    {{ task.remd_multi_m}}
  • +
  • +
    temperature for clustering
    +
    {{ task.remd_cluter_temp}}
    +
  • + {% endif %} diff --git a/django_simple/todo/views.py b/django_simple/todo/views.py index 2d888e2..6f3a75e 100644 --- a/django_simple/todo/views.py +++ b/django_simple/todo/views.py @@ -125,6 +125,7 @@ def add_min_a(request,task_id): task.min_pdbout=form.cleaned_data["min_pdbout"] task.myfile1=form.cleaned_data["file1"] task.min_unres_pdb=form.cleaned_data["min_unres_pdb"] + task.unres_ff=form.cleaned_data["unres_ff"] seq,task.ssbond=from_pdb(task.myfile1) task.md_seq="" @@ -222,7 +223,7 @@ def add_md_a(request,task_id): task.md_tau=form.cleaned_data["md_tau"] task.md_scal_fric=form.cleaned_data["md_scal_fric"] task.md_mdpdb=form.cleaned_data["md_mdpdb"] - + task.unres_ff=form.cleaned_data["unres_ff"] task.ready=True basename = str(task.owner) @@ -316,6 +317,7 @@ def add_remd_a(request,task_id): # task.remd_rest1file=form.cleaned_data["remd_rest1file"] task.remd_cluter_temp=form.cleaned_data["remd_cluter_temp"] + task.unres_ff=form.cleaned_data["unres_ff"] basename = str(task.owner) suffix = datetime.datetime.now().strftime("%y%m%d_%H%M%S") diff --git a/files/pbs8_new.csh b/files/pbs8_new.csh new file mode 100755 index 0000000..0382652 --- /dev/null +++ b/files/pbs8_new.csh @@ -0,0 +1,88 @@ +#PBS -N test_server +#PBS -q nowy +#PBS -l nodes=4:ppn=4 + +#----------------------------------------------------------------------------- +setenv UNRES_BIN /users2/czarek/UNRES/git3_tmp/build/bin/unresMD-mult_ifort_MPI_E0LL2Y.exe +#----------------------------------------------------------------------------- +setenv DD /users2/czarek/UNRES/git3_tmp/unres/PARAM +setenv BONDPAR $DD/bond_AM1_ext_dum.parm +setenv THETPAR $DD/theta_abinitio-ext-old.parm +setenv THETPARPDB $DD/thetaml_ext.5parm +setenv ROTPARPDB $DD/scgauss_ext.parm +setenv ROTPAR $DD/rotamers_AM1_aura_ext.10022007.parm +setenv TORPAR $DD/tor_opt_iter1_7p_old-ext.parm +setenv TORDPAR $DD/pot_tord_G631_DIL_ext.parm +setenv ELEPAR $DD/electr_631Gdp_ext.parm +setenv SIDEPAR $DD/sc_GB_opt_iter1_7p_old-ext_lip.parm +setenv FOURIER $DD/fourier_opt_iter1_7p_old-ext.parm +setenv SCCORPAR $DD/sccor_am1_pawel_ext.dat +setenv SCPPAR $DD/scp_ext.parm +setenv PATTERN $DD/patterns.cart +setenv LIPTRANPAR $DD/Lip_tran_initial_ext.parm +#----------------------------------------------------------------------------- +cd $PBS_O_WORKDIR + +setenv MPIRUN "/users2/local/mpich2-1.4.1p1_intel/bin/mpirun " +set NPROCS=`cat $PBS_NODEFILE | wc -l` + +setenv FGPROCS 2 +setenv POT GB +setenv PREFIX file +setenv OUT1FILE YES + +#UNRES MREMD +$MPIRUN -machinefile $PBS_NODEFILE -np $NPROCS $UNRES_BIN + +#WHAM +setenv WHAM_BIN /users2/czarek/UNRES/git3_tmp/build/bin/wham-mult_ifort_MPI_E0LL2Y.exe +setenv CONTFUNC GB +setenv SIDEP $DD/contact_ext.3.parm +setenv SCRATCHDIR . +setenv PREFIX file_wham + +$MPIRUN -machinefile $PBS_NODEFILE -np 2 $WHAM_BIN + +#test images +setenv line `awk '{}END{print int(NR*0.2)}' file_GB000.stat` + +if ( `grep -c pdbref file.inp` ) then + tail -q -n +$line file_GB*.stat | awk '{if ( NF == 14 ) print}' >remd_all.stat + cat file_GB*.stat | awk '{if ( NF == 14 ) print}' > remd_all0.stat +else + tail -q -n +$line file_GB*.stat | awk '{if ( NF == 10 ) print}' >remd_all.stat + cat file_GB*.stat |awk '{if ( NF == 10 ) print}' > remd_all0.stat +endif +../files/matplotlib_hist.py $temperatures +rm remd_all.stat remd_all0.stat + +#CLUSTER WHAM +setenv INPUT file_cluster +setenv INTIN file_wham +setenv OUTPUT file_cluster +setenv PDB CART +setenv COORD CX +setenv PRINTCOOR PRINT_PDB +setenv CLUSTER_WHAM_BIN /users2/czarek/UNRES/git3_tmp/build/bin/cluster_wham-mult_ifort_MPI_E0LL2Y.exe + +$MPIRUN -machinefile $PBS_NODEFILE -np 2 $CLUSTER_WHAM_BIN + +ln -s file_wham_T*K_ave.pdb ave +../files/cluster2allatom.sh ave +rm ave + +#amber min refinement +foreach i (`seq 1 5`) +../files/refine.sh MODEL$i.pdb +end + +/users2/local/pymol_1.6/pymol -c ../files/model.pml + +/users2/local/bin/tmscore MODEL1.pdb plik.pdb > tmscore1.out +/users2/local/bin/tmscore MODEL2.pdb plik.pdb > tmscore2.out +/users2/local/bin/tmscore MODEL3.pdb plik.pdb > tmscore3.out +/users2/local/bin/tmscore MODEL4.pdb plik.pdb > tmscore4.out +/users2/local/bin/tmscore MODEL5.pdb plik.pdb > tmscore5.out + +#END +touch finished diff --git a/files/pbs_md.csh b/files/pbs_md.csh index d5344d9..8acaec5 100755 --- a/files/pbs_md.csh +++ b/files/pbs_md.csh @@ -39,7 +39,7 @@ else awk '{if ( NF == 10 ) print}' file_GB000.stat > md.stat endif -../../files/matplotlib_fit_hist.py $dimen3 +../files/matplotlib_fit_hist.py $dimen3 rm md.stat if ( -f "file_MD000.pdb" ) then diff --git a/files/pbs_md_new.csh b/files/pbs_md_new.csh new file mode 100755 index 0000000..6a678a8 --- /dev/null +++ b/files/pbs_md_new.csh @@ -0,0 +1,58 @@ +#PBS -N test_server +#PBS -q express +#PBS -l nodes=1:ppn=4 + +#----------------------------------------------------------------------------- +setenv UNRES_BIN /users2/czarek/UNRES/git3_tmp/build/bin/unresMD-mult_ifort_MPI_E0LL2Y.exe +#----------------------------------------------------------------------------- +setenv DD /users2/czarek/UNRES/git3_tmp/unres/PARAM +setenv BONDPAR $DD/bond_AM1_ext_dum.parm +setenv THETPAR $DD/theta_abinitio-ext-old.parm +setenv THETPARPDB $DD/thetaml_ext.5parm +setenv ROTPARPDB $DD/scgauss_ext.parm +setenv ROTPAR $DD/rotamers_AM1_aura_ext.10022007.parm +setenv TORPAR $DD/tor_opt_iter1_7p_old-ext.parm +setenv TORDPAR $DD/pot_tord_G631_DIL_ext.parm +setenv ELEPAR $DD/electr_631Gdp_ext.parm +setenv SIDEPAR $DD/sc_GB_opt_iter1_7p_old-ext_lip.parm +setenv FOURIER $DD/fourier_opt_iter1_7p_old-ext.parm +setenv SCCORPAR $DD/sccor_am1_pawel_ext.dat +setenv SCPPAR $DD/scp_ext.parm +setenv PATTERN $DD/patterns.cart +setenv LIPTRANPAR $DD/Lip_tran_initial_ext.parm +#----------------------------------------------------------------------------- +cd $PBS_O_WORKDIR + +setenv MPIRUN "/users2/local/mpich2-1.4.1p1_intel/bin/mpirun " +set NPROCS=`cat $PBS_NODEFILE | wc -l` + +setenv FGPROCS 4 +setenv POT GB +setenv PREFIX file +setenv OUT1FILE YES + +$MPIRUN -machinefile $PBS_NODEFILE -np $NPROCS $UNRES_BIN + +if ( `grep -c pdbref file.inp` ) then + awk '{if ( NF == 14 ) print}' file_GB000.stat > md.stat +else + awk '{if ( NF == 10 ) print}' file_GB000.stat > md.stat +endif + +../files/matplotlib_fit_hist.py $dimen3 +rm md.stat + +if ( -f "file_MD000.pdb" ) then + mkdir tmp + /users2/local/pymol_1.6/pymol -c ../files/movie.pml + ffmpeg2theora tmp/aa%4d.png -o md.ogv + rm -rf tmp +else + /users2/czarek/UNRES/git3_tmp/build/bin/xdrf2pdb-mult one file.seq file_MD000.cx + mkdir tmp + /users2/local/pymol_1.6/pymol -c ../files/movie.pml + ffmpeg2theora tmp/aa%4d.png -o md.ogv + rm -rf tmp file_MD000.pdb +endif + +touch finished diff --git a/files/pbs_new.csh b/files/pbs_new.csh new file mode 100755 index 0000000..5d733f6 --- /dev/null +++ b/files/pbs_new.csh @@ -0,0 +1,38 @@ +#PBS -N test_server +#PBS -q express +#PBS -l nodes=1:ppn=4 + +#----------------------------------------------------------------------------- +setenv UNRES_BIN /users2/czarek/UNRES/git3_tmp/build/bin/unresMD-mult_ifort_MPI_E0LL2Y.exe +#----------------------------------------------------------------------------- +setenv DD /users2/czarek/UNRES/git3_tmp/unres/PARAM +setenv BONDPAR $DD/bond_AM1_ext_dum.parm +setenv THETPAR $DD/theta_abinitio-ext-old.parm +setenv THETPARPDB $DD/thetaml_ext.5parm +setenv ROTPARPDB $DD/scgauss_ext.parm +setenv ROTPAR $DD/rotamers_AM1_aura_ext.10022007.parm +setenv TORPAR $DD/tor_opt_iter1_7p_old-ext.parm +setenv TORDPAR $DD/pot_tord_G631_DIL_ext.parm +setenv ELEPAR $DD/electr_631Gdp_ext.parm +setenv SIDEPAR $DD/sc_GB_opt_iter1_7p_old-ext_lip.parm +setenv FOURIER $DD/fourier_opt_iter1_7p_old-ext.parm +setenv SCCORPAR $DD/sccor_am1_pawel_ext.dat +setenv SCPPAR $DD/scp_ext.parm +setenv PATTERN $DD/patterns.cart +setenv LIPTRANPAR $DD/Lip_tran_initial_ext.parm +#----------------------------------------------------------------------------- +cd $PBS_O_WORKDIR + +setenv MPIRUN "/users2/local/mpich2-1.4.1p1_intel/bin/mpirun " +set NPROCS=`cat $PBS_NODEFILE | wc -l` + +setenv FGPROCS 4 +setenv POT GB +setenv PREFIX file +setenv OUT1FILE YES + +$MPIRUN -machinefile $PBS_NODEFILE -np $NPROCS $UNRES_BIN + +/users2/local/pymol_1.6/pymol -c ../files/pdb.pml + +touch finished