build_promod_models.py 880 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os
import time
import subprocess

in_dir = 'cameo_benchmark'
out_dir = 'promod_models'

if not os.path.exists(out_dir):
  os.makedirs(out_dir)

targets = set([f[:6] for f in os.listdir(in_dir)])
start_time = time.time()
for t in targets:
    tpl_path = os.path.join(in_dir, t + "_tpl.pdb")
    aln_path = os.path.join(in_dir, t + "_aln.fasta")
    prof_path = os.path.join(in_dir, t + "_profile.hhm")
    out_path = os.path.join(out_dir, t + ".pdb")
    if os.path.exists(tpl_path) and os.path.exists(aln_path) and \
       os.path.exists(prof_path):
        cmd = ['pm', 'build-model', '-p', tpl_path, '-f', aln_path, 
               '-s', prof_path, '-o', out_path]
22
23
24
        p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        print(p.stdout.decode())
        print(p.stderr.decode())
25
26

print("full modelling time: ", time.time() - start_time)
27