simonduerr commited on
Commit
7f2c740
1 Parent(s): b23fbc2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -309,13 +309,16 @@ def get_pdb(pdb_code="", filepath=""):
309
 
310
 
311
  def preprocess_mol(pdb_code="", filepath=""):
 
 
312
  if pdb_code is None or pdb_code == "":
313
  try:
314
  mol = Molecule(filepath.name)
315
  except AttributeError as e:
316
  return None
317
  else:
318
- mol = Molecule(pdb_code)
 
319
  mol.write("original.pdb")
320
  # clean messy files and only include protein itself
321
  mol.filter("protein")
@@ -426,9 +429,9 @@ def update(
426
  )
427
  from protein_mpnn_utils import StructureDataset, StructureDatasetPDB, ProteinMPNN
428
 
429
- # pdb_path = get_pdb(pdb_code=inp, filepath=file)
430
 
431
- pdb_path, mol_index = preprocess_mol(pdb_code=inp, filepath=file)
432
 
433
  if pdb_path == None:
434
  return "Error processing PDB"
 
309
 
310
 
311
  def preprocess_mol(pdb_code="", filepath=""):
312
+ print(filepath.name)
313
+ print(pdb_code)
314
  if pdb_code is None or pdb_code == "":
315
  try:
316
  mol = Molecule(filepath.name)
317
  except AttributeError as e:
318
  return None
319
  else:
320
+ os.system(f"wget -qnc https://files.rcsb.org/view/{pdb_code}.pdb")
321
+ mol = Molecule(f"{pdb_code}.pdb")
322
  mol.write("original.pdb")
323
  # clean messy files and only include protein itself
324
  mol.filter("protein")
 
429
  )
430
  from protein_mpnn_utils import StructureDataset, StructureDatasetPDB, ProteinMPNN
431
 
432
+ #pdb_path = get_pdb(pdb_code=inp, filepath=file)
433
 
434
+ pdb_path, mol_index = preprocess_mol(pdb_code=inp,filepath=file)
435
 
436
  if pdb_path == None:
437
  return "Error processing PDB"