if msg != '':
self.add_error('file2',msg)
+class TaskForm_dock_a(forms.Form):
+ name = forms.CharField(max_length=40,widget=forms.TextInput(attrs={'size':40, 'maxlength':40}))
+
+ file1 = forms.FileField(label='Upload a PDB file1',required=False,
+ help_text='starting structure for chain1')
+ pdbid = forms.CharField(min_length=4,max_length=6,required=False,
+ widget=forms.TextInput(attrs={'size':6, 'maxlength':6, 'title':'PDB code or PDB code:chain id'}),
+ label='or PDB code (:chain)')
+
+
+ file2 = forms.FileField(label='Upload a PDB file2',required=False,
+ help_text='starting structure for chain2')
+ pdbid2 = forms.CharField(min_length=4,max_length=6,required=False,
+ widget=forms.TextInput(attrs={'size':6, 'maxlength':6, 'title':'PDB code or PDB code:chain id'}),
+ label='or PDB code (:chain)')
+
+
+ md_nstep = forms.IntegerField(label='NSTEP',initial=200000,
+ help_text='total number of steps', max_value=10000000)
+ md_seed = forms.IntegerField(label='SEED',initial=-39912345,
+ help_text='seed for random number generator')
+
+
+ unres_ff = forms.ChoiceField(choices=FF_CHOICE,widget=forms.RadioSelect,
+ label='Force Field',initial='FF2')
+
+ md_ntwe = forms.IntegerField(label='NTWE',initial=1000,
+ help_text='write statfile every ntwe steps')
+ md_dt = forms.FloatField(label='DT',initial=0.2,
+ help_text='time step [mtu = 48.9 fs]')
+ md_lang = forms.ChoiceField(choices=MD_LANG,label='thermostat')
+ md_tau = forms.FloatField(label='tau_bath',initial=1.0,
+ help_text='coupling to the thermal bath (Berendsen)')
+ md_scal_fric = forms.FloatField(label='scal_froc',initial=0.02,
+ help_text='scaling of the friction coefficients (Langevin)')
+ min_maxfun = forms.IntegerField(label='MAXFUN',initial=5000,
+ help_text='preminim maximum number of function evaluations<br>'+
+ 'used for start from pdb or random start')
+ remd_nrep = forms.IntegerField(label='NREP',initial=8,
+ help_text='number of replicas')
+ remd_nstex = forms.IntegerField(label='NSTEX',initial=1000,
+ help_text='exchange and write trajectory every nstex steps')
+ md_ntwx = forms.IntegerField(label='NTWX',initial=1000,min_value=100,
+ help_text='write trajectory every ntwx steps')
+ remd_cluter_temp = forms.FloatField(label='TEMPER',
+ help_text='temperature for cluster analysis',initial=280)
+
+
+ def clean(self):
+ cleaned_data = super(TaskForm_dock_a, self).clean()
+
+ file1 = cleaned_data.get("file1")
+ pdbid = cleaned_data.get("pdbid")
+ file2 = cleaned_data.get("file2")
+ pdbid2 = cleaned_data.get("pdbid2")
+
+
+ if not (file1 or pdbid):
+ msg = 'no PDB file or code for chain1'
+ self.add_error('file1', msg)
+
+ if not (file2 or pdbid2):
+ msg = 'no PDB file or code for chain2'
+ self.add_error('file2', msg)
+
+ if pdbid:
+ msg=pdb_code_chain(pdbid)
+ if msg != '':
+ self.add_error('pdbid',msg)
+
+ if file1:
+ msg=pdb_missing_res_chain(file1,'')
+ if msg != '':
+ self.add_error('file1',msg)
+
+ if pdbid2:
+ msg=pdb_code_chain(pdbid2)
+ if msg != '':
+ self.add_error('pdbid2',msg)
+
+ if file2:
+ msg=pdb_missing_res_chain(file2,'')
+ if msg != '':
+ self.add_error('file2',msg)
+
class TaskForm_list(forms.Form):
name = forms.CharField(max_length=40,disabled=True,required=False)
if instance.type == 'min' or instance.md_start == 'pdbstart':
if instance.type == 'dock':
- f.write('model01.pdb\n')
+ f.write('plik1ter.pdb\n')
else:
f.write('plik.pdb\n')
f.write(write_ssbond(instance.ssbond))
f2.write(line.replace('$ssbond',tmp_ss))
elif 'cd $PBS_O_WORKDIR' in line and instance.type == 'dock':
f2.write(line)
- f2.write('../files/generator_v7 plik.pdb plik2.pdb\n')
+ f2.write('../files/generator_v12a plik.pdb plik2.pdb 0 \n')
+ f2.write("sed '/END/q' plik.pdb |grep ATOM > plik1ter.pdb \n")
+ f2.write("echo TER >> plik1ter.pdb \n")
+ f2.write("sed '/END/q' plik2.pdb |grep ATOM >> plik1ter.pdb \n")
else:
tmp1=json.loads(instance.remd_multi_t)
f2.write(line.replace('$temperatures','"'+" ".join(tmp1)+'" '+str(nreplicas)))
f.write('file_MD000\n')
if instance.md_pdbref:
f.write('pdbref\n')
- f.write('plik.pdb\n')
+ if instance.type == 'dock':
+ f.write('plik1ter.pdb\n')
+ else:
+ f.write('plik.pdb\n')
with open(instance.jobdirname+'/file_cluster.inp','w') as f:
The scale-consistent NEWCT-9P force field added in advanced mode.<br>
</dd>
+<dt>4.02.2020</dt>
+ <dd>
+ A beta version of docking of two proteins with random starting orientations
+ added.<br>
+ </dd>
+
</dl>
<h3 style="text-align:left;float:left;"> Choose type of simulation:
  </h3>
