File: cartoon_test.py

package info (click to toggle)
ball 1.5.0%2Bgit20180813.37fc53c-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 239,888 kB
  • sloc: cpp: 326,149; ansic: 4,208; python: 2,303; yacc: 1,778; lex: 1,099; xml: 958; sh: 322; makefile: 95
file content (29 lines) | stat: -rw-r--r-- 853 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# call this with "python -u cartoon_test.py | tee output.txt"
# not to be used in BALLView!
import os
import shutil

# adapt the paths below
DIR = "/local/amoll/all-pdbs/"
TEMPDIR = "/var/tmp/"
BALLVIEW = "/local/amoll/BALL/source/APPLICATIONS/BALLVIEW/BALLView"
TESTDIR = "/local/amoll/cartoon_test_dir/"

result_file = file = open(TESTDIR + "results.txt", 'w')

for f in os.listdir(DIR):
	os.popen("zcat " + DIR + f  + " > " + TEMPDIR + "test.pdb");
	print
	print "--------------------------------"
	print DIR + f
	print
	state = os.spawnl(os.P_WAIT, BALLVIEW, "", "cartoon_test2.py")
	if state == 0:
		result_file.write(f + "   OK\n")
		shutil.move(TEMPDIR + "test1.png", TESTDIR + f + "_1.png")
		#shutil.move(TEMPDIR + "test2.png", TESTDIR + f + "_2.png")
	else:
		result_file.write(f + "   ERROR!\n")
		print "ERROR:   " + f
	result_file.flush()