[Biopython] Problems with using Bio.PDB.NACCESS

Peter Cock p.j.a.cock at googlemail.com
Mon Apr 6 22:45:02 UTC 2015


On Mon, Apr 6, 2015 at 11:31 PM, Alaksh Choudhury
<Alaksh.Choudhury at colorado.edu> wrote:
> Hi,
>
> Thanks a lot for your previous response. I tried to change the temppath
> location, but I still get error while running the code. Please let me know
> if there is a fix for the same. I really appreciate your help.
>
> ...
> import Bio.PDB.NACCESS as nac
> temppath_name = 'C:\Users\user\fileName'
> data = nac.run_naccess(structure[0],'1BVU.pdb',temp_path = temppath_name)
> ...
> WindowsError: [Error 2] The system cannot find the file specified

This strongly suggests you have not installed naccess, or if you
have, that is is not on the $PATH. What happens if you attempt to
run it by hand from the Windows command prompt? i.e. naccess
or nacess.exe

If you can only run naccess with the full path, you'll just have to
give the full path to Biopython for when it builds the command line
to call. e.g. Something like this:

import Bio.PDB.NACCESS as nac
temppath_name = r'C:\Users\user\fileName'
nacces_binary = r'C:\Program Files\nacces\nacess.exe'
data = nac.run_naccess(structure[0], '1BVU.pdb',
                               naccess=nacces_binary,
                               temp_path=temppath_name)

Note I am using r prefixes on the strings because I want raw
mode, otherwise Python treats \n as a new line etc.

Peter


More information about the Biopython mailing list