leandroradusky / pyfoldx

pyFoldX: python bindings for FoldX.
37 stars 4 forks source link

TypeError: expected str, bytes or os.PathLike object, not NoneType when trying to call repair or getTotalEnergy #8

Closed shashank76 closed 3 months ago

shashank76 commented 3 months ago

When I'm trying to when I'm trying to the below code, showing error as foldx_location as none but I'm already setting this path to access downloaded pyfoldx executable file. I'm using it in colab notebook and os.environ['FOLDX_LOCATION'] = './foldx/foldx_20241231'

obj = Structure("pred", path=path) obj = obj.repair(verbose=False) error message:

in compute_energy(path) 2 print(os.environ.get('FOLDX_LOCATION'), path) 3 obj = Structure("pred", path=path) ----> 4 obj = obj.repair(verbose=False) 5 energy = obj.getInterfaceEnergy(verbose=False)['Interaction Energy'].values[0] 6 return float(energy)

/usr/local/lib/python3.10/dist-packages/pyfoldx/structure/structure.py in repair(self, fix_residues, verbose) 324 print( "Repairing structure..." ) 325 --> 326 ret = foldxHandler.getRepairedStructure(self, fix_residues) 327 328 if verbose:

/usr/local/lib/python3.10/dist-packages/pyfoldx/foldx/foldxHandler.py in getRepairedStructure(st, fix_residues, other_parameters) 287 288 # Run FoldX --> 289 runFoldX(command = "RepairPDB", 290 working_folder = TMP_FOLDER, 291 pdb = "tmp.pdb",

/usr/local/lib/python3.10/dist-packages/pyfoldx/foldx/foldxHandler.py in runFoldX(command, working_folder, pdb, other_parameters, working_with_rna, silent, consider_waters) 45 46 with out: ---> 47 checkFoldx() 48 49

/usr/local/lib/python3.10/dist-packages/pyfoldx/foldx/foldxHandler.py in checkFoldx() 29 30 def checkFoldx(): ---> 31 if not FileHandler.fileExists(FOLDX_LOCATION): 32 print("FoldX executable not found, please set the variable FOLDX_LOCATION") 33 exit(0)

/usr/local/lib/python3.10/dist-packages/pyfoldx/handlers/fileHandler.py in fileExists(path) 28 ''' 29 try: ---> 30 with open(path): return True 31 except IOError: 32 return False

TypeError: expected str, bytes or os.PathLike object, not NoneType