Error: Dssp With Biopython
2
1
Entering edit mode
12.7 years ago
Veena ▴ 20

Hello,

I am trying to run DSSP with Biopython. I have installed biopython 1.59 with python 2.7.2 in windows OS.

>>> from Bio.PDB.PDBParser import PDBParser
>>> pdbfn ='C://pdb//1B68.pdb'
>>> parser = PDBParser(PERMISSIVE=1)
>>> structure = parser.get_structure("1B68", pdbfn)
>>> model=structure[0]
>>>from Bio.PDB.DSSP import DSSP
>>>dssp = DSSP(model, "1B68.pdb")

Traceback (most recent call last):
 File "<pyshell#10>", line 1, in <module>
dssp = DSSP(model, "1B68.pdb")
File "C:\Python27\lib\site-packages\Bio\PDB\DSSP.py", line 200, in __init_
dssp_dict, dssp_keys = dssp_dict_from_pdb_file(pdb_file, dssp)
File "C:\Python27\lib\site-packages\Bio\PDB\DSSP.py", line 101, in dssp_dict_from_pdb_file
out_dict, keys = make_dssp_dictout_file.name)
File "C:\Python27\lib\site-packages\Bio\PDB\DSSP.py", line 115, in make_dssp_dict
handle = open(filename, "r")
IOError: [Errno 13] Permission denied: 'c:\\users\\veena\\appdata\\local\\temp\\tmparkljc.dssp'
biopython • 8.2k views
ADD COMMENT
0
Entering edit mode

It seems like you do not have permissions for file. May be execute permissions. See here

ADD REPLY
1
Entering edit mode
12.7 years ago

Your error comes from the os.system call in the function dssp_dict_from_pdb_file in DSSP.py:

def dssp_dict_from_pdb_file(in_file, DSSP="dssp"):
    """
    Create a DSSP dictionary from a PDB file.

    Example:
        >>> dssp_dict=dssp_dict_from_pdb_file("1fat.pdb")
        >>> aa, ss, acc=dssp_dict[('A', 1)]

    @param in_file: pdb file
    @type in_file: string

    @param DSSP: DSSP executable (argument to os.system)
    @type DSSP: string

    @return: a dictionary that maps (chainid, resid) to 
        amino acid type, secondary structure code and 
        accessibility.
    @rtype: {}
    """
    out_file = tempfile.NamedTemporaryFile(suffix='.dssp')
    out_file.flush()    # needed?
    os.system("%s %s > %s" % (DSSP, in_file, out_file.name))
    out_dict, keys = make_dssp_dictout_file.name)
    out_file.close()
    return out_dict, keys

So the code calls the DSSP executable to create a DSSP dictionary from a PDB file. You either don't have a working version of DSSP (and a license, free for academic use) on your system. Or your DSSP executable hasn't sufficient permissions.

Get DSSP from http://www.cmbi.kun.nl/gv/dssp/

ADD COMMENT
1
Entering edit mode

Thank you very much for your answer. I have installed DSSP with this link. ftp://ftp.cmbi.ru.nl/pub/software/dssp/ . I am getting output when I use windows command prompt. I used the following command to run DSSP . dssp file.pdb dssp file.dssp

ADD REPLY
0
Entering edit mode

So did that confirm the problem is with your DSSP installation?

ADD REPLY
0
Entering edit mode

I downloaded an .exe. I'm confused as to how to install it. Could you please explain how to install dssp?

ADD REPLY
0
Entering edit mode
7.7 years ago
Peter 6.0k

Doing dssp_dict_from_pdb_file(in_file) is equivalent to dssp_dict_from_pdb_file(in_file, DSSP="dssp") and assumes dssp (or deep.exe under Windows) is on the system $PATH, meaning at the command line you can just type dssp to run it.

One option is to ensure that the folder containing dssp.exe in on your $PATH environment variable (and then restart your shell and Python).

Or, tell Biopython where the binary is, e.g.

dssp_exe = r'C:\MyStuff\tools\dssp.exe'
dssp_dict_from_pdb_file(in_file, DSSP=dssp_exe)

I'm using r'...' for a raw string where things like \t do not get turned into tabs. You could instead us \\t there.

If you have spaces in the folder name you might need to quote this, using r-singlequote-doublequote-path-doublequote-singlequote

dssp_exe = r'"C:\My Stuff\tools for bioinf\dssp.exe"'
dssp_dict_from_pdb_file(in_file, DSSP=dssp_exe)

(I don't have easy access to a Windows machine to test this right now)

ADD COMMENT
0
Entering edit mode

Thank you. I will test that out tomorrow. I have the same question regarding MSMS http://mgl.scripps.edu/people/sanner/html/msms_home.html. I would appreciate if you can tell me which files to download and how to install it.

ADD REPLY

Login before adding your answer.

Traffic: 1750 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6