Acellera / htmd

HTMD: Programming Environment for Molecular Discovery
https://software.acellera.com/docs/latest/htmd/index.html
Other
255 stars 58 forks source link

Using docking tool #23

Closed asgharrazavi closed 8 years ago

asgharrazavi commented 8 years ago

Hi there,

I am having problems when trying to use the docking tool. I follow the steps for the example on the tutorial (https://www.htmd.org/docs/tutorials/docking-simulation-generators.html), but I receive the following error:

In [1]: from htmd import * Videos from the HTMD2015 workshops are available on the Acellera youtube channel: https://www.youtube.com/user/acelleralive

You are on the latest HTMD version (1.0.16).

In [2]: htmd.config(viewer='ngl')

In [3]: prot = Molecule('bentryp/trypsin.pdb')

In [4]: prot.center()

In [5]: lig = Molecule('bentryp/benzamidine.pdb')

In [6]: poses, scores = dock(prot, lig)

TypeError Traceback (most recent call last)

in () ----> 1 poses, scores = dock(prot, lig) /Users/asr2031/miniconda3/lib/python3.5/site-packages/htmd/dock.py in dock(protein, ligand, center, extent) 97 #from IPython.core.debugger import Tracer 98 #Tracer()() ---> 99 call([babelexe, '-i', 'pdb', protein_pdb, '-o', 'pdbqt', protein_pdbqt, '-xr']) 100 call([babelexe, '-i', 'pdb', ligand_pdb, '-o', 'pdbqt', ligand_pdbqt, '-xhn']) 101 /Users/asr2031/miniconda3/lib/python3.5/subprocess.py in call(timeout, _popenargs, *_kwargs) 558 retcode = call(["ls", "-l"]) 559 """ --> 560 with Popen(_popenargs, *_kwargs) as p: 561 try: 562 return p.wait(timeout=timeout) /Users/asr2031/miniconda3/lib/python3.5/subprocess.py in **init**(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds) 948 c2pread, c2pwrite, 949 errread, errwrite, --> 950 restore_signals, start_new_session) 951 except: 952 # Cleanup if the child failed starting. /Users/asr2031/miniconda3/lib/python3.5/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session) 1465 else: 1466 env_list = None # Use execv instead of execve. -> 1467 executable = os.fsencode(executable) 1468 if os.path.dirname(executable): 1469 executable_list = (executable,) /Users/asr2031/miniconda3/lib/python3.5/os.py in fsencode(filename) 818 return filename.encode(encoding, errors) 819 else: --> 820 raise TypeError("expect bytes or str, not %s" % type(filename).**name**) 821 822 def fsdecode(filename): TypeError: expect bytes or str, not NoneType In [7]: I appreciate the help. Asghar
j3mdamas commented 8 years ago

Hi Asghar, I am testing this. I will let you know. João

j3mdamas commented 8 years ago

Which operating system are you using? I have identified a different error from yours while running the tutorial. I have solved mine and I think yours may be related to the one I identified, even though it is strange that the error is not the same. In my case it's giving a Exec format error while in yours it's a type Error. But I'm pretty sure that my fix will probably fix yours.

Basically it's a bug in htmd_babel, which is not pointing to the binary. I am not sure when a version with the fix will be up, but I'll let you know as soon as possible.

Thanks for reporting, João

asgharrazavi commented 8 years ago

My operating system is OS X EI Capitan. Please let me know if there is a quick fix.

Thanks

j3mdamas commented 8 years ago

Yeah, maybe it's because it's OS and not Linux, which is what I am using.

I will let you know soon if it is going to take longer to release a fix. If it is the case, I will help you with a quick fix.

Thank you for your patience, João

j3mdamas commented 8 years ago

Hello Asghar,

Can you do conda update htmdbabel and try to rerun that part of the tutorial? If it still does not work, can you report the error (if it is the same or not).

Thanks, João

asgharrazavi commented 8 years ago

Hi,

Thank you for getting back to me, however, conda update htmdbabel doesn't work:

$ conda update htmdbabel Error: package 'htmdbabel' is not installed in /Users/asr2031/miniconda3

Also:

$ conda update htmd Using Anaconda Cloud api site https://api.anaconda.org Fetching package metadata: ........

All requested packages already installed.

packages in environment at /Users/asr2031/miniconda3:

# htmd 1.0.16 py35_0 acellera

I tried: $ conda install babel

which installed babel at miniconda3.

When I follow the tutorial example, I get error:

In [9]: poses, scores = dock(prot, lig)

TypeError Traceback (most recent call last)

in () ----> 1 poses, scores = dock(prot, lig) /Users/asr2031/miniconda3/lib/python3.5/site-packages/htmd/dock.py in dock(protein, ligand, center, extent) 97 #from IPython.core.debugger import Tracer 98 #Tracer()() ---> 99 call([babelexe, '-i', 'pdb', protein_pdb, '-o', 'pdbqt', protein_pdbqt, '-xr']) 100 call([babelexe, '-i', 'pdb', ligand_pdb, '-o', 'pdbqt', ligand_pdbqt, '-xhn']) 101 /Users/asr2031/miniconda3/lib/python3.5/subprocess.py in call(timeout, _popenargs, *_kwargs) 558 retcode = call(["ls", "-l"]) 559 """ --> 560 with Popen(_popenargs, *_kwargs) as p: 561 try: 562 return p.wait(timeout=timeout) /Users/asr2031/miniconda3/lib/python3.5/subprocess.py in **init**(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds) 948 c2pread, c2pwrite, 949 errread, errwrite, --> 950 restore_signals, start_new_session) 951 except: 952 # Cleanup if the child failed starting. /Users/asr2031/miniconda3/lib/python3.5/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session) 1465 else: 1466 env_list = None # Use execv instead of execve. -> 1467 executable = os.fsencode(executable) 1468 if os.path.dirname(executable): 1469 executable_list = (executable,) /Users/asr2031/miniconda3/lib/python3.5/os.py in fsencode(filename) 818 return filename.encode(encoding, errors) 819 else: --> 820 raise TypeError("expect bytes or str, not %s" % type(filename).**name**) 821 822 def fsdecode(filename): TypeError: expect bytes or str, not NoneType
j3mdamas commented 8 years ago

Weird that htmdbabel isn't installed by default... Can you do conda install htmdbabel (not the babel package), retry and get back at me?

asgharrazavi commented 8 years ago

Ok, I installed the htmdbabel:

I still get error:

In [1]: from htmd import * Videos from the HTMD2015 workshops are available on the Acellera youtube channel: https://www.youtube.com/user/acelleralive

You are on the latest HTMD version (1.0.16).

In [2]: htmd.config(viewer='ngl')

In [3]: prot = Molecule('bentryp/trypsin.pdb')

In [4]: prot.center()

In [5]: lig = Molecule('bentryp/benzamidine.pdb')

In [6]: poses, scores = dock(prot, lig)

OSError Traceback (most recent call last)

in () ----> 1 poses, scores = dock(prot, lig) /Users/asr2031/miniconda3/lib/python3.5/site-packages/htmd/dock.py in dock(protein, ligand, center, extent) 97 #from IPython.core.debugger import Tracer 98 #Tracer()() ---> 99 call([babelexe, '-i', 'pdb', protein_pdb, '-o', 'pdbqt', protein_pdbqt, '-xr']) 100 call([babelexe, '-i', 'pdb', ligand_pdb, '-o', 'pdbqt', ligand_pdbqt, '-xhn']) 101 /Users/asr2031/miniconda3/lib/python3.5/subprocess.py in call(timeout, _popenargs, *_kwargs) 558 retcode = call(["ls", "-l"]) 559 """ --> 560 with Popen(_popenargs, *_kwargs) as p: 561 try: 562 return p.wait(timeout=timeout) /Users/asr2031/miniconda3/lib/python3.5/subprocess.py in **init**(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds) 948 c2pread, c2pwrite, 949 errread, errwrite, --> 950 restore_signals, start_new_session) 951 except: 952 # Cleanup if the child failed starting. /Users/asr2031/miniconda3/lib/python3.5/subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, start_new_session) 1542 else: 1543 err_msg += ': ' + repr(orig_executable) -> 1544 raise child_exception_type(errno_num, err_msg) 1545 raise child_exception_type(err_msg) 1546 OSError: [Errno 8] Exec format error
j3mdamas commented 8 years ago

Alright, now we're getting somewhere! Now, it's the same error I was having. We should have a fix soon. Sorry for taking so long. Will let you know as soon as it is released. Thanks for reporting!

asgharrazavi commented 8 years ago

Thanks for your help. Please let me know if there is a quick fix before release of the new version.

j3mdamas commented 8 years ago

Hi Asghar, You can now do conda update htmdbabel. It should update to version 2.3.95 and that one should work. Let me know how it goes and I'll close the issue afterwards. Thanks for your patience and I hope you enjoy using HTMD, João

asgharrazavi commented 8 years ago

Looks like it is working now! Thanks a lot.