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]
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.
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.