PEATDB/Ekin/Titration.py
def fitAll(self, DB, col, proteins=None, models=None, strictchecking=False):
        """Fit selected recs/col in DB using find best model"""
        stats={}
        if strictchecking == True:
            checkfunc=self.dostrictchecking
        else:
            checkfunc=None

        for m in models: stats[m]=0
        if models == None:
            models = self.models
        if proteins == None:
            proteins = DB.getRecs()
        self.getProtNames(DB)

        c=0; f=0
        for prot in proteins:
            name = self.protnames[prot]
            print 'fitting', name
            E = DB[prot][col]
            for d in E.datasets:
                print name, d
                if len(models)==1:
                    #we don't do f-test if only one model
                    fdata, X = E.fitDataset(d, model=models[0])
                else:
                    fdata, p = E.findBestModel(d, models=models, checkfunc=checkfunc)
                if fdata==None:
                    f+=1
                c+=1
                if fdata!=None:
                    stats[fdata['model']]+=1
            DB[prot][col] = E
        print 'done. fitted %s datasets with %s failed' %(c, f)
        return stats
Fit selected recs/col in DB using find best model
Fit selected recs/col in DB using find best model
Fit selected recs / col in DB using find best model
def fitAll(self, DB, col, proteins=None, models=None, strictchecking=False):
        stats={}
        if strictchecking == True:
            checkfunc=self.dostrictchecking
        else:
            checkfunc=None
        for m in models: stats[m]=0
        if models == None:
            models = self.models
        if proteins == None:
            proteins = DB.getRecs()
        self.getProtNames(DB)
        c=0; f=0
        for prot in proteins:
            name = self.protnames[prot]
            print 'fitting', name
            E = DB[prot][col]
            for d in E.datasets:
                print name, d
                if len(models)==1:
                    fdata, X = E.fitDataset(d, model=models[0])
                else:
                    fdata, p = E.findBestModel(d, models=models, checkfunc=checkfunc)
                if fdata==None:
                    f+=1
                c+=1
                if fdata!=None:
                    stats[fdata['model']]+=1
            DB[prot][col] = E
        print 'done. fitted %s datasets with %s failed' %(c, f)
        return stats
def fitAll ( self , DB , col , proteins = None , models = None , strictchecking = False ) : stats = { } if strictchecking == True : checkfunc = self . dostrictchecking else : checkfunc = None for m in models : stats [ m ] = 0 if models == None : models = self . models if proteins == None : proteins = DB . getRecs ( ) self . getProtNames ( DB ) c = 0 ; f = 0 for prot in proteins : name = self . protnames [ prot ] print 'fitting' , name E = DB [ prot ] [ col ] for d in E . datasets : print name , d if len ( models ) == 1 : fdata , X = E . fitDataset ( d , model = models [ 0 ] ) else : fdata , p = E . findBestModel ( d , models = models , checkfunc = checkfunc ) if fdata == None : f += 1 c += 1 if fdata != None : stats [ fdata [ 'model' ] ] += 1 DB [ prot ] [ col ] = E print 'done. fitted %s datasets with %s failed' % ( c , f ) return stats
Fit selected recs/col in DB using find best model
Fit selected recs / col in DB using find best model
"""Fit selected recs/col in DB using find best model""" #we don't do f-test if only one model
self
DB
col
proteins
models
strictchecking