-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_scimm.py
executable file
·57 lines (49 loc) · 1.97 KB
/
install_scimm.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python
import os, subprocess, stat
############################################################
# install_scimm.py
#
# Compile source and set paths for Scimm.
#
# Author: David Kelley
############################################################
############################################################
# main
############################################################
def main():
installdir = os.getcwd()
# IMM code
os.chdir('glimmer3.02/src')
p = subprocess.Popen('make clean; make', shell=True)
os.waitpid(p.pid,0)
os.chdir('../..')
if not os.path.isfile('bin/simple-score'):
os.symlink('../glimmer3.02/bin/simple-score','bin/simple-score')
if not os.path.isfile('bin/build-icm'):
os.symlink('../glimmer3.02/bin/build-icm', 'bin/build-icm')
# LikelyBin
os.chdir('likelybin-0.1')
p = subprocess.Popen('make clean; make', shell=True)
os.waitpid(p.pid,0)
os.chdir('..')
if not os.path.isfile('bin/mcmc.pl'):
os.symlink('../likelybin-0.1/mcmc.pl','bin/mcmc.pl')
# CBCBCompostBin
p = subprocess.Popen('sed \'s,cb_bin = "[a-zA-Z/]*",cb_bin = "%s/CBCBCompostBin",\' CBCBCompostBin/compostbin.py > cb.tmp' % installdir, shell=True)
os.waitpid(p.pid,0)
os.rename('cb.tmp', 'CBCBCompostBin/compostbin.py')
p = subprocess.Popen('chmod ug+x CBCBCompostBin/compostbin.py', shell=True)
os.waitpid(p.pid,0)
if not os.path.isfile('bin/compostbin.py'):
os.symlink('../CBCBCompostBin/compostbin.py', 'bin/compostbin.py')
# Scimm
p = subprocess.Popen('sed \'s,scimm_bin = "[a-zA-Z/]*",scimm_bin = "%s/bin",\' bin/scimm.py > sc.tmp' % installdir, shell=True)
os.waitpid(p.pid,0)
os.rename('sc.tmp', 'bin/scimm.py')
p = subprocess.Popen('chmod ug+x bin/scimm.py', shell=True)
os.waitpid(p.pid,0)
############################################################
# __main__
############################################################
if __name__ == '__main__':
main()