當前位置: 首頁>>代碼示例>>Python>>正文


Python EDrestraint.findBadfit方法代碼示例

本文整理匯總了Python中restraints.EDrestraint.findBadfit方法的典型用法代碼示例。如果您正苦於以下問題:Python EDrestraint.findBadfit方法的具體用法?Python EDrestraint.findBadfit怎麽用?Python EDrestraint.findBadfit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在restraints.EDrestraint的用法示例。


在下文中一共展示了EDrestraint.findBadfit方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: main

# 需要導入模塊: from restraints import EDrestraint [as 別名]
# 或者: from restraints.EDrestraint import findBadfit [as 別名]
def main(pdbfile, mtzfn, f1label, f2label, philabel, maptype, aasc=None) :
    mt = {"2F1-F2":0, "F1":1}
    prot = protein(pdbfile, read_hydrogens=0, read_waters=1, read_hets=1)
    res, resids, resnums, resns, chids, inscodes, pts = prot2res.readProtRes(prot)
    pts = VecVecFloat(pts)
    Xcorrs = {}
#    print len(res.keys()), len(set(res.keys()))
    allkeys = list(res.keys()) ; allkeys.sort()
    for ri in allkeys :
        key = resids[ri]
        if aasc and (not isAAres(resns[ri]) or resns[ri] in ["GLY","ALA"]) : continue
        if aasc :
            ptinds = []
            for k,v in res[ri].items() :
                if not k in [" N  "," CA "," C  "," O  "," CB "] : ptinds.append(v)
            ptinds = VecInt(ptinds)
        else :
            ptinds = VecInt( res[ri].values() )

        xcorr = EDrestraint.findBadfit(mtzfn, f1label, f2label, philabel, pts, ptinds)
        Xcorrs[ key ] = xcorr
#        print ri, "RESID", key        print "XcorrZ [%s]"%key, xcorr
    #mean, stdev = findMeanStdev(Xcorrs.values())
    #for key,val in Xcorrs.items() : print "XcorrZ", key, val, (val-mean) / stdev
    return Xcorrs
開發者ID:swanandgore,項目名稱:rappertk,代碼行數:27,代碼來源:xcheck.py

示例2: score

# 需要導入模塊: from restraints import EDrestraint [as 別名]
# 或者: from restraints.EDrestraint import findBadfit [as 別名]
 def score(s, pdbfile, mtzfn, f1label="FP", f2label="FC", philabel="PHIC", maptype="2F1-F2", aasc="mcsc") :
     assert aasc in ["pept","mc","sc","mcsc"]
     prot = protein(pdbfile, read_hydrogens=0, read_waters=1, read_hets=1)
     res, resids, resnums, resns, chids, inscodes, pts = prot2res.readProtRes(prot)
     pts = VecVecFloat(pts)
     retkeys = []
     badlines = []
     allkeys = list(res.keys()) ; allkeys.sort()
     for ai in range(len(allkeys)) :
         ri = allkeys[ai]
         key = resids[ri]
         if not isAAres(resns[ri]) : continue
         if aasc=="sc" and resns[ri] in ["GLY","ALA"] : continue
         if aasc=="sc" and isAAres(resns[ri]) :
             ptinds = []
             for k,v in res[ri].items() :
                 if not k in [" N  "," CA "," C  "," O  "," CB "] : ptinds.append(v)
             ptinds = VecInt(ptinds)
         elif aasc=="pept" and isAAres(resns[ri]) and ai+1 < len(allkeys) and isAAres(resns[allkeys[ai+1]]) :
             ptinds = []
             for k,v in res[ri].items() :
                 if k in [" C  "," O  "] : ptinds.append(v)
             for k,v in res[ allkeys[ai+1] ].items() :
                 if k in [" N  ",] : ptinds.append(v)
             ptinds = VecInt(ptinds)
         elif aasc=="mc" and isAAres(resns[ri]) :
             ptinds = []
             for k,v in res[ri].items() :
                 if k in [" N  "," CA "," C  "," O  "," CB "] : ptinds.append(v)
             ptinds = VecInt(ptinds)
         elif aasc=="ca" and isAAres(resns[ri]) :
             ptinds = []
             for k,v in res[ri].items() :
                 if k in [" CA "] : ptinds.append(v)
             ptinds = VecInt(ptinds)                
         else :
             ptinds = VecInt( res[ri].values() )
         if re.compile("\.map$").search(mtzfn) and re.compile("\.map$").search(f1label) :
             xcorr = EDrestraint.findBadfit1(mtzfn, f1label, pts, ptinds)
             print "xcor",xcorr,resids[ri]
             
         else :
             xcorr = EDrestraint.findBadfit(mtzfn, f1label, f2label, philabel, pts, ptinds)
         #print "XcorrZ [%s]"%key, xcorr
         if not s.scores.has_key(key) : s.scores[key] = [] ; s.keyorder.append(key)
         s.scores[key].append(xcorr)
         if xcorr < s.cutoff :
             retkeys.append(key) ;
             bl = "[%s]" % key
             badlines.append(bl)
     print len(badlines), "BADRESIDS", aasc, len(s.scores.values()[0]), s.cutoff, "------------------------------------" ;
     for bl in badlines : print bl
     s.gplot() 
     return retkeys
開發者ID:swanandgore,項目名稱:rappertk,代碼行數:56,代碼來源:xcheck2.py


注:本文中的restraints.EDrestraint.findBadfit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。