[BioPython] how to using python to multiply call a program for caculation

Shulin Zhuang shulin.zhuang at gmail.com
Wed Jul 30 00:34:23 UTC 2008


Dear All,

Here just disturb you a question.

I make a simple script to execute one program, the script content:

import string, re, sys, os, time, math
calc = '/usr/local/bin/resc 1bmp.pdb 8 A > 8.txt '
os.system(calc)

I can sucessfully execute this script and get the result file"8.txt.


In the calc column,  8 is a residue number,  resc is a program. The aim is
to use resc to calculate residue 8 and get the output 8.txt.


 I want to calculate the whole residues from 1, 2, 3, ..... to 100, if I use
above simple script, I should execute 100 times. Therefore, I want to write
a script to let the python do all the calculations at one time.

Then I write the script as following:

import string, re, sys, os, time, math
i = 1
while i <=100:
       calc = '/home/shulin/program/rescP/resc 1PGA.pdb  ' + abc
       i = i +1
os.system(calc)


However, when I execute the script and get an error:"The first argument
should bu numerical"

Would you like to tell me how to write a good script to tackle this problem.
great thanks

Best regards



More information about the Biopython mailing list