From 422a7b2e721b1afb475db6ab98416e86258e46eb Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sun, 30 Aug 2020 22:24:16 +0530 Subject: added AR functionality --- app/dock-single.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'app/dock-single.py') diff --git a/app/dock-single.py b/app/dock-single.py index af6c4c4..9f603e5 100644 --- a/app/dock-single.py +++ b/app/dock-single.py @@ -90,6 +90,16 @@ def bounding_box(receptor, residues): return {"size_x": SizeX, "size_y": SizeY, "size_z": SizeZ, "center_x": CenterX, "center_y": CenterY, "center_z": CenterZ} +def get3DModel(protein,ligand): + import pymol2 + session = pymol2.PyMOL() + session.start() + cmd = session.cmd + cmd.load(protein,"target") + cmd.load(ligand,"ligand") + cmd.save("model.gltf") + session.stop() + def removeWater(pdbpath): import pymol2 session = pymol2.PyMOL() @@ -203,6 +213,7 @@ import os cd = os.getcwd() f = os.path.join(cd,"static/uploads") reportDirectory = os.path.join(f,"reports") +modelDirectory = os.path.join(f,"3DModels") #t = os.path.join(f,"receptor",target) #r = os.path.join(f,"ligands",ligand) #c = os.path.join(f,"configs",config) @@ -230,6 +241,10 @@ with tempfile.TemporaryDirectory() as directory: zi = os.path.join(f,z) make_archive(zi, 'zip', directory) copyfile("report.pdf",os.path.join(reportDirectory,(str(jobID)+".pdf"))) + get3DModel(pdbpath,"%s_out.pdbqt"%(records[4])) + copyfile("model.gltf",os.path.join(modelDirectory,(str(jobID)+".gltf"))) + os.system("docker run -it --rm -v $(PWD):/usr/app leon/usd-from-gltf:latest model.gltf model.usdz") + copyfile("model.usdz",os.path.join(modelDirectory,(str(jobID)+".usdz"))) #copy(("Curie_Web_Result_"+str(jobID)),f) email(zi) #print((str(zi) + ".zip")) -- cgit v1.2.3