projects
/
django_unres.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
secondary structure restraints for md and remd
[django_unres.git]
/
django_simple
/
todo
/
forms.py
diff --git
a/django_simple/todo/forms.py
b/django_simple/todo/forms.py
index
5eb67fb
..
c0b1667
100644
(file)
--- a/
django_simple/todo/forms.py
+++ b/
django_simple/todo/forms.py
@@
-7,6
+7,14
@@
from .models import FF_CHOICE
import json
import urllib
import json
import urllib
+def code_2d(line):
+ msg=''
+ set ='HEC-'
+ line2 = ''.join([c for c in line if c in set])
+ if line2 != line:
+ msg='use only H,E,C or - letters'
+ return(msg)
+
def pdb_missing_res(file):
msg=''
newchain = True
def pdb_missing_res(file):
msg=''
newchain = True
@@
-230,6
+238,11
@@
class TaskForm_md_a(forms.Form):
'field is ignored when uploading starting/reference PDB file',
required=False,
widget=forms.Textarea(attrs={'cols': 70, 'rows': 2}))
'field is ignored when uploading starting/reference PDB file',
required=False,
widget=forms.Textarea(attrs={'cols': 70, 'rows': 2}))
+ md_2d = forms.CharField(label='Secondary structure restraints',
+ help_text='single letter code: H - helix, E - extended/beta, C or - no restraints',
+ required=False,
+ 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,
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,
@@
-254,6
+267,7
@@
class TaskForm_md_a(forms.Form):
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)')
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)')
+ md_respa = forms.BooleanField(required=False,initial=True,label='RESPA')
md_mdpdb = forms.BooleanField(required=False,label='trajectory as PDB')
boxx = forms.FloatField(label='Box X',initial=1000.0,
md_mdpdb = forms.BooleanField(required=False,label='trajectory as PDB')
boxx = forms.FloatField(label='Box X',initial=1000.0,
@@
-271,6
+285,7
@@
class TaskForm_md_a(forms.Form):
pdbid = cleaned_data.get("pdbid")
md_seq = cleaned_data.get("md_seq")
md_pdbref = cleaned_data.get("md_pdbref")
pdbid = cleaned_data.get("pdbid")
md_seq = cleaned_data.get("md_seq")
md_pdbref = cleaned_data.get("md_pdbref")
+ md_2d = cleaned_data.get("md_2d")
if md_start == 'pdbstart' and not (file1 or pdbid):
msg = 'pdbstart with no PDB file or code'
if md_start == 'pdbstart' and not (file1 or pdbid):
msg = 'pdbstart with no PDB file or code'
@@
-300,7
+315,11
@@
class TaskForm_md_a(forms.Form):
msg=pdb_missing_res(file1)
if msg != '':
self.add_error('file1',msg)
msg=pdb_missing_res(file1)
if msg != '':
self.add_error('file1',msg)
-
+
+ if md_2d:
+ msg=code_2d(md_2d)
+ if msg != '':
+ self.add_error('md_2d',msg)
class TaskForm_remd(forms.Form):
name = forms.CharField(max_length=20)
class TaskForm_remd(forms.Form):
name = forms.CharField(max_length=20)
@@
-373,6
+392,10
@@
class TaskForm_remd_a(forms.Form):
'field is ignored when uploading starting/reference PDB file',
required=False,
widget=forms.Textarea(attrs={'cols': 70, 'rows': 2}))
'field is ignored when uploading starting/reference PDB file',
required=False,
widget=forms.Textarea(attrs={'cols': 70, 'rows': 2}))
+ md_2d = forms.CharField(label='Secondary structure restraints',
+ help_text='single letter code: H - helix, E - extended/beta, C or - no restraints',
+ required=False,
+ 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,
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,
@@
-403,6
+426,8
@@
class TaskForm_remd_a(forms.Form):
# remd_traj1file = forms.BooleanField(required=False,label='single trajectory file',initial='true')
# remd_rest1file = forms.BooleanField(required=False,label='single restart file',initial='true')
# remd_traj1file = forms.BooleanField(required=False,label='single trajectory file',initial='true')
# remd_rest1file = forms.BooleanField(required=False,label='single restart file',initial='true')
+ md_respa = forms.BooleanField(required=False,initial=True,label='RESPA')
+
boxx = forms.FloatField(label='Box X',initial=1000.0,
help_text='box x dimension')
boxy = forms.FloatField(label='Box Y',initial=1000.0,
boxx = forms.FloatField(label='Box X',initial=1000.0,
help_text='box x dimension')
boxy = forms.FloatField(label='Box Y',initial=1000.0,
@@
-429,6
+454,7
@@
class TaskForm_remd_a(forms.Form):
pdbid = cleaned_data.get("pdbid")
md_seq = cleaned_data.get("md_seq")
md_pdbref = cleaned_data.get("md_pdbref")
pdbid = cleaned_data.get("pdbid")
md_seq = cleaned_data.get("md_seq")
md_pdbref = cleaned_data.get("md_pdbref")
+ md_2d = cleaned_data.get("md_2d")
if md_start == 'pdbstart' and not (file1 or pdbid):
msg = 'pdbstart with no PDB file or code'
if md_start == 'pdbstart' and not (file1 or pdbid):
msg = 'pdbstart with no PDB file or code'
@@
-459,6
+485,11
@@
class TaskForm_remd_a(forms.Form):
if msg != '':
self.add_error('file1',msg)
if msg != '':
self.add_error('file1',msg)
+ if md_2d:
+ msg=code_2d(md_2d)
+ if msg != '':
+ self.add_error('md_2d',msg)
+
class TaskForm_list(forms.Form):
class TaskForm_list(forms.Form):