forked from zhengrongbin/MEBOCOST
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
59 lines (57 loc) · 2.19 KB
/
setup.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
58
59
"""lisa: a bioinformatics software
epigenome analysis to rank TFs from gene set
"""
import os
import setuptools
import configparser
def _make_config(conf_path, workdir=os.getcwd()):
"""
read config file
"""
#read config
cf = configparser.ConfigParser()
cf.read(conf_path)
config = cf._sections
# remove the annotation:
for firstLevel in config.keys():
for secondLevel in config[firstLevel]:
if '#' in config[firstLevel][secondLevel]:
path = config[firstLevel][secondLevel][:config[firstLevel][secondLevel].index('#')-1].rstrip()
config[firstLevel][secondLevel] = os.path.join(workdir, path)
else:
path = config[firstLevel][secondLevel]
config[firstLevel][secondLevel] = os.path.join(workdir, path)
## re-write
cf_new = configparser.ConfigParser()
for firstLevel in config.keys():
cf_new.add_section(firstLevel)
for secondLevel in config[firstLevel]:
cf_new.set(firstLevel, secondLevel, config[firstLevel][secondLevel])
with open('mebocost.conf', 'w') as f:
cf.write(f)
return(config)
## setup
def main():
setuptools.setup(name="mebocost",
version="1.0.3",
description="a python-based method to predict metabolite mediated cell-cell communication",
author='Rongbin Zheng, Kaifu Chen',
author_email='Rongbin.Zheng@childrens.harvard.edu',
url='https://openwetware.org/wiki/Chenlab',
# scripts=glob('mebocost/*'),
zip_safe=True,
package_dir={"": "src"},
packages=setuptools.find_packages(where="src"),
classifiers=[
'Environment::Console',
'Operating System:: POSIX',
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Bio-Informatics"],
keywords='Metabolism',
license='OTHER'
)
if __name__ == '__main__':
## change mebocost.conf to absolute path
_make_config(conf_path = './src/mebocost.conf')
## setup
main()