Skip to content
Permalink
b9fe25bf2d
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
35 lines (27 sloc) 925 Bytes
from Bio import PDB
import subprocess
import os
from CSpred.spartap_features import PDB_SPARTAp_DataReader
def test_dssp_parsing():
# Write test PDB file
test_pdb = "test.pdb"
try:
# 2. Run DSSP
print("Running DSSP...")
subprocess.run(["mkdssp", test_pdb], capture_output=True, check=True)
# 3. Use PDB_SPARTAp_DataReader to parse the file
print("Parsing with CSpred...")
reader = PDB_SPARTAp_DataReader()
df = reader.df_from_file_3res(test_pdb)
# 4. Print results
print("\nResults:")
print(f"DataFrame shape: {df.shape}")
print("\nFirst few rows:")
print(df.head())
except Exception as e:
print(f"Error: {str(e)}")
finally:
if os.path.exists(test_pdb + ".dssp"):
os.remove(test_pdb + ".dssp")
if __name__ == "__main__":
test_dssp_parsing()