0
votes

I am facing problem with this error, on the very first place I created the file compcode1 and on the second step I am trying to read the same file which is compcode1 from the path path_compcode1 and it gives me the following error

WindowsError: [Error 2] The system cannot find the file specified.

# Extract Secondary Secondary Structure Elements (SSEs)    

def Secondary_Structure(self, code, flag):

    curr_dir = os.path.dirname(os.path.abspath(__file__))     # cuurent directory
    dest_dir = os.path.join(curr_dir, 'Output')

    if flag == 1:
        compcode1 = '1Complete_' + code + '.pdb'  
        path_compcode1 = os.path.join(dest_dir, compcode1)
        print path_compcode1
    else:
        compcode2 = '2Complete_' + code + '.pdb'
        path_compcode2 = os.path.join(dest_dir, compcode2)
        print path_compcode2



    self.SSE = []
    p = PDBParser()
    if flag == 1:
        s = p.get_structure('pdb1', path_compcode1)
    else:
        s = p.get_structure('pdb2', path_compcode2)


    model = s[0]
    if flag == 1:                              #### Flag 1: 1st pdb file
        d = DSSP(model, path_compcode1)
    elif flag == 2:                            #### Flag 2: 2nd pdb file                            
        d = DSSP(model, path_compcode2)
    else:
        print "Oops: Error"    

        print "dssp: Secondary Structure"

Traceback:

C:\Users\..\Output\1Complete_1cwa.pdb 
Traceback (most recent call last):
  File "Main_Program.py", line 3353, in <module> 
    main()
  File "Main_Program.py", line 156, in main
    EM_obj1.Secondary_Structure(code, flag)     #### This will extract dssp
  File "C:\Users\..\Output\Module_ContMat.py", line 369, in Secondary_Structure
     d = DSSP(model, compcode1)
  File "c:\Python27\lib\site-packages\Bio\PDB\DSSP.py", line 303, in __init__
     dssp_dict, dssp_keys = dssp_dict_from_pdb_file(in_file, dssp)
  File "c:\Python27\lib\site-packages\Bio\PDB\DSSP.py", line 133, in dssp_dict_from_pdb_file
     stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "c:\Python27\lib\subprocess.py", line 711, in __init__
     errread, errwrite)
  File "c:\Python27\lib\subprocess.py", line 959, in _execute_child
     startupinfo) 
WindowsError: [Error 2] The system cannot find the file specified
1

1 Answers

0
votes

It's not your file that's not being found; it's some executable program called dssp that is being launched to process your file. Either it's not on your $PATH, or it's simply not installed at all - I am not at all familiar with this library you're using, so I have no idea if there's an additional installation step needed here.

If you do have the program, it appears than an alternative to editing your $PATH would be to add a dssp= parameter to the DSSP() constructor, specifying the full pathname to this program.