Advertisement
santimirandarp

problems executing shell

May 6th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. def shell(cmd, shell=False):
  2. if shell:
  3. p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  4. else:
  5. cmd = cmd.split()
  6. p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  7. output, err = p.communicate()
  8. return output
  9.  
  10. def score(mol, orig_mol='1OYT-FSN.pdbqt', prot='1OYT-receptor.pdbqt'): #doesnt work
  11. proteiname=prot.split('-')[0]
  12. molname=mol.split('.')[0]
  13. output_filename=f'{proteiname}-{molname}-redock.pdbqt'
  14. out = shell([
  15. './smina.static',
  16. '-r', prot,
  17. '-l', mol,
  18. ' --autobox_ligand', orig_mol,
  19. '--autobox_add', '8',
  20. '--exhaustiveness', '8',
  21. '-o', output_filename], shell=False)
  22.  
  23.  
  24. def score(mol, orig_mol='1OYT-FSN.pdbqt', prot='1OYT-receptor.pdbqt'): #work
  25. proteiname=prot.split('-')[0]
  26. molname=mol.split('.')[0]
  27. output_filename=f'{proteiname}-{molname}-redock.pdbqt'
  28. out = shell(f'''./smina.static -r {prot} -l {mol} --autobox_ligand
  29. {orig_mol} --autobox_add 8 --exhaustiveness 8 -o {output_filename}''',shell=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement