titration_db/titdb.py
def selectpKD(self):
        """Allow user to select a protein and field for pKD"""

        self.showHeader(menu=1)
        sys.stdout.flush()
        DB = self.DB = self.connect()

        names = []
        for p in DB.getRecs():
            names.append((DB[p].name,p))
        names.sort()
        nucl = ['1H NMR', '15N NMR', '13C NMR']

        #check pKD available calcs
        P = pKDInterface()
        pkdprots = [string.upper(e[0]) for e in P.getProteins()]

        #add selection boxes
        print '<div align=left>'
        print '<form name="pkdform" action="%s/main.cgi" METHOD="POST" ENCTYPE="multipart/form-data">' %self.bindir
        self.write_sessionkey('showpKD')

        print '<big>Select experimental curves to compare with calculated curves in pKD</big><br>'
        print '<a>This will show a set of plots for each residue where there is an experimental and calculated curve</a><p>'
        print 'Choose the protein and nucleus:<p>'
        print '<select name="protein" class="btn">'
        for n in names:
            print '<option value="%s">%s</option>' %(n[1],n[0])
        print '</select>'
        print '<select name="column" class="btn">'
        for c in nucl:
            print '<option value="%s">%s</option>' %(c,c)
        print '</select>'
        print '<p>'
        #button
        print '<input type=submit value="Display Plots" name=submit class="btn">'
        print '<label><input type=radio name="option" value=1 checked="yes">compare both</label>'
        print '<label><input type=radio name="option" value=2>exp only</label>'
        print '<label><input type=radio name="option" value=3>calcs only</label>'
        print '</form>'

        print '</div>'
        print 'Below is a reference table showing which proteins in our DB currently have calculations in the pKD, with the PDB ID and PDB link.<br>'
        print 'If the protein is not yet available, you can go to <a href=http://enzyme.ucd.ie/cgi-bin/pKD/server_start.cgi target="blank"> \
                    the pKD page</a> and submit the calculation.<p>'
        #table of proteins and their PDBs
        print '<div align=left>'
        print '<table id="mytable" cellspacing="0">'
        r=0
        print '<th>Protein</th><th>PDB</th><th>Has pKD data</th>'
        for name in names:
            protein = name[1]
            protname = name[0]
            if not DB[protein].has_key('PDB_link'):
                continue
            pdbinfo = DB[protein].PDB_link
            if pdbinfo == '':
                continue
            pdbid = pdbinfo['text']
            pdblink = pdbinfo['link']
            if r % 2 == 0:
                cls = 'alt'
            else:
                cls = ''
            print '<tr>'
            print '<td class=%s> %s </td>' % (cls, protname)
            print '<td class=%s> <a href=%s target="blank"> %s</a> </td>' % (cls, pdblink, pdbid)
            if pdbid in pkdprots:
                status = 'yes'
            else:
                status = 'no'
            print '<td class=%s> <b>%s</b> </td>' %(cls, status)
            print '</tr>'
            r=r+1
        print '</table>'
        return
