fatmacankara commited on
Commit
26f6c21
·
1 Parent(s): 3c047f4

Update code/pdb_featureVector.py

Browse files
Files changed (1) hide show
  1. code/pdb_featureVector.py +5 -0
code/pdb_featureVector.py CHANGED
@@ -226,12 +226,15 @@ def pdb(input_set, mode, impute):
226
  existing_pdb = [str(i) for i in existing_pdb]
227
  existing_pdb = [i.split('/')[-1].split('.')[0].lower() for i in existing_pdb]
228
  cnt = 0
 
229
  for search in pdbs:
230
  st.write('PDBS', search)
231
 
232
  try:
233
  if search.lower() not in existing_pdb:
 
234
  file = pdbl.retrieve_pdb_file(search, pdir=Path(path_to_output_files / 'pdb_structures'), file_format="pdb")
 
235
  else:
236
  print('PDB structure file exists..')
237
  for filename in list(Path(path_to_output_files / 'pdb_structures').glob("*")):
@@ -250,6 +253,7 @@ def pdb(input_set, mode, impute):
250
  resolution_method = parser.get_structure(search, file)
251
  for record in SeqIO.parse(file, "pdb-seqres"):
252
  if record.dbxrefs[0].split(':')[0] == 'UNP':
 
253
  pdb_fasta.at[index, 'pdbID'] = record.id.split(':')[0]
254
  pdb_fasta.at[index, 'chain'] = record.id.split(':')[1]
255
  pdb_fasta.at[index, 'pdbSequence'] = str(record.seq)
@@ -259,6 +263,7 @@ def pdb(input_set, mode, impute):
259
  pdb_info.at[index, 'resolution'] = resolution_method.header['resolution']
260
  index += 1
261
  except:
 
262
  IndexError
263
  pdb_info.at[index, 'uniprotID'] = 'nan'
264
  pdb_info.at[index, 'pdbID'] = 'nan'
 
226
  existing_pdb = [str(i) for i in existing_pdb]
227
  existing_pdb = [i.split('/')[-1].split('.')[0].lower() for i in existing_pdb]
228
  cnt = 0
229
+ st.write('existing_pdb', existing_pdb)
230
  for search in pdbs:
231
  st.write('PDBS', search)
232
 
233
  try:
234
  if search.lower() not in existing_pdb:
235
+ st.write(Path(path_to_output_files / 'pdb_structures'))
236
  file = pdbl.retrieve_pdb_file(search, pdir=Path(path_to_output_files / 'pdb_structures'), file_format="pdb")
237
+ st.write(file)
238
  else:
239
  print('PDB structure file exists..')
240
  for filename in list(Path(path_to_output_files / 'pdb_structures').glob("*")):
 
253
  resolution_method = parser.get_structure(search, file)
254
  for record in SeqIO.parse(file, "pdb-seqres"):
255
  if record.dbxrefs[0].split(':')[0] == 'UNP':
256
+ st.write('RECORD', record)
257
  pdb_fasta.at[index, 'pdbID'] = record.id.split(':')[0]
258
  pdb_fasta.at[index, 'chain'] = record.id.split(':')[1]
259
  pdb_fasta.at[index, 'pdbSequence'] = str(record.seq)
 
263
  pdb_info.at[index, 'resolution'] = resolution_method.header['resolution']
264
  index += 1
265
  except:
266
+ st.write('ERROR INDEX')
267
  IndexError
268
  pdb_info.at[index, 'uniprotID'] = 'nan'
269
  pdb_info.at[index, 'pdbID'] = 'nan'