simonduerr commited on
Commit
7133751
1 Parent(s): 6dda5ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -331,9 +331,8 @@ def preprocess_mol(pdb_code="", filepath=""):
331
  mol = Molecule(f"{pdb_code}.pdb")
332
 
333
  print("print molecule loaded")
334
- tf_original = tempfile.NamedTemporaryFile(delete=False, suffix=".pdb")
335
- print(tf_original)
336
- mol.write(tf_original.name)
337
  # clean messy files and only include protein itself
338
  mol.filter("protein")
339
  # renumber using moleculekit 0...len(protein)
@@ -346,13 +345,10 @@ def preprocess_mol(pdb_code="", filepath=""):
346
  indexes.append(j)
347
  j += 1
348
  df["proteinMPNN_index"] = indexes
349
- tf_cleaned = tempfile.NamedTemporaryFile(delete=False, suffix=".pdb")
350
- print("cleaned", tf_cleaned)
351
- mol.write(tf_cleaned.name)
352
- print(os.listdir())
353
- print("tf_cleaned", tf_cleaned.name)
354
- print("tf_original", tf_original.name)
355
- return tf_cleaned.name, df, tf_original.name
356
 
357
 
358
  def assign_sasa(mol):
 
331
  mol = Molecule(f"{pdb_code}.pdb")
332
 
333
  print("print molecule loaded")
334
+ random_dir = tempfile.TemporaryDirectory()
335
+ mol.write(f"{random_dir.name}/original.pdb")
 
336
  # clean messy files and only include protein itself
337
  mol.filter("protein")
338
  # renumber using moleculekit 0...len(protein)
 
345
  indexes.append(j)
346
  j += 1
347
  df["proteinMPNN_index"] = indexes
348
+
349
+ mol.write(f"{random_dir.name}/original.pdb")
350
+
351
+ return f"{random_dir.name}/cleaned.pdb", df, f"{random_dir.name}/original.pdb"
 
 
 
352
 
353
 
354
  def assign_sasa(mol):