In this article, we will obtain the secondary structure of multiple PDB files present in a directory using DSSP [1]. You need to have DSSP installed on your system.
If not, then you can install it using the following command:
$ sudo apt-get install dssp
Now, let’s obtain dssp files from PDBs.
Keep all your PDB files in a directory, here named pdb_files, and make a directory for your output dssp files, here named dssp_files.
Save the following Python script and run it in the terminal as
$ python3 dssp-to-pdb.py
#!/usr/bin/env python3
import os
import os.path
import pathlib
import sys
pdb_path = os.getcwd()+"/pdb_files"
pdb_files = os.listdir(pdb_path)
dssp_path = os.getcwd()+"/dssp_files"
for pdb in pdb_files:
dssp_filename = pdb.split('.')[0]
cmd = os.system("dssp -i "+" "+pdb_path+"/"+pdb+" "+"-o "+" "+dssp_path+"/"+dssp_filename+".dssp")
print(cmd)
References
- Frishman, D., & Argos, P. (1995). Knowledge-based protein secondary structure assignment. Proteins: Structure, Function, and Bioinformatics , 23 (4), 566-579.