-
Notifications
You must be signed in to change notification settings - Fork 4
/
abrmsd
executable file
·45 lines (40 loc) · 1.36 KB
/
abrmsd
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
#!/usr/bin/env python
from ab_rmsd import calc_ab_rmsd
import argparse
from argparse import RawTextHelpFormatter
from typing import Dict
# two example pdb files are provided in the `example` folder.
BANNER = """ _ _ ____ __ __ ____ ____
/ \ | |__ | _ \| \/ / ___|| _ \
/ _ \ | '_ \ | |_) | |\/| \___ \| | | |
/ ___ \| |_) | | _ <| | | |___) | |_| |
/_/ \_\_.__/ |_| \_\_| |_|____/|____/
"""
def get_args():
parser = argparse.ArgumentParser(
description=f"{BANNER}\nCompute the root-mean-square deviation of antibody structure",
formatter_class=RawTextHelpFormatter
)
parser.add_argument('--pred', help='predicted antibody structrue')
parser.add_argument('--native', help='native antibody structure')
parser.add_argument('--verbose', help='Print logo banner', action="store_true")
args = parser.parse_args()
return args
def format_output(rmsd: Dict, v=False):
"""format nice cmd output
Args:
rmsd (Dict): _description_
"""
if v:
print(BANNER)
print(">>> Result")
print("Frag RMSD(Å)")
for k, v in rmsd.items():
print('{:5s}\t{:.4f}'.format(k, v.item()))
print(">>> End")
if __name__ == '__main__':
args = get_args()
native = args.native
pred = args.pred
rmsd = calc_ab_rmsd(native,pred)
format_output(rmsd, args.verbose)