-
+<br />
+<br />
+<br />
{% if basic_adv %}
<form action="adv/" method="get" style="text-align;float:right;">
{% csrf_token %}
{% endif %}
-
+<br />
<hr style="clear:both;"/>
<h4>
task = get_object_or_404(Task, id=task_id)
if request.method == 'POST':
if '_example' in request.POST:
- data= {'name':task.name,'pdbid':'1L2Y','md_seed':-39912345}
+ data= {'name':task.name,'pdbid':'1BON:A','pdbid2':'1BON:B','md_seed':-12396738,'md_nstep':500000}
form = TaskForm_dock(initial=data)
else:
form = TaskForm_dock(request.POST,request.FILES)
task.md_ntwx=task.remd_nstex
task.md_start="pdbstart"
+ task.remd_multi_m='["3", "3", "3", "3", "3", "3", "3", "3"]'
task.md_pdbref=True
task.md_respa=False
task.ssbond=""
task.md_seed=form.cleaned_data["md_seed"]
task.md_nstep=form.cleaned_data["md_nstep"]
+ task.md_total_steps=task.md_nstep
if any(c.islower() for c in seq):
task.md_respa=False
if request.method == 'POST':
if '_example' in request.POST:
data= {'name':task.name,'pdbid':'1L2Y','md_pdbref':True,'md_seed':-39912345}
- form = TaskForm_remd(initial=data)
+ form = TaskForm_dock_a(initial=data)
else:
- form = TaskForm_remd(request.POST,request.FILES)
+ form = TaskForm_dock_a(request.POST,request.FILES)
if form.is_valid():
task.name=form.cleaned_data["name"]
- task.type="remd"
- task.md_start=form.cleaned_data["md_start"]
+ task.type="dock"
basename = str(task.owner)
suffix = datetime.datetime.now().strftime("%y%m%d_%H%M%S")
task.pdbcode=pdbid
else:
task.myfile1=form.cleaned_data["file1"]
- task.md_pdbref=form.cleaned_data["md_pdbref"]
- task.md_ntwx=task.remd_nstex
+
+ pdbid2=form.cleaned_data["pdbid2"]
+ if pdbid2:
+ task.myfile2=load_pdbid(pdbid2,task.jobdirname,'plik2.pdb')
+ task.pdbcode2=pdbid2
+ else:
+ task.myfile2=form.cleaned_data["file2"]
+ task.md_ntwx=task.remd_nstex
+ task.md_start="pdbstart"
+ task.md_pdbref=True
+ task.md_respa=False
+ task.ssbond=""
+
task.md_seq=""
- if task.md_start == "pdbstart" or task.md_pdbref:
- seq,task.ssbond=from_pdb(task.myfile1)
+
+ seq1,ssbond1=from_pdb(task.myfile1)
+ seq2,ssbond2=from_pdb(task.myfile2)
+
+ if seq1[-1]=='X' and seq2[0]=='X':
+ seq=seq1+seq2
+ elif seq1[-1]!='X' and seq2[0]!='X':
+ seq=seq1+'XX'+seq2
else:
- seq=seq_add_x(form.cleaned_data["md_seq"])
+ seq=seq1+'X'+seq2
+
for i in range(0,len(seq),40):
task.md_seq=task.md_seq+seq[i:i+40]+" "
- if task.md_start != "pdbstart":
- task.ssbond=''
-
task.md_seed=form.cleaned_data["md_seed"]
task.md_nstep=form.cleaned_data["md_nstep"]
+ task.md_total_steps=task.md_nstep
+
+ task.md_dt=form.cleaned_data["md_dt"]
+ task.md_lang=form.cleaned_data["md_lang"]
+ task.md_tau=form.cleaned_data["md_tau"]
+ task.md_scal_fric=form.cleaned_data["md_scal_fric"]
+ task.min_maxfun=form.cleaned_data["min_maxfun"]
+ task.remd_nrep=form.cleaned_data["remd_nrep"]
+ task.remd_nstex=form.cleaned_data["remd_nstex"]
+ task.md_ntwx=form.cleaned_data["md_ntwx"]
+ task.md_ntwe=form.cleaned_data["md_ntwe"]
+
+ task.remd_cluter_temp=form.cleaned_data["remd_cluter_temp"]
+ task.unres_ff=form.cleaned_data["unres_ff"]
if any(c.islower() for c in seq):
task.md_respa=False
task.save()
- if is_lazy_user(request.user):
- return redirect('/details1/'+str(task.owner)+'/'+str(task.id)+'/')
- else:
- return redirect('/')
+ return redirect('addmlist',task_id=task.id)
+
else:
data= {'name':task.name,'md_seed':-random.randint(10000000,99999999)}
- form = TaskForm_remd(initial=data)
+ form = TaskForm_dock_a(initial=data)
basic_adv=False
p_type='docking - advanced options'
return render(request, 'edit.html', {'form': form, 'task':task, 'basic_adv':basic_adv, 'p_type':p_type})
task.results_text=text
- if task.md_pdbref and task.type=='remd':
+ if task.md_pdbref and task.type=='remd' or task.type=='dock':
for i in range(1,6):
try:
- if task.type=='remd':
+ if task.type=='remd' or task.type=='dock':
with open(task.jobdirname+'/file_cluster_clust.out_000', 'r') as f:
for line in f:
if ( `grep -c pdbref file.inp` ) then
awk '{printf "%s%s%s\n",substr($0,0,21)," ",substr($0,23)}' plik.pdb > tmp.pdb
+ if ( -f "plik1ter.pdb" ) then
+ grep -v TER plik1ter.pdb | awk '{printf "%s%s%s\n",substr($0,0,21)," ",substr($0,23)}' > tmp.pdb
+ endif
/users2/local/mmtsb/perl/convpdb.pl -renumber 1 -out generic tmp.pdb > plik1.pdb
rm tmp.pdb
+
/users2/local/bin/tmscore MODEL1.pdb plik1.pdb > tmscore1.out
/users2/local/bin/tmscore MODEL2.pdb plik1.pdb > tmscore2.out
/users2/local/bin/tmscore MODEL3.pdb plik1.pdb > tmscore3.out
if ( `grep -c pdbref file.inp` ) then
awk '{printf "%s%s%s\n",substr($0,0,21)," ",substr($0,23)}' plik.pdb > tmp.pdb
+ if ( -f "plik1ter.pdb" ) then
+ grep -v TER plik1ter.pdb | awk '{printf "%s%s%s\n",substr($0,0,21)," ",substr($0,23)}' > tmp.pdb
+ endif
/users2/local/mmtsb/perl/convpdb.pl -renumber 1 -out generic tmp.pdb > plik1.pdb
rm tmp.pdb
if ( `grep -c pdbref file.inp` ) then
awk '{printf "%s%s%s\n",substr($0,0,21)," ",substr($0,23)}' plik.pdb > tmp.pdb
+ if ( -f "plik1ter.pdb" ) then
+ grep -v TER plik1ter.pdb | awk '{printf "%s%s%s\n",substr($0,0,21)," ",substr($0,23)}' > tmp.pdb
+ endif
/users2/local/mmtsb/perl/convpdb.pl -renumber 1 -out generic tmp.pdb > plik1.pdb
rm tmp.pdb