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