diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2020-09-22 13:28:48 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2020-09-22 13:28:48 +0530 |
commit | 5ad24bfceb8a22a4940c6d076ea3befc928ab1cd (patch) | |
tree | 81883ec4c205da9ebdec51481dbb0d59b40563b8 /app/scripts/get-best.py | |
parent | c00e771b4d4e1eecfe47408556424fb34ca33fc3 (diff) |
Increased Speed by 50%
Diffstat (limited to 'app/scripts/get-best.py')
-rw-r--r-- | app/scripts/get-best.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/app/scripts/get-best.py b/app/scripts/get-best.py new file mode 100644 index 0000000..b5f69a8 --- /dev/null +++ b/app/scripts/get-best.py @@ -0,0 +1,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) + +print("Getting Best ligand from",args.protein,args.ligand) + +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") |