Exemplo n.º 1
0
 def titDBUtils(self, DB=None, col=None, prot=None, a=None, E=None,
                 refit=False, addmeta=False, getexperrs=False,
                 yuncert=None):
     """Add some meta and refit all for an ekin prj or a rec/field in db"""
     if E==None and DB != None:
         E = DB[prot][col]
         E.checkDatasets()
     t = TitrationAnalyser()
     if refit == True:
         models = ['Linear', '1 pKa 2 Chemical shifts',
                     '2 pKas, 3 Chemical shifts',
                     '3 pKas, 4 Chemical shifts']
         E = t.findBest(E, models, geterrs=False)
     if addmeta == True:
         E = t.setMetaInfo(E, atom=a)
     if getexperrs == True:
         if yuncert == None:
             print 'No value for Y uncertainty!, please supply it'
             return
         print 'Using %s for y uncertainty.' %yuncert
         print
         E = t.getExpErrs(E, xuncert=0.1, yuncert=yuncert)
     self.save(DB, col, prot, E)
     #DB.commit('refit/added meta info')
     return E