个人学习随笔
2016-11-30 23:04
162 查看
下面是我自己最近所学习的知识。
之前自己处理的数据集发现了大问题,现在又重新处理。
关于从pdb数据库中提取一级序列
定义一个PDBparser类,定义parsePrimaryStructure()函数,用pdbparser.parsePrimaryStructure(file)实现一级序列提取的功能。
定义main函数
之前自己处理的数据集发现了大问题,现在又重新处理。
关于从pdb数据库中提取一级序列
定义一个PDBparser类,定义parsePrimaryStructure()函数,用pdbparser.parsePrimaryStructure(file)实现一级序列提取的功能。
import json; class PDBparser(): def parse(self,PDBfile,indent = False): ''' @return: The full information parsed from the PDBFile @param PDBFile: The full path of the PDB file, str ''' content = {} # The full information parsed from the PDBFile priStructure = content['primary_structure'] = [] # The primary structure parsed from the PDBFile tertiary_structure = content['tertiary_structure'] ={} terStructure = tertiary_structure['chains'] = [] # The teritary structure parsed from the PDBFile #residueindexlist = set() lines = self.__loadPDBfile(PDBfile) langthinformation = self.__parseLine(lines,content) if indent: return content,langthinformation # for test else: return content def parsePrimaryStructure(self,PDBfile): ''' @return: The full information parsed from the PDBFile @param PDBFile: The full path of the PDB file, str ''' priStructure = []; # The primary structure parsed from the PDBFile lines = self.__loadPDBfile(PDBfile) for line in lines: header = line.split()[0] if header == 'SEQRES': self.__parsePriLine(line, priStructure) return priStructure
定义main函数
if __name__ == "__main__": print('please input the path of the PDBfile:such as E:\\pdb\\pdb3rum.ent')#输入pdb文件 file=input() pdbparser = PDBparser() #content = pdbparser.parseTertiaryStructure(file) content = pdbparser.parsePrimaryStructure(file) formatinput = json.dumps(content, indent=1) print(formatinput) print("Done")
相关文章推荐
- cURL 学习笔记与总结(3)模拟登录博客园并下载个人随笔首页
- 个人学习随笔(psi-blast随笔)
- 个人学习 随笔一
- 2015.8.1 bootstrap学习(个人每日学习的随笔,比较凌乱
- 个人学习 随笔 二
- [重要新功能]个人Blog随笔置顶
- U2TP学习随笔(一)
- [团队管理]+[软件人生]从项目计划到保密管理到个人学习与提高的方法
- 软件开发入门学习的个人看法
- VS2005.NET2.0学习视频_1_用MasterPage做个人网站框架
- C语言个人学习笔记
- 我的个人嵌入式专题,希望大家能够互相学习!!
- 有关C语言指针学习思想的随笔常用形式的总结(原创)
- 现在项目可以改进和学习的地方随笔
- 个人学习经验总结
- 注意:以下文章只为各位DOTNET爱好者个人学习或研究使用,不得用于任何商业用途,否则后果自负
- [新功能]个人Blog页面左侧显示最新随笔列表
- uml问题(个人学习):
- [小改进]个人Blog首页显示随笔摘要
- [ZT]软件开发入门学习的个人看法(转贴自dearbook)