How do I install DSSP?
3
0
Entering edit mode
7 months ago

I want to use the DSSP module in Biopython to obtain secondary structure information from a PDB file. However, even the example provided on the Biopython page(https://biopython.org/docs/dev/api/Bio.PDB.DSSP.html) doesn't run. I don't understand why I'm getting a FileNotFoundError. Because the "1ycr.pdb" file is in the same directory as my Python script.


How can I resolve this issue?

Do I need to additional install from the DSSP page(https://swift.cmbi.umcn.nl/gv/dssp/)?

Here are the python script and the error message.


from Bio.PDB import PDBParser

from Bio.PDB.DSSP import DSSP

from Bio.PDB import PDBList

p = PDBParser()

structure = p.get_structure("1ycr", "1ycr.pdb")

model = structure[0]

dssp = DSSP(model, "1ycr.pdb")

Traceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\Bio\PDB\DSSP.py", line 386, in __init__
    [dssp, "--version"], universal_newlines=True
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 472, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\DATA\Mediator\230904 IDP DB\230913 secondary structure from DSSP.py", line 21, in <module>
    dssp = DSSP(model, "1ycr.pdb")
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\site-packages\Bio\PDB\DSSP.py", line 400, in __init__
    [dssp, "--version"], universal_newlines=True
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 395, in check_output
    **kwargs).stdout
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 472, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Users\user\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] 
biopython PDB pip DSSP • 1.4k views
ADD COMMENT
1
Entering edit mode
7 months ago
fracarb8 ★ 1.6k

dssp is the name of the original program, and since then multiple implementations have been developed. Following the dssp website , you can get the source code directly from github . I am not sure how things work on windows, but you need to make sure that Biophyton points to the version that is installed in your system.

In ubuntu dssp is called mkdssp, so you need to

sudo apt-get install dssp
sudo ln -s /usr/bin/mkdssp /usr/bin/dssp

That is because Biopython is expecting a dssp executable.

ADD COMMENT
1
Entering edit mode
7 months ago
Jiyao Wang ▴ 370

Did you try to add the path of the file, e.g., “./1ycr.pdb”?

ADD COMMENT
1
Entering edit mode
7 months ago
yhdist ▴ 70

Try to open your file normally and then with DSSP to see if you're getting the error in the former as well. Your file might be in the same folder, but your script might call upon the root folder upon execution.

Note: When you're working with python, you should always use underscores in your file names and folder names if you want a separation. Never spaces.

In other words, this: E:\DATA\Mediator\230904 IDP DB\230913 secondary structure from DSSP.py

Should be like this: E:\DATA\Mediator\230904_IDP_DB\230913_secondary_structure_from_DSSP.py

ADD COMMENT
2
Entering edit mode

When you're working with python, you should always use underscores in your file names and folder names if you want a separation. Never spaces.

Every language out there has a way to work with filenames that have blank spaces in them. It is recommended to avoid spaces so one does not need to account for it but if a programmer/tool developer does not account for a filename with spaces in them, that is just bad programming. Never is a strong word here. It is a good tip nevertheless, OP seems to be a newbie - no experienced developer would use a 5 word title for a script.

ADD REPLY
1
Entering edit mode

Agreed, but OP seems to be working with Windows, hence the advice. In terms of pathways, spaces can be a gigantic threshold for windows to cross for some reason and can be responsible for an unjustified "file not found" error, though that is definitely not the case here.

ADD REPLY

Login before adding your answer.

Traffic: 1572 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