Mercurial > repos > tyty > structurefold
comparison predict/ct_to_dot.py @ 93:f1eb39775b93 draft
Uploaded
| author | tyty |
|---|---|
| date | Mon, 16 Feb 2015 02:29:27 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 92:976dcf4d45b2 | 93:f1eb39775b93 |
|---|---|
| 1 #!/usr/bin/env python | |
| 2 # -*- coding: utf-8 -*- | |
| 3 | |
| 4 import sys | |
| 5 import shlex | |
| 6 import os | |
| 7 import subprocess | |
| 8 from read_file import * | |
| 9 | |
| 10 ct_file = sys.argv[1] | |
| 11 path = sys.argv[2] | |
| 12 id_s = sys.argv[3] | |
| 13 result_file = sys.argv[4] | |
| 14 | |
| 15 h = file(result_file, 'w') | |
| 16 os.system('grep "'+id_s+'" '+ct_file+' |wc -l > '+path+'/count.txt') | |
| 17 count = read_t_file(path+'/count.txt') | |
| 18 for i in range(int(count[0][0])): | |
| 19 command = shlex.split('ct2dot %s %s %s' % (ct_file, str(i+1), os.path.join(path, 'db_file_%s.dbnn' % str(i+1)))) | |
| 20 subprocess.call(command) | |
| 21 | |
| 22 | |
| 23 | |
| 24 os.system('cat '+path+'/*.dbnn > '+result_file) | |
| 25 for i in range(int(count[0][0])): | |
| 26 command = shlex.split('rm %s' % (os.path.join(path, 'db_file_%s.dbnn' % str(i+1)))) | |
| 27 subprocess.call(command) | |
| 28 command = shlex.split('rm %s' % (os.path.join(path, 'count.txt'))) | |
| 29 subprocess.call(command) | |
| 30 | |
| 31 | |
| 32 | |
| 33 h.close() | |
| 34 |
