Pthon批量处理将pdb文件生成dssp文件
时间:2021-02-22 18:00:22|栏目:Python代码|点击: 次
# -*- 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))
上一篇:selenium+Chrome滑动验证码破解二(某某网站)
栏 目:Python代码
下一篇:使用Python制作自动推送微信消息提醒的备忘录功能
本文地址:http://www.codeinn.net/misctech/67701.html






