fatmacankara commited on
Commit
bde8ba1
·
1 Parent(s): de86148

Update code/pdb_featureVector.py

Browse files
Files changed (1) hide show
  1. code/pdb_featureVector.py +25 -3
code/pdb_featureVector.py CHANGED
@@ -236,15 +236,36 @@ def pdb(input_set, mode, impute):
236
  path_pdb = 'out_files/pdb/pdb_structures'
237
  st.write('path for pdb: ', path_pdb)
238
  file = pdbl.retrieve_pdb_file(search, pdir=path_pdb, file_format="pdb")
 
239
  st.write('file: ', file)
240
- existing_pdb = list(Path(path_to_output_files / 'pdb_structures').glob("*"))
241
 
 
242
  st.write('after download:', existing_pdb)
243
- st.write(Path(path_to_output_files / 'pdb_structures') , path_pdb)
244
 
245
  existing_pdb = list(glob.glob(f"{path_pdb}/*"))
246
  st.write('after download 2:', existing_pdb)
247
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  resolution_method = parser.get_structure(search, file)
249
  for record in SeqIO.parse(file, "pdb-seqres"):
250
  if record.dbxrefs[0].split(':')[0] == 'UNP':
@@ -398,7 +419,8 @@ def pdb(input_set, mode, impute):
398
  pdb_fasta = None
399
  pdb_info = None
400
  pdbs = None
401
- existing_pdb = None
 
402
  with_pdb_size = len(with_pdb.drop_duplicates(['datapoint']))
403
  with_pdb = None
404
 
 
236
  path_pdb = 'out_files/pdb/pdb_structures'
237
  st.write('path for pdb: ', path_pdb)
238
  file = pdbl.retrieve_pdb_file(search, pdir=path_pdb, file_format="pdb")
239
+
240
  st.write('file: ', file)
 
241
 
242
+ existing_pdb = list(Path(path_to_output_files / 'pdb_structures').glob("*"))
243
  st.write('after download:', existing_pdb)
 
244
 
245
  existing_pdb = list(glob.glob(f"{path_pdb}/*"))
246
  st.write('after download 2:', existing_pdb)
247
 
248
+ st.write('NEW MWTHID')
249
+
250
+
251
+
252
+
253
+ # Define the URL to retrieve the PDB file
254
+ url = f"https://files.rcsb.org/download/{search}.pdb"
255
+
256
+ # Send an HTTP GET request to the PDB website to download the PDB file
257
+ response = requests.get(url)
258
+
259
+ # Check if the request was successful
260
+ if response.status_code == 200:
261
+ # Save the PDB file to a local file
262
+ with open(f"path_pdb/{search}.pdb", "wb") as f:
263
+ f.write(response.content)
264
+ st.write(f"PDB file {search}.pdb downloaded successfully.")
265
+ else:
266
+ st.write(f"Failed to retrieve PDB file for {search}.")
267
+
268
+
269
  resolution_method = parser.get_structure(search, file)
270
  for record in SeqIO.parse(file, "pdb-seqres"):
271
  if record.dbxrefs[0].split(':')[0] == 'UNP':
 
419
  pdb_fasta = None
420
  pdb_info = None
421
  pdbs = None
422
+
423
+ g_pdb = None
424
  with_pdb_size = len(with_pdb.drop_duplicates(['datapoint']))
425
  with_pdb = None
426