def dock(receptor, resname, rec_outpath, reorder_outpath, init='dock_init'): init = eval(init) dock_pm = init.dock_pm dock_dir = os.path.join(init.data_dir, init.dock_folder) rec_path = os.path.join(init.data_dir, rec_outpath) reorder_path = os.path.join(init.data_dir, reorder_outpath) dock_name = os.path.basename(rec_path).replace('receptor', 'dock') out_path = os.path.join(dock_dir, receptor, dock_name) smina_pm = smina_param() smina_pm.param_load(config.dock_pm[dock_pm]) if not os.path.exists(os.path.dirname(out_path)): os.makedirs(os.path.dirname(out_path)) kw = { 'receptor': rec_path, 'ligand': reorder_path, 'autobox_ligand': reorder_path, 'out': out_path } cmd = smina_pm.make_command(**kw) cl = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) cl.wait() return [[ receptor, resname, rec_outpath, reorder_outpath, os.path.join(init.dock_folder, receptor, dock_name) ]]
def reorder(receptor, resname, rec_path, lig_path): reorder_dir = FLAGS.reorder_dir reo_name = os.path.basename(rec_path).replace('receptor','reorder') receptor = os.path.basename(os.path.dirname(rec_path)) out_path = os.path.join(reorder_dir, receptor, reo_name) smina_pm = smina_param() smina_pm.param_load(config.dock_pm['reorder']) if not os.path.exists(os.path.dirname(out_path)): os.makedirs(os.path.dirname(out_path)) kw = { 'receptor': rec_path, 'ligand': lig_path, 'autobox_ligand':lig_path, 'out':out_path } cmd = smina_pm.make_command(**kw) cl = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) cl.wait() return [[receptor, resname, rec_path, out_path]]
def reorder(receptor, resname, rec_path, lig_path, reorder_dir): """ reorder atom in ligand args: receptor:: str 4 letters pdb id resname:: str res id rec_path:: str path of splited receptor lig_path:: str path of splited ligand reorder_dir:: str dir for output file returns: receptor:: str 4 letters pdb id resname:: str res id rec_path:: str path of splited receptor reorder_path:: str path of reorder ligand """ reo_name = os.path.basename(rec_path).replace('receptor','reorder') receptor = os.path.basename(os.path.dirname(rec_path)) out_path = os.path.join(reorder_dir, receptor, reo_name) smina_pm = smina_param() smina_pm.param_load(config.dock_pm['reorder']) if not os.path.exists(os.path.dirname(out_path)): os.makedirs(os.path.dirname(out_path)) kw = { 'receptor': rec_path, 'ligand': lig_path, 'autobox_ligand':lig_path, 'out':out_path } cmd = smina_pm.make_command(**kw) cl = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) cl.wait() result = [list(map(lambda x:'"'+str(x)+'"',[receptor, resname, rec_path, out_path]))] print (result) return result
def dock(receptor, resname, rec_path, reorder_path, dock_pm, dock_dir): """ Smina docking args: receptor:: str 4 letters pdb id resname:: str res id rec_path:: str path of splited receptor reorder_path:: str path of reorder ligand dock_pm:: str docking parameter dock_dir:: str dir for output returns: receptor:: str 4 letters pdb id resname:: str res id rec_path:: str path of splited receptor reorder_path:: str path of reorder ligand dock_path:: str path of docking result """ dock_name = os.path.basename(rec_path).replace('receptor','dock') receptor = os.path.basename(os.path.dirname(rec_path)) out_path = os.path.join(dock_dir, receptor, dock_name) smina_pm = smina_param() smina_pm.param_load(config.dock_pm[dock_pm]) if not os.path.exists(os.path.dirname(out_path)): os.makedirs(os.path.dirname(out_path)) kw = { 'receptor': rec_path, 'ligand': reorder_path, 'autobox_ligand':reorder_path, 'out':out_path } cmd = smina_pm.make_command(**kw) cl = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) cl.wait() return [list(map(lambda x:'"'+str(x)+'"',[receptor, resname, rec_path, reorder_path, out_path]))]