Allow user to select a protein and field for pKD
Allow user to select a protein and field for pKD
Allow user to select a protein and field for pKD
def selectpKD(self):
        self.showHeader(menu=1)
        sys.stdout.flush()
        DB = self.DB = self.connect()
        names = []
        for p in DB.getRecs():
            names.append((DB[p].name,p))
        names.sort()
        nucl = ['1H NMR', '15N NMR', '13C NMR']
        P = pKDInterface()
        pkdprots = [string.upper(e[0]) for e in P.getProteins()]
        print '<div align=left>'
        print '<form name="pkdform" action="%s/main.cgi" METHOD="POST" ENCTYPE="multipart/form-data">' %self.bindir
        self.write_sessionkey('showpKD')
        print '<big>Select experimental curves to compare with calculated curves in pKD</big><br>'
        print '<a>This will show a set of plots for each residue where there is an experimental and calculated curve</a><p>'
        print 'Choose the protein and nucleus:<p>'
        print '<select name="protein" class="btn">'
        for n in names:
            print '<option value="%s">%s</option>' %(n[1],n[0])
        print '</select>'
        print '<select name="column" class="btn">'
        for c in nucl:
            print '<option value="%s">%s</option>' %(c,c)
        print '</select>'
        print '<p>'
        print '<input type=submit value="Display Plots" name=submit class="btn">'
        print '<label><input type=radio name="option" value=1 checked="yes">compare both</label>'
        print '<label><input type=radio name="option" value=2>exp only</label>'
        print '<label><input type=radio name="option" value=3>calcs only</label>'
        print '</form>'
        print '</div>'
        print 'Below is a reference table showing which proteins in our DB currently have calculations in the pKD, with the PDB ID and PDB link.<br>'
        print 'If the protein is not yet available, you can go to <a href=http://enzyme.ucd.ie/cgi-bin/pKD/server_start.cgi target="blank"> \
                    the pKD page</a> and submit the calculation.<p>'
        print '<div align=left>'
        print '<table id="mytable" cellspacing="0">'
        r=0
        print '<th>Protein</th><th>PDB</th><th>Has pKD data</th>'
        for name in names:
            protein = name[1]
            protname = name[0]
            if not DB[protein].has_key('PDB_link'):
                continue
            pdbinfo = DB[protein].PDB_link
            if pdbinfo == '':
                continue
            pdbid = pdbinfo['text']
            pdblink = pdbinfo['link']
            if r % 2 == 0:
                cls = 'alt'
            else:
                cls = ''
            print '<tr>'
            print '<td class=%s> %s </td>' % (cls, protname)
            print '<td class=%s> <a href=%s target="blank"> %s</a> </td>' % (cls, pdblink, pdbid)
            if pdbid in pkdprots:
                status = 'yes'
            else:
                status = 'no'
            print '<td class=%s> <b>%s</b> </td>' %(cls, status)
            print '</tr>'
            r=r+1
        print '</table>'
        return
def selectpKD ( self ) : self . showHeader ( menu = 1 ) sys . stdout . flush ( ) DB = self . DB = self . connect ( ) names = [ ] for p in DB . getRecs ( ) : names . append ( ( DB [ p ] . name , p ) ) names . sort ( ) nucl = [ '1H NMR' , '15N NMR' , '13C NMR' ] P = pKDInterface ( ) pkdprots = [ string . upper ( e [ 0 ] ) for e in P . getProteins ( ) ] print '<div align=left>' print '<form name="pkdform" action="%s/main.cgi" METHOD="POST" ENCTYPE="multipart/form-data">' % self . bindir self . write_sessionkey ( 'showpKD' ) print '<big>Select experimental curves to compare with calculated curves in pKD</big><br>' print '<a>This will show a set of plots for each residue where there is an experimental and calculated curve</a><p>' print 'Choose the protein and nucleus:<p>' print '<select name="protein" class="btn">' for n in names : print '<option value="%s">%s</option>' % ( n [ 1 ] , n [ 0 ] ) print '</select>' print '<select name="column" class="btn">' for c in nucl : print '<option value="%s">%s</option>' % ( c , c ) print '</select>' print '<p>' print '<input type=submit value="Display Plots" name=submit class="btn">' print '<label><input type=radio name="option" value=1 checked="yes">compare both</label>' print '<label><input type=radio name="option" value=2>exp only</label>' print '<label><input type=radio name="option" value=3>calcs only</label>' print '</form>' print '</div>' print 'Below is a reference table showing which proteins in our DB currently have calculations in the pKD, with the PDB ID and PDB link.<br>' print 'If the protein is not yet available, you can go to <a href=http://enzyme.ucd.ie/cgi-bin/pKD/server_start.cgi target="blank"> \
                    the pKD page</a> and submit the calculation.<p>' print '<div align=left>' print '<table id="mytable" cellspacing="0">' r = 0 print '<th>Protein</th><th>PDB</th><th>Has pKD data</th>' for name in names : protein = name [ 1 ] protname = name [ 0 ] if not DB [ protein ] . has_key ( 'PDB_link' ) : continue pdbinfo = DB [ protein ] . PDB_link if pdbinfo == '' : continue pdbid = pdbinfo [ 'text' ] pdblink = pdbinfo [ 'link' ] if r % 2 == 0 : cls = 'alt' else : cls = '' print '<tr>' print '<td class=%s> %s </td>' % ( cls , protname ) print '<td class=%s> <a href=%s target="blank"> %s</a> </td>' % ( cls , pdblink , pdbid ) if pdbid in pkdprots : status = 'yes' else : status = 'no' print '<td class=%s> <b>%s</b> </td>' % ( cls , status ) print '</tr>' r = r + 1 print '</table>' return
Allow user to select a protein and field for pKD
Allow user to select a protein and field for pKD
"""Allow user to select a protein and field for pKD""" #check pKD available calcs #add selection boxes #button #table of proteins and their PDBs
self