help_text='maximum number of iterations')
min_maxfun = forms.IntegerField(label='MAXFUN',initial=15000,
help_text='maximum number of function evaluations')
- file1 = forms.FileField(label='Upload a PDB file',
+ file1 = forms.FileField(label='Upload a PDB file',required=False,
help_text='continuous (without breaks) protein chains,use TER to divide chains')
+ pdbid = forms.CharField(min_length=4,max_length=4,required=False,
+ widget=forms.TextInput(attrs={'size':4, 'maxlength':4, 'title':'PDB code'}),
+ label='or PDB code')
min_unres_pdb = forms.BooleanField(required=False,label='uploaded input unres PDB',
help_text='(CA and CB atoms only, CB represents SC in UNRES)')
boxz = forms.FloatField(label='Box Z',initial=1000.0,
help_text='box z dimension')
+ def clean(self):
+ cleaned_data = super(TaskForm_min_a, self).clean()
+
+ pdbid = cleaned_data.get("pdbid")
+ file1 = cleaned_data.get("file1")
+
+ if not pdbid and not file1:
+ msg = 'provide pdb file or pdb code'
+ self.add_error('file1', msg)
+
+ if pdbid:
+ test=urllib.urlopen('http://files.rcsb.org/download/'+pdbid+'.pdb')
+ if test.code != 200:
+ msg = 'wrong pdb code'
+ self.add_error('pdbid', msg)
+ test.close()
+
class TaskForm_md(forms.Form):
name = forms.CharField(max_length=20)
widget=forms.Textarea(attrs={'cols': 70, 'rows': 2}))
file1 = forms.FileField(label='Upload a PDB file',required=False,
help_text='starting structure for pdbstart/reference structure')
+ pdbid = forms.CharField(min_length=4,max_length=4,required=False,
+ widget=forms.TextInput(attrs={'size':4, 'maxlength':4, 'title':'PDB code'}),
+ label='or PDB code')
md_pdbref = forms.BooleanField(required=False,label='PDB reference structure')
md_temp = forms.FloatField(label='temperature',initial=300,
help_text='bath temperature')
md_start = cleaned_data.get("md_start")
file1 = cleaned_data.get("file1")
+ pdbid = cleaned_data.get("pdbid")
md_seq = cleaned_data.get("md_seq")
md_pdbref = cleaned_data.get("md_pdbref")
- if md_start == 'pdbstart' and not file1:
- msg = 'pdbstart with no PDB file'
+ if md_start == 'pdbstart' and not (file1 or pdbid):
+ msg = 'pdbstart with no PDB file or code'
self.add_error('file1', msg)
- if md_pdbref and not file1:
- msg = 'pdbref with no PDB file'
+ if md_pdbref and not (file1 or pdbid):
+ msg = 'pdbref with no PDB file or code'
self.add_error('file1', msg)
msg = 'extended/random chain with no sequence'
self.add_error('md_seq', msg)
+ if pdbid:
+ test=urllib.urlopen('http://files.rcsb.org/download/'+pdbid+'.pdb')
+ if test.code != 200:
+ msg = 'wrong pdb code'
+ self.add_error('pdbid', msg)
+ test.close()
+
class TaskForm_md_a(forms.Form):
name = forms.CharField(max_length=20)
widget=forms.Textarea(attrs={'cols': 70, 'rows': 2}))
file1 = forms.FileField(label='Upload a PDB file',required=False,
help_text='starting structure for pdbstart/reference structure')
+ pdbid = forms.CharField(min_length=4,max_length=4,required=False,
+ widget=forms.TextInput(attrs={'size':4, 'maxlength':4, 'title':'PDB code'}),
+ label='or PDB code')
md_pdbref = forms.BooleanField(required=False,label='PDB reference structure')
md_temp = forms.FloatField(label='temperature',initial=300,
help_text='bath temperature')
md_start = cleaned_data.get("md_start")
file1 = cleaned_data.get("file1")
+ pdbid = cleaned_data.get("pdbid")
md_seq = cleaned_data.get("md_seq")
md_pdbref = cleaned_data.get("md_pdbref")
- if md_start == 'pdbstart' and not file1:
- msg = 'pdbstart with no PDB file'
+ if md_start == 'pdbstart' and not (file1 or pdbid):
+ msg = 'pdbstart with no PDB file or code'
self.add_error('file1', msg)
- if md_pdbref and not file1:
- msg = 'pdbref with no PDB file'
+ if md_pdbref and not (file1 or pdbid):
+ msg = 'pdbref with no PDB file or code'
self.add_error('file1', msg)
msg = 'extended/random chain with no sequence'
self.add_error('md_seq', msg)
+ if pdbid:
+ test=urllib.urlopen('http://files.rcsb.org/download/'+pdbid+'.pdb')
+ if test.code != 200:
+ msg = 'wrong pdb code'
+ self.add_error('pdbid', msg)
+ test.close()
+
class TaskForm_remd(forms.Form):
name = forms.CharField(max_length=20)
widget=forms.Textarea(attrs={'cols': 70, 'rows': 2}))
file1 = forms.FileField(label='Upload a PDB file',required=False,
help_text='starting structure for pdbstart/reference structure')
+ pdbid = forms.CharField(min_length=4,max_length=4,required=False,
+ widget=forms.TextInput(attrs={'size':4, 'maxlength':4, 'title':'PDB code'}),
+ label='or PDB code')
md_pdbref = forms.BooleanField(required=False,label='PDB reference structure')
md_nstep = forms.IntegerField(label='NSTEP',initial=200000,
help_text='total number of steps')
md_start = cleaned_data.get("md_start")
file1 = cleaned_data.get("file1")
+ pdbid = cleaned_data.get("pdbid")
md_seq = cleaned_data.get("md_seq")
md_pdbref = cleaned_data.get("md_pdbref")
- if md_start == 'pdbstart' and not file1:
- msg = 'pdbstart with no PDB file'
+ if md_start == 'pdbstart' and not (file1 or pdbid):
+ msg = 'pdbstart with no PDB file or code'
self.add_error('file1', msg)
- if md_pdbref and not file1:
- msg = 'pdbref with no PDB file'
+ if md_pdbref and not (file1 or pdbid):
+ msg = 'pdbref with no PDB file or code'
self.add_error('file1', msg)
if md_start != 'pdbstart' and not md_pdbref and not md_seq:
msg = 'extended/random chain with no sequence'
self.add_error('md_seq', msg)
+ if pdbid:
+ test=urllib.urlopen('http://files.rcsb.org/download/'+pdbid+'.pdb')
+ if test.code != 200:
+ msg = 'wrong pdb code'
+ self.add_error('pdbid', msg)
+ test.close()
+
class TaskForm_remd_a(forms.Form):
name = forms.CharField(max_length=20)
widget=forms.Textarea(attrs={'cols': 70, 'rows': 2}))
file1 = forms.FileField(label='Upload a PDB file',required=False,
help_text='starting structure for pdbstart/reference structure')
+ pdbid = forms.CharField(min_length=4,max_length=4,required=False,
+ widget=forms.TextInput(attrs={'size':4, 'maxlength':4, 'title':'PDB code'}),
+ label='or PDB code')
md_pdbref = forms.BooleanField(required=False,label='PDB reference structure')
md_nstep = forms.IntegerField(label='NSTEP',initial=200000,
help_text='total number of steps')
md_start = cleaned_data.get("md_start")
file1 = cleaned_data.get("file1")
+ pdbid = cleaned_data.get("pdbid")
md_seq = cleaned_data.get("md_seq")
md_pdbref = cleaned_data.get("md_pdbref")
- if md_start == 'pdbstart' and not file1:
- msg = 'pdbstart with no PDB file'
+ if md_start == 'pdbstart' and not (file1 or pdbid):
+ msg = 'pdbstart with no PDB file or code'
self.add_error('file1', msg)
- if md_pdbref and not file1:
- msg = 'pdbref with no PDB file'
+ if md_pdbref and not (file1 or pdbid):
+ msg = 'pdbref with no PDB file or code'
self.add_error('file1', msg)
msg = 'extended/random chain with no sequence'
self.add_error('md_seq', msg)
+ if pdbid:
+ test=urllib.urlopen('http://files.rcsb.org/download/'+pdbid+'.pdb')
+ if test.code != 200:
+ msg = 'wrong pdb code'
+ self.add_error('pdbid', msg)
+ test.close()
+
+
class TaskForm_list(forms.Form):
name = forms.CharField(max_length=20,disabled=True,required=False)
<div class="col-xs-10">{{ task.myfile1 }}</div>
</li>
<li class="list-group-item task-item">
+ <div class="col-xs-10"> pdb code</div>
+ <div class="col-xs-10">{{ task.pdbcode }}</div>
+ </li>
+ <li class="list-group-item task-item">
<div class="col-xs-10"> seed </div>
<div class="col-xs-10">{{ task.md_seed}}</div>
</li>
<div class="col-xs-10">{{ task.myfile1 }}</div>
</li>
<li class="list-group-item task-item">
+ <div class="col-xs-10"> pdb code</div>
+ <div class="col-xs-10">{{ task.pdbcode }}</div>
+ </li>
+ <li class="list-group-item task-item">
<div class="col-xs-10"> seed </div>
<div class="col-xs-10">{{ task.md_seed}}</div>
</li>
<div class="col-xs-10">{{ task.myfile1 }}</div>
</li>
<li class="list-group-item task-item">
+ <div class="col-xs-10"> pdb code</div>
+ <div class="col-xs-10">{{ task.pdbcode }}</div>
+ </li>
+ <li class="list-group-item task-item">
<div class="col-xs-10"> unres_pdb</div>
<div class="col-xs-10">{{ task.min_unres_pdb }}</div>
</li>
<div class="col-xs-10">{{ task.myfile1 }}</div>
</li>
<li class="list-group-item task-item">
+ <div class="col-xs-10"> pdb code</div>
+ <div class="col-xs-10">{{ task.pdbcode }}</div>
+ </li>
+ <li class="list-group-item task-item">
<div class="col-xs-10"> seed </div>
<div class="col-xs-10">{{ task.md_seed}}</div>
</li>
<div class="col-xs-10">{{ task.myfile1 }}</div>
</li>
<li class="list-group-item task-item">
+ <div class="col-xs-10"> pdb code</div>
+ <div class="col-xs-10">{{ task.pdbcode }}</div>
+ </li>
+ <li class="list-group-item task-item">
<div class="col-xs-10"> seed </div>
<div class="col-xs-10">{{ task.md_seed}}</div>
</li>
def add_min_a(request,task_id):
task = get_object_or_404(Task, id=task_id)
if request.method == 'POST':
+ if '_example' in request.POST:
+ data= {'name':task.name,'pdbid':'1EI0'}
+ form = TaskForm_min_a(initial=data)
+ else:
form = TaskForm_min_a(request.POST,request.FILES)
if form.is_valid():
task.name=form.cleaned_data["name"]
task.min_maxmin=form.cleaned_data["min_maxmin"]
task.min_maxfun=form.cleaned_data["min_maxfun"]
task.min_pdbout=form.cleaned_data["min_pdbout"]
- task.myfile1=form.cleaned_data["file1"]
+
+ basename = str(task.owner)
+ suffix = datetime.datetime.now().strftime("%y%m%d_%H%M%S")
+ task.jobdirname = "_".join([basename, suffix])
+
+ pdbid=form.cleaned_data["pdbid"]
+ if pdbid:
+ os.mkdir(task.jobdirname)
+ task.myfile1,header=urllib.urlretrieve('http://files.rcsb.org/download/'+pdbid+'.pdb',
+ task.jobdirname+'/plik.pdb')
+ task.pdbcode=pdbid
+ else:
+ task.myfile1=form.cleaned_data["file1"]
+
task.min_unres_pdb=form.cleaned_data["min_unres_pdb"]
task.unres_ff=form.cleaned_data["unres_ff"]
task.boxx=form.cleaned_data["boxx"]
for i in range(0,len(seq),40):
task.md_seq=task.md_seq+seq[i:i+40]+" "
-
task.ready=True
- basename = str(task.owner)
- suffix = datetime.datetime.now().strftime("%y%m%d_%H%M%S")
- task.jobdirname = "_".join([basename, suffix])
task.save()
if is_lazy_user(request.user):
def add_md(request,task_id):
task = get_object_or_404(Task, id=task_id)
if request.method == 'POST':
+ if '_example' in request.POST:
+ data= {'name':task.name,'pdbid':'1IGD','md_start':'pdbstart',
+ 'md_pdbref':True,'md_temp':250}
+ form = TaskForm_md(initial=data)
+ else:
form = TaskForm_md(request.POST,request.FILES)
if form.is_valid():
task.name=form.cleaned_data["name"]
task.md_start=form.cleaned_data["md_start"]
task.md_temp=form.cleaned_data["md_temp"]
task.md_nstep=form.cleaned_data["md_nstep"]
-
- task.myfile1=form.cleaned_data["file1"]
+
+ basename = str(task.owner)
+ suffix = datetime.datetime.now().strftime("%y%m%d_%H%M%S")
+ task.jobdirname = "_".join([basename, suffix])
+
+ pdbid=form.cleaned_data["pdbid"]
+ if pdbid:
+ os.mkdir(task.jobdirname)
+ task.myfile1,header=urllib.urlretrieve('http://files.rcsb.org/download/'+pdbid+'.pdb',
+ task.jobdirname+'/plik.pdb')
+ task.pdbcode=pdbid
+ else:
+ task.myfile1=form.cleaned_data["file1"]
task.md_pdbref=form.cleaned_data["md_pdbref"]
task.md_seq=""
task.ssbond=''
task.ready=True
- basename = str(task.owner)
- suffix = datetime.datetime.now().strftime("%y%m%d_%H%M%S")
- task.jobdirname = "_".join([basename, suffix])
task.save()
if is_lazy_user(request.user):
def add_md_a(request,task_id):
task = get_object_or_404(Task, id=task_id)
if request.method == 'POST':
+ if '_example' in request.POST:
+ data= {'name':task.name,'pdbid':'1FSD','md_start':'extconf',
+ 'md_pdbref':True,'md_lang':'berendsen'}
+ form = TaskForm_md_a(initial=data)
+ else:
form = TaskForm_md_a(request.POST,request.FILES)
if form.is_valid():
task.name=form.cleaned_data["name"]
task.type="md"
- task.myfile1=form.cleaned_data["file1"]
+ basename = str(task.owner)
+ suffix = datetime.datetime.now().strftime("%y%m%d_%H%M%S")
+ task.jobdirname = "_".join([basename, suffix])
+
+ pdbid=form.cleaned_data["pdbid"]
+ if pdbid:
+ os.mkdir(task.jobdirname)
+ task.myfile1,header=urllib.urlretrieve('http://files.rcsb.org/download/'+pdbid+'.pdb',
+ task.jobdirname+'/plik.pdb')
+ task.pdbcode=pdbid
+ else:
+ task.myfile1=form.cleaned_data["file1"]
task.md_start=form.cleaned_data["md_start"]
task.md_pdbref=form.cleaned_data["md_pdbref"]
task.ready=True
- basename = str(task.owner)
- suffix = datetime.datetime.now().strftime("%y%m%d_%H%M%S")
- task.jobdirname = "_".join([basename, suffix])
task.save()
if is_lazy_user(request.user):
def add_remd(request,task_id):
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_pdbref':True}
+ form = TaskForm_remd(initial=data)
+ else:
form = TaskForm_remd(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.myfile1=form.cleaned_data["file1"]
+
+ basename = str(task.owner)
+ suffix = datetime.datetime.now().strftime("%y%m%d_%H%M%S")
+ task.jobdirname = "_".join([basename, suffix])
+
+ pdbid=form.cleaned_data["pdbid"]
+ if pdbid:
+ os.mkdir(task.jobdirname)
+ task.myfile1,header=urllib.urlretrieve('http://files.rcsb.org/download/'+pdbid+'.pdb',
+ task.jobdirname+'/plik.pdb')
+ task.pdbcode=pdbid
+ else:
+ task.myfile1=form.cleaned_data["file1"]
task.md_pdbref=form.cleaned_data["md_pdbref"]
task.md_ntwx=task.remd_nstex
task.ready=True
- basename = str(task.owner)
- suffix = datetime.datetime.now().strftime("%y%m%d_%H%M%S")
- task.jobdirname = "_".join([basename, suffix])
task.save()
if is_lazy_user(request.user):
def add_remd_a(request,task_id):
task = get_object_or_404(Task, id=task_id)
if request.method == 'POST':
+ if '_example' in request.POST:
+ data= {'name':task.name,'pdbid':'1E0G','md_pdbref':True,
+ 'md_nstep':500000,'md_lang':'berendsen','unres_ff':'opt-wtfsa-2'}
+ form = TaskForm_remd_a(initial=data)
+ else:
form = TaskForm_remd_a(request.POST,request.FILES)
if form.is_valid():
task.name=form.cleaned_data["name"]
task.type="remd"
- task.myfile1=form.cleaned_data["file1"]
+ basename = str(task.owner)
+ suffix = datetime.datetime.now().strftime("%y%m%d_%H%M%S")
+ task.jobdirname = "_".join([basename, suffix])
+
+ pdbid=form.cleaned_data["pdbid"]
+ if pdbid:
+ os.mkdir(task.jobdirname)
+ task.myfile1,header=urllib.urlretrieve('http://files.rcsb.org/download/'+pdbid+'.pdb',
+ task.jobdirname+'/plik.pdb')
+ task.pdbcode=pdbid
+ else:
+ task.myfile1=form.cleaned_data["file1"]
task.md_start=form.cleaned_data["md_start"]
task.md_pdbref=form.cleaned_data["md_pdbref"]
task.boxy=form.cleaned_data["boxy"]
task.boxz=form.cleaned_data["boxz"]
-
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")
- task.jobdirname = "_".join([basename, suffix])
-
task.save()
return redirect('addmlist',task_id=task.id)
else: