Hi Viswanath, Please find the attach file which might help you, You have to give the input folder path containing all the pdbs, for example in terminal input: "Please provide the input directory:/home/viswanath/pdb "and "Enter the required files extension .pdb:.pdb" as input, It will create a new folder "new" which will contain all the pdb files with water removed and hydrogen added. I hope that solves your issue.
Best wishes. S.Sriram Postdoctoral Research fellow, Computational Structural Biology Team, RIKEN Center for Computational Science(R-CCS), Kobe, Japan. On Thu, Jun 17, 2021 at 6:16 PM Gundala Viswanath <gunda...@gmail.com> wrote: > Does Autodocktools provide a command line for batch processing? > > G.V. > > On Thu, Jun 17, 2021 at 9:24 PM Saurabh Gayali <saurabh.gay...@gmail.com> > wrote: > >> You should use autodocktools [ADT] or openbabel for this purpose. >> Converting PDB to PDBQT. >> >> ------------------------------ >> >> *Saurabh Gayali* / Post Doctoral Fellow >> saurabh.gay...@gmail.com / +91 8800412916 >> >> *CSIR-IGIB* >> <http://example.com/>New Delhi, India >> >> >> On Thu, Jun 17, 2021 at 4:01 PM Gundala Viswanath <gunda...@gmail.com> >> wrote: >> >>> Hi >>> >>> I'm trying to dock a ligand to several hundred PDB files (receptors). I >>> thus need to prepare those files like removing water and adding hydrogen. >>> >>> I can do that manually using Pymol. But it's too troublesome. Is there a >>> way to do it programmatically with Pymol command line procedure? >>> >>> >>> Sincerely, >>> >>> G.V. >>> _______________________________________________ >>> PyMOL-users mailing list >>> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net >>> Unsubscribe: >>> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe >> >> _______________________________________________ > PyMOL-users mailing list > Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net > Unsubscribe: > https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
import os from pymol import cmd req_path=input("Please provide the input directory:") new=os.path.join(req_path,"new") os.mkdir(new) if os.path.isfile(req_path): print(f"the given path {req_path} is a file. Plaese pass only dir") else: all_f_ds=os.listdir(req_path) if len(all_f_ds)==0: print(f" given path {req_path}is empty") else: req_ex=input("Enter the required files extension .pdb:") req_files=[] for each_file in all_f_ds: if each_file.endswith(req_ex): #print(each_file) req_files.append(each_file) if len(req_files)==0: print("thers is no files {req_ex} files in given loacation of {req_path}") else: print(f" there are {len(req_files)} pdbs in the {req_path}") print(f" the required files are :{req_files}") for pdbs in req_files: #index=index+1 cmd.load(pdbs) cmd.remove("resn hoh") #cmd.h_add( string selection="(all)" ) cmd.h_add("all") os.chdir(os.path.join(req_path,"new")) cmd.save(pdbs) os.chdir(req_path) os._exit(0)
_______________________________________________ PyMOL-users mailing list Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net Unsubscribe: https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe