2020-06-24 19:09:05 +01:00
from flask_wtf import FlaskForm
from flask_wtf . file import FileField , FileRequired , FileAllowed
2020-08-06 07:46:50 +01:00
from wtforms import StringField , DecimalField , IntegerField , SelectField
2020-06-24 19:09:05 +01:00
from wtforms . validators import DataRequired , Email
class MyForm ( FlaskForm ) :
firstname = StringField ( ' First Name ' , validators = [ DataRequired ( ) ] )
lastname = StringField ( ' Last Name ' , validators = [ DataRequired ( ) ] )
email = StringField ( ' Email ' , validators = [ DataRequired ( ) , Email ( ) ] )
class curieForm ( FlaskForm ) :
ligand = FileField ( ' Ligand ' , validators = [
FileRequired ( ) ,
FileAllowed ( [ ' pdbqt ' , ' PDBQT only! ' ] )
] )
target = FileField ( ' Receptor / Target ' , validators = [
FileRequired ( ) ,
FileAllowed ( [ ' pdbqt ' , ' PDBQT only! ' ] )
] )
description = StringField ( ' Description ' , default = " Curie Web Task " )
size_x = DecimalField ( ' Size X ' , default = 25.0 )
size_y = DecimalField ( ' Size Y ' , default = 25.0 )
size_z = DecimalField ( ' Size Z ' , default = 25.0 )
center_x = DecimalField ( ' Center X ' , default = 0 )
center_y = DecimalField ( ' Center Y ' , default = 0 )
2020-06-24 19:33:26 +01:00
center_z = DecimalField ( ' Center Z ' , default = 0 )
2020-07-07 17:50:03 +01:00
email = StringField ( ' Email ' , validators = [ DataRequired ( ) , Email ( ) ] )
class statusForm ( FlaskForm ) :
2020-07-31 17:49:38 +01:00
jobID = StringField ( ' Job ID ' , validators = [ DataRequired ( ) ] )
2020-08-29 14:55:45 +01:00
class dockSingleForm ( FlaskForm ) :
description = StringField ( ' Description ' , default = " Curie Web Task " )
pdbID = StringField ( ' PDB ID ' , validators = [ DataRequired ( ) ] )
smiles = StringField ( ' SMILES ' , validators = [ DataRequired ( ) ] )
name = StringField ( ' Ligand Name ' , validators = [ DataRequired ( ) ] )
email = StringField ( ' Email ' , validators = [ DataRequired ( ) , Email ( ) ] )
2020-07-31 17:49:38 +01:00
class generateSMILES ( FlaskForm ) :
2020-08-06 07:46:50 +01:00
n = IntegerField ( ' Number of Molecules to Generate ' , default = 1 , validators = [ DataRequired ( ) ] )
2020-08-24 11:32:32 +01:00
#modelSelection = SelectField('Model',choices=[("alpha","Alpha"),("beta","Beta")])
2020-09-09 20:19:32 +01:00
class generatePDBQTS ( FlaskForm ) :
jobType = SelectField ( u ' Generate for Protein or Ligand ' , choices = [ ( " " , " Protein or Ligand " ) , ( ' protein ' , ' Protein (PDB) ' ) , ( ' ligand ' , ' Ligand (SMILES) ' ) ] , default = ' SelectOption ' )
pdb = StringField ( ' PDB ID ' )
smiles = StringField ( ' SMILES ' )
name = StringField ( ' Compound Name (Optional) ' )
2020-08-24 11:32:32 +01:00
class PyMedSearch ( FlaskForm ) :
2020-09-16 15:30:35 +01:00
query = StringField ( ' Search Query for PubMed ' , default = " Query " , validators = [ DataRequired ( ) ] )