aboutsummaryrefslogtreecommitdiff
path: root/scripts/get-best.py
blob: c0185e4ef97496c96baeb2d8646b6c8857ac6fa5 (plain)
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/python3
import argparse
import pymol2
import re

#################
# Configuration #
#################

version = "1.0"
desc_text = "PyMol Quick Visualtion " + version

parser = argparse.ArgumentParser(description=desc_text)
parser.add_argument("-p", "--protein", help="Path to protein file")
parser.add_argument("-l", "--ligand", help="Path to ligand_out file")

args = parser.parse_args()


def li(s):
    # log.info(s)
    None


if args.protein == None:
    print("Error: Please specify protein file")
    exit(1)
if args.ligand == None:
    print("Error: Please specify ligand file")
    exit(1)


protein = args.protein
ligand = args.ligand

session = pymol2.PyMOL()
session.start()
cmd = session.cmd
cmd.load(protein, "pro")
cmd.load(ligand, "lig")
cmd.split_states("lig")

# fname = re.sub(r'^.*?/', '', protein.replace(".pdbqt","")) + "-" + re.sub(r'^.*?/', '', ligand.replace(".pdbqt","")) + ".pdb"

cmd.save("best.pdb", "pro lig_0001")