value error

F

Francesco Pietra

hi:
with script

data = open('134-176_rectified_edited.pdb', 'r')
outp = open('134-176_renumbered.pdb', 'w')

for L in data:
if L[3] == 'M':
L = L[:24] + "%4d" % (int(L[24-28])+133) + L[28:]
outp.write(L)


i wanted to modify lines of the type:
ATOM 1 HH31 ACE 1 1.573 1.961 0.769 1.00 0.00 H

to add 133 to column 25, getting 134 there, and so on for next lines 2
-> 135, 3 -> 136, etc.


i must have heavily messed things because the file was not even read:

$ python renumber.py 134-176_rectified.pdb
Traceback (most recent call last):
File "renumber.py", line 6, in <module>
L = L[:24] + "%4d" % (int(L[24-28])+133) + L[28:]
ValueError: invalid literal for int() with base 10: ''



thanks for having an expert look

chiendarret
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,292
Messages
2,571,494
Members
48,178
Latest member
SusanaHam4

Latest Threads

Top