[BioPython] how to using python to multiply call a program for caculation
Shulin Zhuang
shulin.zhuang at gmail.com
Wed Jul 30 01:35:51 UTC 2008
Dear All,
Sorry to disturb you again.
If I edit the sentence to:
import string, re, sys, os, time, math
i = 1
while i <=100:
calc = "/usr/local/bin/resc 1bmp.pdb %d A >%d.txt"%(i,i)
os.system(calc)
in above A is the chain name of 1bmp.pdb.
Now I can execute it and get the result.
Thanks for your notice. It is because that I am just a beginner and not
familiar with the string and value.
Best regards
Shulin
On Tue, Jul 29, 2008 at 5:34 PM, Shulin Zhuang <shulin.zhuang at gmail.com>wrote:
> 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 1bmp.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