本文整理匯總了Python中Protool.structure方法的典型用法代碼示例。如果您正苦於以下問題:Python Protool.structure方法的具體用法?Python Protool.structure怎麽用?Python Protool.structure使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Protool
的用法示例。
在下文中一共展示了Protool.structure方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: convert_PEAT_to_classic
# 需要導入模塊: import Protool [as 別名]
# 或者: from Protool import structure [as 別名]
def convert_PEAT_to_classic(operations):
operations=get_single_operations(operations)
newops=[]
import string, Protool
PI=Protool.structure()
for operation in operations:
resid=get_resid_from_mut(operation)
old=PI.three_to_one[get_oldrestyp_from_mut(operation)]
new=PI.three_to_one[get_newrestyp_from_mut(operation)]
resnum=get_resnum_from_mut(operation)
resnum=string.lstrip(resnum,'0')
classic='%s%s%s' %(old,resnum.strip(),new)
newops.append(classic)
classicops=string.join(newops,'+')
return classicops
示例2: __init__
# 需要導入模塊: import Protool [as 別名]
# 或者: from Protool import structure [as 別名]
def __init__(self, pdbfiles):
"""Calculate a score for sequence-local contacts"""
import Protool
self.X = Protool.structure()
for pdbfile in pdbfiles:
xs = []
ys = []
labels = []
count = 0
PI = self.get_PDB(pdbfile)
seq = PI.PirSeq(PI.sequence)
window = 4 * [None]
residues = 4 * [None]
for residue, type in PI.sequence[:3]:
window.append(type)
residues.append(residue)
for residue, type in PI.sequence[3:]:
window.append(type)
window = window[1:]
#
residues.append(residue)
residues = residues[1:]
# print window
if window[3] in ["ASP", "GLU"]: # ,'LYS','HIS','ARG']:
# print window
score = self.score_window(window)
print residues[3], window[3], score
xs.append(count)
labels.append(residues[3] + ":%s" % window[3])
ys.append(score)
count = count + 1
#
# Plot a bar chart
#
import pylab
pylab.bar(xs, ys)
import numpy
xs = numpy.array(xs)
pylab.xticks(xs + 0.5, labels, rotation="vertical", size="x-small")
pylab.title("dpKa values")
pylab.show()
return