forked from keisuke-yanagisawa/exprorer_msmd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
protein_hotspot
executable file
·44 lines (33 loc) · 1.34 KB
/
protein_hotspot
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
#!/usr/bin/env python
import argparse
import glob
from pathlib import Path
from script import maxpmap
from script.setting import parse_yaml
from script.utilities.logger import logger
VERSION = "0.1.0"
def protein_hotspot(setting):
basedirpath = setting["general"]["workdir"]
JOB_NAME = setting["general"]["name"]
logger.info("PMAP aggregation: mapPMAP")
for map in setting["map"]["maps"]:
maxpmap.gen_max_pmap(
glob.glob(f"{basedirpath}/system*/PMAP_{JOB_NAME}_{map['suffix']}.dx"),
f"{basedirpath}/maxPMAP_{JOB_NAME}_{map['suffix']}.dx",
)
logger.info(f"Output file: {basedirpath}/maxPMAP_{JOB_NAME}_{map['suffix']}.dx")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Calculate protein hotspot: aggregating PMAPs")
parser.add_argument("setting_yaml", type=Path)
parser.add_argument("-v,--verbose", dest="verbose", action="store_true")
parser.add_argument("--debug", action="store_true")
parser.add_argument("--version", action="version", version=VERSION)
args = parser.parse_args()
if args.debug:
logger.setLevel("debug")
elif args.verbose:
logger.setLevel("info")
# else: logger level is "warn"
logger.info(f"read yaml: {args.setting_yaml}")
setting = parse_yaml(args.setting_yaml)
protein_hotspot(setting)