simonduerr commited on
Commit
f5e3ed9
1 Parent(s): 7aedea4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -5,6 +5,7 @@ import warnings
5
  import copy
6
  import random
7
  import re
 
8
 
9
  import os.path
10
 
@@ -331,8 +332,9 @@ def preprocess_mol(pdb_code="", filepath=""):
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)
@@ -346,9 +348,9 @@ def preprocess_mol(pdb_code="", filepath=""):
346
  j += 1
347
  df["proteinMPNN_index"] = indexes
348
 
349
- mol.write(f"{random_dir.name}/cleaned.pdb")
350
 
351
- return f"{random_dir.name}/cleaned.pdb", df, f"{random_dir.name}/original.pdb"
352
 
353
 
354
  def assign_sasa(mol):
 
5
  import copy
6
  import random
7
  import re
8
+ import datetime
9
 
10
  import os.path
11
 
 
332
  mol = Molecule(f"{pdb_code}.pdb")
333
 
334
  print("print molecule loaded")
335
+ random_dir = f"jobs/{datetime.now().isoformat()}"
336
+ os.system(f"mkdir -p {random_dir}")
337
+ mol.write(f"{random_dir}/original.pdb")
338
  # clean messy files and only include protein itself
339
  mol.filter("protein")
340
  # renumber using moleculekit 0...len(protein)
 
348
  j += 1
349
  df["proteinMPNN_index"] = indexes
350
 
351
+ mol.write(f"{random_dir}/cleaned.pdb")
352
 
353
+ return f"{random_dir}/cleaned.pdb", df, f"{random_dir}/original.pdb"
354
 
355
 
356
  def assign_sasa(mol):