Last change
on this file since 59b70a was e1a46d, checked in by Frederik Heber <heber@…>, 16 years ago |
All of my python script put into ESPACK and adapted with @PYTHON@ and so on.
|
-
Property mode
set to
100755
|
File size:
541 bytes
|
Rev | Line | |
---|
[e1a46d] | 1 | #!@PYTHON@
|
---|
| 2 | #
|
---|
| 3 | # Cuts a specific block from a given PDB file
|
---|
| 4 |
|
---|
| 5 | import sys, string, re, math
|
---|
| 6 | wrerr = sys.stderr.write
|
---|
| 7 | wrout = sys.stdout.write
|
---|
| 8 |
|
---|
| 9 | # check for parameters
|
---|
| 10 | if len(sys.argv) < 3:
|
---|
| 11 | wrerr("Usage: "+sys.argv[0]+" <oldfile> <newfile>\n")
|
---|
| 12 | sys.exit(1)
|
---|
| 13 |
|
---|
| 14 | input = open(sys.argv[1], "r")
|
---|
| 15 | output = open(sys.argv[2], "w")
|
---|
| 16 | output.write("# X Y value\n")
|
---|
| 17 |
|
---|
| 18 | for line in input:
|
---|
| 19 | if "#" in line:
|
---|
| 20 | continue
|
---|
| 21 | entries=line.split()
|
---|
| 22 | x=entries[0]
|
---|
| 23 | y=0.
|
---|
| 24 | for n in range(1,len(entries)):
|
---|
| 25 | y+=1.
|
---|
| 26 | output.write("%s\t%f\t%s\n" % (x,y,entries[n]))
|
---|
Note:
See
TracBrowser
for help on using the repository browser.