fatmacankara commited on
Commit
5a8d3dc
·
1 Parent(s): 8302949

Update code/pdb_featureVector.py

Browse files
Files changed (1) hide show
  1. code/pdb_featureVector.py +7 -6
code/pdb_featureVector.py CHANGED
@@ -47,7 +47,6 @@ from add_interface_pos import *
47
  from standard import *
48
  from uniprotSequenceMatch import uniprotSequenceMatch
49
  from process_input import clean_data
50
- from huggingface_hub import hf_hub_download
51
 
52
 
53
  def pdb(input_set, mode, impute):
@@ -219,17 +218,21 @@ def pdb(input_set, mode, impute):
219
  try:
220
  shutil.rmtree('obsolete')
221
  except OSError as e:
222
- pass
223
- pdb_structures_path = path_to_output_files / 'log.txt'
224
  existing_pdb = list(Path(path_to_output_files/'pdb_structures').glob("*"))
 
 
225
  existing_pdb = [str(i) for i in existing_pdb]
226
  existing_pdb = [i.split('/')[-1].split('.')[0].lower() for i in existing_pdb]
227
  cnt = 0
228
  for search in pdbs:
229
-
230
  try:
231
  if search.lower() not in existing_pdb:
 
232
  file = pdbl.retrieve_pdb_file(search, pdir=Path(path_to_output_files / 'pdb_structures'), file_format="pdb")
 
 
233
  else:
234
  print('PDB structure file exists..')
235
  for filename in list(Path(path_to_output_files / 'pdb_structures').glob("*")):
@@ -1306,13 +1309,11 @@ def pdb(input_set, mode, impute):
1306
  existing_free_sasa = list(Path(path_to_output_files / 'freesasa_files').glob("*"))
1307
  existing_free_sasa = [str(i) for i in existing_free_sasa]
1308
  existing_free_sasa = [i.split('/')[-1].split('.')[0] for i in existing_free_sasa]
1309
- st.write('existing_free_sasa', existing_free_sasa)
1310
  print('Calculation RSA for PDB Structure Files...\n')
1311
 
1312
  pdb_only = data[data.source == 'PDB']
1313
  for pdbID in pdb_only.pdbID.to_list():
1314
  if pdbID not in existing_free_sasa:
1315
- st.write('I am here')
1316
  (run_freesasa(Path(path_to_output_files / 'pdb_structures' / f'{pdbID.lower()}.pdb'),
1317
  Path(path_to_output_files / 'freesasa_files' / f'{pdbID.lower()}.txt'), include_hetatms=True,
1318
  outdir=None, force_rerun=False, file_type='pdb'))
 
47
  from standard import *
48
  from uniprotSequenceMatch import uniprotSequenceMatch
49
  from process_input import clean_data
 
50
 
51
 
52
  def pdb(input_set, mode, impute):
 
218
  try:
219
  shutil.rmtree('obsolete')
220
  except OSError as e:
221
+ pass
 
222
  existing_pdb = list(Path(path_to_output_files/'pdb_structures').glob("*"))
223
+ st.write('existing_pdb')
224
+ st.write(existing_pdb)
225
  existing_pdb = [str(i) for i in existing_pdb]
226
  existing_pdb = [i.split('/')[-1].split('.')[0].lower() for i in existing_pdb]
227
  cnt = 0
228
  for search in pdbs:
229
+ st.write('searching for pdb:', search)
230
  try:
231
  if search.lower() not in existing_pdb:
232
+ st.write('path for pdb: ',Path(path_to_output_files / 'pdb_structures'))
233
  file = pdbl.retrieve_pdb_file(search, pdir=Path(path_to_output_files / 'pdb_structures'), file_format="pdb")
234
+ existing_pdb = list(Path(path_to_output_files/'pdb_structures').glob("*"))
235
+ st.write('After retrieving existing pdb folder : ',existing_pdb)
236
  else:
237
  print('PDB structure file exists..')
238
  for filename in list(Path(path_to_output_files / 'pdb_structures').glob("*")):
 
1309
  existing_free_sasa = list(Path(path_to_output_files / 'freesasa_files').glob("*"))
1310
  existing_free_sasa = [str(i) for i in existing_free_sasa]
1311
  existing_free_sasa = [i.split('/')[-1].split('.')[0] for i in existing_free_sasa]
 
1312
  print('Calculation RSA for PDB Structure Files...\n')
1313
 
1314
  pdb_only = data[data.source == 'PDB']
1315
  for pdbID in pdb_only.pdbID.to_list():
1316
  if pdbID not in existing_free_sasa:
 
1317
  (run_freesasa(Path(path_to_output_files / 'pdb_structures' / f'{pdbID.lower()}.pdb'),
1318
  Path(path_to_output_files / 'freesasa_files' / f'{pdbID.lower()}.txt'), include_hetatms=True,
1319
  outdir=None, force_rerun=False, file_type='pdb'))