本文整理汇总了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
示例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