diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2020-07-02 20:48:33 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2020-07-02 20:48:33 +0530 |
commit | 4be08f7bdd77991e9e453c1cda863c3f20c338d5 (patch) | |
tree | 083e8e91622221185a28fd50754abc2f86b1df43 /scripts/get-best.py |
initial commit
Diffstat (limited to 'scripts/get-best.py')
-rw-r--r-- | scripts/get-best.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/scripts/get-best.py b/scripts/get-best.py new file mode 100644 index 0000000..748251e --- /dev/null +++ b/scripts/get-best.py @@ -0,0 +1,43 @@ +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") |