Pthon批量处理将pdb文件生成dssp文件 -电脑资料

电脑资料 时间:2019-01-01 我要投稿
【www.unjs.com - 电脑资料】

    这篇文章主要介绍了Pthon批量处理将pdb文件生成dssp文件,通过本例主要学习遍历目录下文件的方法,需要的朋友可以参考下

   

# -*- coding: utf-8 -*-"""Created on Sat Jun 20 19:36:34 2015@author: chaofn"""import os"""这个程序的目的是将linux下/ifs/home/fanchao/Manesh_pdb目录中的所有文件(一共有215个文件)批处理将pdb文件生成dssp文件"""#listdir返回文件名的列表fileLine=os.listdir(‘/ifs/home/fanchao/Manesh_pdb‘)#遍历整个列表for i in range(len(fileLine)-1):  #将字符串用变量表示  input_file=‘/ifs/home/fanchao/Manesh_pdb/‘+fileLine[i]  #先去掉文件名的后缀,然后形成后缀为dssp的文件名  out_file=fileLine[i].split(‘.‘)[0]+‘.dssp‘  output_file=‘/ifs/home/fanchao/Manesh_dssp/‘+out_file  #注意:参数的传递(先是%s,然后是%变量名),多个变量的传入要用元组表示,在元组前用%  os.system(‘/ifs/share/lib/dssp/dssp2 -i %s -o %s‘ %(input_file,output_file))

最新文章