summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Messick <ericm@nanorex.com>2008-08-30 04:26:28 +0000
committerEric Messick <ericm@nanorex.com>2008-08-30 04:26:28 +0000
commit50fcd2c3bc66ff8ddcc05f364a2a1eae35f59637 (patch)
treeca1a747f112fd31d0258016ce54885c9719d6fbb
parent56396296de8908e4bf4a290e78bf4d8459fa8fdb (diff)
downloadnanoengineer-theirix-50fcd2c3bc66ff8ddcc05f364a2a1eae35f59637.tar.gz
nanoengineer-theirix-50fcd2c3bc66ff8ddcc05f364a2a1eae35f59637.zip
Reindex malformed .in files
-rwxr-xr-xcad/src/tools/AMBER/SplitDotInFile.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/cad/src/tools/AMBER/SplitDotInFile.py b/cad/src/tools/AMBER/SplitDotInFile.py
index 267ae8abb..ed5cc2424 100755
--- a/cad/src/tools/AMBER/SplitDotInFile.py
+++ b/cad/src/tools/AMBER/SplitDotInFile.py
@@ -56,14 +56,26 @@ def parseInFile(fileName):
out = open(newFileName, 'w')
nextIndex = 1
inFile = True
+ warned = False
if (inFile):
# Within the residue itself, column 0 is an index number
# which usually increments sequentially.
- if (columns[0] != "%d" % nextIndex):
+ index = int(columns[0])
+ igraph = columns[1]
+ isymbl = columns[2]
+ itree = columns[3]
+ na = int(columns[4])
+ nb = int(columns[5])
+ nc = int(columns[6])
+ r = float(columns[7])
+ theta = float(columns[8])
+ phi = float(columns[9])
+ print >>out, "%3d %4s %2s %s %3d %3d %3d %10.3f %10.3f %10.3f" % (nextIndex, igraph, isymbl, itree, na, nb, nc, r, theta, phi)
+ if (index != nextIndex and not warned):
print "%s %s index not sequential" % (fileName, newFileName)
- print >>out, line.rstrip()
- nextIndex = int(columns[0]) + 1
+ warned = True
+ nextIndex = nextIndex + 1
if (__name__ == '__main__'):