我想从任何蛋白质数据库中提取蛋白质序列及其相应的二级结构,比如 RCSB。我只需要短序列和它们的二级结构。就像是,
ATRWGUVT Helix
即使序列很长也没关系,但我希望在末尾有一个标签来表示它的二级结构。是否有任何编程工具或任何可用的东西。
正如我上面所展示的,我只想要这么少的信息。我怎样才能做到这一点?
我想从任何蛋白质数据库中提取蛋白质序列及其相应的二级结构,比如 RCSB。我只需要短序列和它们的二级结构。就像是,
ATRWGUVT Helix
即使序列很长也没关系,但我希望在末尾有一个标签来表示它的二级结构。是否有任何编程工具或任何可用的东西。
正如我上面所展示的,我只想要这么少的信息。我怎样才能做到这一点?
from Bio.PDB import *
from distutils import spawn
提取序列:
def get_seq(pdbfile):
p = PDBParser(PERMISSIVE=0)
structure = p.get_structure('test', pdbfile)
ppb = PPBuilder()
seq = ''
for pp in ppb.build_peptides(structure):
seq += pp.get_sequence()
return seq
如前所述,使用 DSSP 提取二级结构:
def get_secondary_struc(pdbfile):
# get secondary structure info for whole pdb.
if not spawn.find_executable("dssp"):
sys.stderr.write('dssp executable needs to be in folder')
sys.exit(1)
p = PDBParser(PERMISSIVE=0)
ppb = PPBuilder()
structure = p.get_structure('test', pdbfile)
model = structure[0]
dssp = DSSP(model, pdbfile)
count = 0
sec = ''
for residue in model.get_residues():
count = count + 1
# print residue,count
a_key = list(dssp.keys())[count - 1]
sec += dssp[a_key][2]
print sec
return sec
这应该打印序列和二级结构。