run.py 827 Bytes
Newer Older
cmaffeo2's avatar
tmp  
cmaffeo2 committed
1
# -*- coding: utf-8 -*-
2
import sys
cmaffeo2's avatar
cmaffeo2 committed
3
4
5
from glob import glob
import re
from cadnano_segments import read_json_file, run_simulation_protocol
6
7

if __name__ == '__main__':
8
9
10
11
12
13
    if len(sys.argv) > 1:
        json_files = sys.argv[1:]
    else:
        print(len(sys.argv))
        json_files = glob('json/*')
    for f in json_files:
cmaffeo2's avatar
cmaffeo2 committed
14
15
        print("Working on {}".format(f))
        out = re.match('json/(.*).json',f).group(1)
16
17
18
19
20
        try:
            data = read_json_file(f)
        except:
            print("WARNING: skipping unreadable json file {}".format(f))
            continue
21
22
23
24
25
26
            
        run_simulation_protocol( out, "job-"+out+"-", data, gpu=0 )
        # try:
        #     run_simulation_protocol( out, "job-"+out+"-", data, gpu=0 )
        # except:
        #     print("ERROR: failed to simulate {}".format(f))