aboutsummaryrefslogtreecommitdiff
path: root/scripts/get_dock_score.py
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2020-07-06 13:03:43 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2020-07-06 13:03:43 +0530
commit6e45140c59253fb2f286bfd73f763c18e7ef104b (patch)
tree008c7ac0d66e4ce15f54121d08d3e98c4a8d5f77 /scripts/get_dock_score.py
parentd779d69e8db98c3d53fcc1bffa9f7f326339259c (diff)
added docking score feeature to main.sh and report generation
Diffstat (limited to 'scripts/get_dock_score.py')
-rw-r--r--scripts/get_dock_score.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/scripts/get_dock_score.py b/scripts/get_dock_score.py
new file mode 100644
index 0000000..a47312b
--- /dev/null
+++ b/scripts/get_dock_score.py
@@ -0,0 +1,46 @@
+#!/usr/bin/python3
+
+import argparse
+
+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()
+
+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
+
+from os.path import basename
+
+print("# " + str(basename(protein)).replace(".pdbqt","") + "-" + str(basename(ligand)).replace("_out.pdbqt",""), end="\n\n")
+
+from tabulate import tabulate
+
+file = open(ligand, "r")
+lines = file.readlines()
+results = []
+i = 1
+for line in lines:
+ ta = []
+ if line.find('REMARK VINA') == 0 and line.split()[3] != "":
+ l = line.split()
+ ta.append(i)
+ ta.append(l[3])
+ ta.append(l[4])
+ ta.append(l[5])
+ i += 1
+ if ta != []:
+ results.append(ta)
+
+print("## Docking Scores",end="\n\n")
+print(tabulate(results,headers=["No.","Affinity","rmsd l.b","rmsd u.b"]))
+print("",end="\n\n")