PEATDB/web.py
def show_datasets(self):
        """Show single or multiple dataset plot from search results"""
        plotoption = self.form.getfirst('plotoption')
        norm = bool(self.form.getfirst('normalise'))
        logx = bool(self.form.getfirst('logx'))
        logy = bool(self.form.getfirst('logy'))
        legend = bool(self.form.getfirst('legend'))

        DB = self.DB = self.connect()
        from PEATDB.Ekin.Web import EkinWeb
        ekincols = DB.ekintypes

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

        #get dataset name(s) from form
        residuefield = self.form.getvalue('residue')

        if not isinstance(residuefield, list):
            residuefield = [residuefield]

        #prepare data, if more than one dataset from seperate proteins,
        print '</div>'
        print '<table id="mytable" cellspacing=0>'
        print '<tr><th>'
        print 'plotoption:', plotoption
        print 'norm:', str(norm)
        print 'log-x', logx
        print 'log-y', logy
        print 'legend', legend
        print '</table>'

        ekindata={}
        ekindata['__datatabs_fits__']={}
        ekindata['__meta_data__']={}
        #extracting seperate datasets and put them in ekindata
        for r in residuefield:
            fields = r.split('$')
            protein = fields[0]
            col = fields[1]
            d = fields[2]
            E = DB[protein][col]
            fits = E.__datatabs_fits__
            meta = E.__meta_data__
            protname = DB[protein]['name']
            ekindata['__datatabs_fits__'][d+'_'+col+'_'+protname] = fits[d]
            ekindata['__meta_data__'][d+'_'+col+'_'+protname] = meta[d]
            ekindata[d+'_'+col+'_'+protname] = E.getDataset(d)

        if plotoption == None:
            plotoption = 1
        else:
            plotoption = 3

        EW = EkinWeb()
        EW.showEkinPlots(ekindata, 'ALL', path=self.plotsdir,
                        imgpath=self.imagepath,
                        plotoption=plotoption, normalise=norm, legend=legend,
                        logx=logx, logy=logy)

        return
Show single or multiple dataset plot from search results
Show single or multiple dataset plot from search results
Show single or multiple dataset plot from search results
def show_datasets(self):
        plotoption = self.form.getfirst('plotoption')
        norm = bool(self.form.getfirst('normalise'))
        logx = bool(self.form.getfirst('logx'))
        logy = bool(self.form.getfirst('logy'))
        legend = bool(self.form.getfirst('legend'))
        DB = self.DB = self.connect()
        from PEATDB.Ekin.Web import EkinWeb
        ekincols = DB.ekintypes
        self.showHeader(menu=1)
        self.menu()
        sys.stdout.flush()
        residuefield = self.form.getvalue('residue')
        if not isinstance(residuefield, list):
            residuefield = [residuefield]
        print '</div>'
        print '<table id="mytable" cellspacing=0>'
        print '<tr><th>'
        print 'plotoption:', plotoption
        print 'norm:', str(norm)
        print 'log-x', logx
        print 'log-y', logy
        print 'legend', legend
        print '</table>'
        ekindata={}
        ekindata['__datatabs_fits__']={}
        ekindata['__meta_data__']={}
        for r in residuefield:
            fields = r.split('$')
            protein = fields[0]
            col = fields[1]
            d = fields[2]
            E = DB[protein][col]
            fits = E.__datatabs_fits__
            meta = E.__meta_data__
            protname = DB[protein]['name']
            ekindata['__datatabs_fits__'][d+'_'+col+'_'+protname] = fits[d]
            ekindata['__meta_data__'][d+'_'+col+'_'+protname] = meta[d]
            ekindata[d+'_'+col+'_'+protname] = E.getDataset(d)
        if plotoption == None:
            plotoption = 1
        else:
            plotoption = 3
        EW = EkinWeb()
        EW.showEkinPlots(ekindata, 'ALL', path=self.plotsdir,
                        imgpath=self.imagepath,
                        plotoption=plotoption, normalise=norm, legend=legend,
                        logx=logx, logy=logy)
        return
def show_datasets ( self ) : plotoption = self . form . getfirst ( 'plotoption' ) norm = bool ( self . form . getfirst ( 'normalise' ) ) logx = bool ( self . form . getfirst ( 'logx' ) ) logy = bool ( self . form . getfirst ( 'logy' ) ) legend = bool ( self . form . getfirst ( 'legend' ) ) DB = self . DB = self . connect ( ) from PEATDB . Ekin . Web import EkinWeb ekincols = DB . ekintypes self . showHeader ( menu = 1 ) self . menu ( ) sys . stdout . flush ( ) residuefield = self . form . getvalue ( 'residue' ) if not isinstance ( residuefield , list ) : residuefield = [ residuefield ] print '</div>' print '<table id="mytable" cellspacing=0>' print '<tr><th>' print 'plotoption:' , plotoption print 'norm:' , str ( norm ) print 'log-x' , logx print 'log-y' , logy print 'legend' , legend print '</table>' ekindata = { } ekindata [ '__datatabs_fits__' ] = { } ekindata [ '__meta_data__' ] = { } for r in residuefield : fields = r . split ( '$' ) protein = fields [ 0 ] col = fields [ 1 ] d = fields [ 2 ] E = DB [ protein ] [ col ] fits = E . __datatabs_fits__ meta = E . __meta_data__ protname = DB [ protein ] [ 'name' ] ekindata [ '__datatabs_fits__' ] [ d + '_' + col + '_' + protname ] = fits [ d ] ekindata [ '__meta_data__' ] [ d + '_' + col + '_' + protname ] = meta [ d ] ekindata [ d + '_' + col + '_' + protname ] = E . getDataset ( d ) if plotoption == None : plotoption = 1 else : plotoption = 3 EW = EkinWeb ( ) EW . showEkinPlots ( ekindata , 'ALL' , path = self . plotsdir , imgpath = self . imagepath , plotoption = plotoption , normalise = norm , legend = legend , logx = logx , logy = logy ) return
Show single or multiple dataset plot from search results
Show single or multiple dataset plot from search results
"""Show single or multiple dataset plot from search results""" #get dataset name(s) from form #prepare data, if more than one dataset from seperate proteins, #extracting seperate datasets and put them in ekindata
self